Hello,
I want to automate my pool and need timers for the switches to record how long they were on and off.
I would then like to use these to control my automation with conditions.
This is working so far for example:
- trigger:
- platform: state
entity_id: switch.pool_pump_switch
from: 'on'
to: 'off'
sensor:
- unique_id: pool_pump_time_off
name: "test1 pool pump off"
state: "{{trigger.to_state.last_changed}}"
device_class: timestamp
However, I would need the values in seconds since the switch was last in the on or off state.
Is there a way to do this?
1 post - 1 participant