- alias: Turn on the power when you go home
trigger:
- platform: state
entity_id: device_tracker.iphone
from: not_home
to: home
action:
- service: switch.turn_on
entity_id:
- switch.plug_158d0001dc7140
- switch.closestool_socket
- alias: Turn off the lights when unmanned
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d000122a6b4
to: 'off'
action:
- service: light.turn_off
entity_id:
- light.sonoff_1
- alias: Some people light up the lights
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d000122a6b4
to: 'on'
action:
- service: light.turn_on
entity_id:
- light.sonoff_1
- alias: Turn off the lights when unmanned
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d000122a6b4
form: 'on'
to: 'off'
action:
- service: light.turn_off
entity_id:
- light.sonoff_1
- alias: Some people light up the lights
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d000122a6b4
from: 'off'
to: 'on'
action:
- service: light.turn_on
entity_id:
- light.sonoff_1
例如:
在最后一个
- alias: Some people light up the lights
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d000122a6b4
from: 'off'
to: 'on'
condition:
condition: state
entity_id: light.sonoff_1
state: 'on'
action:
- service: light.turn_off
entity_id:
- light.sonoff_1
试试看,我没对齐格式,请自己看一下
不太会用回复的打