Hello,
I am able to receive MQTT message to hassio about the switch relay status (ON of OFF).
How can I make a sensor template or use something similar that I would have a seconds (just seconds) counter of how much time in a day/month or year is the relay “ON”.
And I must not loose this value in case hassio restarts.
Example on how it shoudl work:
- Tasmota: Relay in ON, counter in hassio starts counting seconds
- Tasmota: Relay in OFF, counter in hassio stops counting seconds
- Tasmota: Relay in ON, counter in hassio starts counting seconds from the last point (seconds) it stopped (point 2.).
- Tasmota: Relay in ON, counter in hassio starts counting seconds. and so on…
And let say it would reset this value to 0 each month.
So each month it automatically would start from 0.
What am trying to do is to have wemos D1 mini (with tasmota) connected to an output from oil burner to calculate with oil consumption (seconds X constant liters per second).