Hello everybody,
I have automation,which torn on / of switch when some device change status from / to home. Automation is working well, but I feel like it can be written in some mor sophisticated way. Somethong shorter with IF / ELSE maybe… What would be best syntax?
alias: PowerOnNotebook
description: ''
trigger:
- entity_id: device_tracker.notebook
from: not_home
platform: state
to: home
condition: []
action:
- data:
entity_id:
- switch.63743864dc4f22d434c2
service: switch.turn_on
- id: '1572906181158'
alias: PowerOffNotebook
description: ''
trigger:
- entity_id: device_tracker.notebook
from: home
platform: state
to: not_home
condition: []
action:
- data:
entity_id:
- switch.63743864dc4f22d434c2
service: switch.turn_off