reinhard-brandstaedter / solarflow-statuspage

A simple statuspage with live-data from Zendure's Solarflow Hub for those who do not want to use the App
22 stars 6 forks source link

the new master doesn't work on (my) hub2000 , the old dev worked! #51

Open joe63 opened 2 weeks ago

joe63 commented 2 weeks ago

hi, I updated from :dev(worked) to master. Now I get this Keyerror. Container run's but there is no connection to port 5000.

I get this message n the log-file.

2024-06-25 13:29:14,767:ERROR: No configuration file (config.ini) found in execution directory! Using environment variables. 2024-06-25 13:29:14,806:INFO: Connectiong local MQTT: 192.168.1.144:1883 2024-06-25 13:29:14,806:INFO: Connecting to MQTT with: solarflow-statuspage-86 2024-06-25 13:29:14,807:INFO: Subscribing to topics... Traceback (most recent call last): File "//solarflow-status.py", line 419, in setup() File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(args, **kwargs) File "//solarflow-status.py", line 404, in setup local_mqtt_background_task() File "//solarflow-status.py", line 338, in local_mqtt_background_task local_subscribe(client) File "//solarflow-status.py", line 274, in local_subscribe report_topic = f'/{device_details["productKey"]}/+/properties/report' KeyError: 'productKey'

joe63 commented 2 weeks ago

the last :dev works

thank you!!

joe63 commented 2 weeks ago

Hi, I have tried to step through the code of the solarflow-status:master to see where the key productKey in the device_details-dictionary should be inserted. I use it offline , so the get_auth() would not be used.

image

the section where the key is added to the dictionary (2) is used/executed later then the value is needed (1)

image

when I insert the productkey and the deviceKey hardcoded in then setup-offline-section it works. image

my main-question is: is there nobody else with this setting? and the sub-question is: does solarflow-control need solarflow-status? I think not it's only for visualizing?! when using homeassistant or any other mqtt-viewing-tool ist not needed and therefore the problem is at the time rarely to see.

reinhard-brandstaedter commented 2 weeks ago

master has not merged from dev, yet. The fix is only in dev at the moment.

Statuspage is not needed for sf-control, it is only a helper visualization/mobile app replacement.

The more common setup is sf-control, homeassistant and/or mqtt to timeseries database and visualization with e.g grafana.