Hi everyone I´m very new to all of these, and I´m working on my first automations, I have some already running but I have two of them that I´ve already tried to do a lot and it doesn´t work at all, first is a automation that turn on the tv when I arrive at home and my phone is detected by my router, but I´m trying to put a condition to not turn on when it´s already on, otherwise if I left the network for some reason it switch again and turn it off, here´s my confi.yaml:
alias: turn on tv when arrive at home
trigger:
entity_id: device_tracker.2c4d54de5ed3
from: not_home
platform: state
to: home
condition:
condition: state
entity_id: switch.tv
state: ‘off’
action:
data:
entity_id: switch.tv
service: switch.turn_on
The second is to not turn off my led in my motion detected when I arrive home:
- id: '1530727435325'
alias: Turn off motion sensor when at home
trigger:
- entity_id: device_tracker.2c4d54de5ed3
from: Not home
platform: state
to: Home
condition: []
action:
- data:
Entity_id: automation_d1_motion_on
service: automation.turn_off
on the tv automation replace in the condition section the switch.tv for this sensor which in this specific example would be called binary_sensor.living_tv
the motion sensor if I understand correctly, will turn off an automation called automation.d1_motion_on
when the device changes to home
it worked, don´t know what I did but it seems that using the internal automation tools in hassio is making mistakes so I rewrote in config.yaml and worked, also was great abou the binary sensor tks very much