Hello, I started using HA yesterday. Before HA I used Domoticz, so I’m kinda new to HA.
I have 1 small problem: I receive a command from my motion sensor and the state is changed from ‘Unknown’ to ‘Motion’. However, the state remains ‘Motion’ and does not go back to ‘Standby’ (or ‘No motion’), so HA incorrectly thinks there is always motion. (btw. I receive RF signals from kerui motion sensors via rfxtrx)
Can I change the state with a timer after 30 sec of no commands receiving to ‘Standby’/‘No motion’?
I was thinking about:
condition:
- condition: template
value_template: >
{%- if states.sensor.motion2_sensor_status.last_changed -%}
{{(as_timestamp(now()) - as_timestamp(states.sensor.motion2_sensor_status.last_changed)) > 30}}
{%- else -%}
false
{%- endif -%}
trigger:
- platform: time
minutes: '/5'
Thank you