I have a zwave tilt sensor on my garage doors. I have a switch on each door to trigger it to open or close.
I’m currently only able to get “open” and “closed” states on my doors, but I’d like it to show “opening” and “closing” states as well. I’m thinking I need to update the value template with some kind of logic to check if the previous state was closed and the switch was pressed then show “opening”, and the opposite for the “closing” state.
I’ve never done anything like this in a template and it seems like it would be some fairly complex logic. Is there a way to check previous states like this or is there a simpler way to try and get what I want?
My existing value template looks like this:
- platform: template
covers:
dual_bay_garage_door:
device_class: garage
friendly_name: Dual Bay Garage Door
value_template: "{{ is_state('binary_sensor.garage_dual_bay_door_tilt_sensor_any', 'on') }}"
Thanks, I will take a look next time I am at my PC.
As for the IDs question, it just has to be a unique number for each automation. If you use the Home Assistant GUI to create the automation, it will generate the numbers for you.