I’ve tried to setup a simple automation to turn off an MQTT socket when I leave.
Individually by setting up the appropriate cards I can see my own presence working, and I can toggle the state of the socket. So individual pieces are working.
What I can’t get is the automation to work on being away for 5 minutes to turn the socket off. It’s all in place, the automation shows up in the UI including history as apparently valid, but it never seems to work.
I’ve read various instructions/examples though none of them seem to be a complete example similar to what I’m trying to do.
I have other automations which work, change of state of one thing changing the state of another.
I have turned up logging, but get nothing useful, either it’s not doing anything or it’s not logging - hard to tell.
Anyone got any ideas. Here is the automation.
- id: '1550396606995'
alias: Left House
trigger:
- entity_id: device_tracker.v20
for:
minutes: 5
from: 'Home'
platform: state
to: 'Away'
condition: []
action:
- service: homeassistant.turn_off
entity_id: switch.iron_power