Hey!
I'm writing a Python script to fetch data from the ESS schedules automatically.
def on_connect(client: mqtt.Client, userdata, flags, rc): client.subscribe("N/%s/system/0/Serial" % portal_id) client.subscribe("N/%s/settings/0/Settings/CGwacs/BatteryLife/Schedule/Charge/%d/Day" % (portal_id, num))
def on_message(client, userdata, msg): val = json.loads(msg.payload) print(msg.topic+" -> "+str(val))
It works fine if I have my Remote Console open on the browser, but if I close it or leave the tab - after a ~0.5-1min mqtt subscription does not return any values.
/system/0/Serial though works fine at any time not depending on an open/close state on the web page.
Have someone faced the same issue?
Maybe there is a way to ping/send keepalive?
I really appreciate any help you can provide.
Best,
Ivan