reinhard-brandstaedter / solarflow-control

A tool to automatically control Zendure's Solarflow hub with more flexibility to match home power demand
70 stars 12 forks source link

Safe last state on restart #95

Closed ricariel closed 11 months ago

ricariel commented 11 months ago

Every time the container restarts (automatically if new image is present on docker hub) important values are lost. Example: solarflow.py -> self.lastFullTS self.lastEmptyTS

Would be nice if these and perhaps other values get stored somewhere.

reinhard-brandstaedter commented 11 months ago

Actually exactly these values are stored as retained messages in MQTT:

image

As those are retained messages they are read in again upon startup. However it could be that the mqtt broker is not persisting these retained messages upon restart?

ricariel commented 11 months ago

Read the code again. You are correct. Code just never reached that state with control running. Pardon.