Script which reads out the current measured values of an inverter of the SMA Tripower x (STP XX-50) series and makes them available via MQTT Home Assistant.
Today I tested it without enabling ExitAfter. But after some time I did not get any updates.
So I tried to enable ExitAfter/cronjob.
One of the last commits, which added threading, broke the functionality of ExitAfter because the cfg variable does now only contain device option keys inside the updateTripower function.
I already fixed it for my self, by giving updateTripower additional a new complete cfg argument instead of only the device part of yaml options. Its not nice, but works for me.
Thank you for your project.
Today I tested it without enabling ExitAfter. But after some time I did not get any updates. So I tried to enable ExitAfter/cronjob.
One of the last commits, which added threading, broke the functionality of ExitAfter because the cfg variable does now only contain device option keys inside the updateTripower function.
https://github.com/littleyoda/Home-Assistant-Tripower-X-MQTT/blob/47ce3db582ec143b016d9920e9b5fb1bbce9de02/sma2mqtt.py#L217 https://github.com/littleyoda/Home-Assistant-Tripower-X-MQTT/blob/47ce3db582ec143b016d9920e9b5fb1bbce9de02/sma2mqtt.py#L219
cfg["ExitAfter"] is outside of cfg["Devices"], so it will be always None https://github.com/littleyoda/Home-Assistant-Tripower-X-MQTT/blob/47ce3db582ec143b016d9920e9b5fb1bbce9de02/sma2mqtt.py#L105
I already fixed it for my self, by giving updateTripower additional a new complete cfg argument instead of only the device part of yaml options. Its not nice, but works for me.