diff --git a/examples/mqtt.py b/examples/mqtt.py index b0c6990..e467aef 100644 --- a/examples/mqtt.py +++ b/examples/mqtt.py @@ -36,7 +36,12 @@ Connected = False #global variable for the state of the connection broker = "192.168.99.224" port = 1883 -topic = "openWB/evu/W" +topic_wHouseConsumption = "openWB/global/WHouseConsumption" +topic_pvProduction = "openWB/pv/W" +topic_energyImportExport = "openWB/evu/W" +topic_houseBatterySoC = "openWB/housebattery/%Soc" +topic_houseBatteryLoadUnload = "openWB/housebattery/W" + username = "mqtt-user" pw = "phio6yiR9ohs1veeghu4WaeGhaiRi8he4EiWasheev4faeku8tohdiuthah7zahP" client_id = "solarmonitor" @@ -53,7 +58,11 @@ client.loop_start() #start the loop while Connected != True: #Wait for connection time.sleep(1) -client.subscribe(topic) +client.subscribe(topic_wHouseConsumption) +client.subscribe(topic_pvProduction) +client.subscribe(topic_energyImportExport) +client.subscribe(topic_houseBatterySoC) +client.subscribe(topic_wHouseCtopic_houseBatteryLoadUnloadonsumption) try: while True: