This commit is contained in:
robert 2024-01-31 23:28:40 +00:00
parent f769139ed4
commit e92998971a
1 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@ logging.basicConfig(level=logging.DEBUG)
#mqtt_password = '3355' # MQTT client password #mqtt_password = '3355' # MQTT client password
client_id = 'solarmonitor' # unique client_id client_id = 'solarmonitor' # unique client_id
mqtt_broker = "openwb-2" # broker address, usually your HASS IP address mqtt_broker = "openwb-2" # broker address, usually your HASS IP address
port = 1883
#set topics #set topics
topic_house_battery_soc = "openWB/bat/get/soc" topic_house_battery_soc = "openWB/bat/get/soc"
@ -48,7 +49,7 @@ def connect_mqtt():
client = mqtt_client.Client(client_id) client = mqtt_client.Client(client_id)
# client.username_pw_set(username, password) # client.username_pw_set(username, password)
client.on_connect = on_connect client.on_connect = on_connect
client.connect(broker, port) client.connect(mqtt_broker, port)
return client return client