Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- output:
- - platform: gpio
- pin: D3
- id: relay
- switch:
- - platform: template
- name: "PC"
- lambda: 'return id(pc_power).state'
- turn_on_action:
- - switch.turn_on: pc
- turn_off_action:
- - switch.turn_off: pc
- - platform: template
- name: "PC switch"
- id: pc
- turn_on_action:
- - output.turn_on: relay
- - delay: 0.5s
- - output.turn_off: relay
- turn_off_action:
- - output.turn_on: relay
- - delay: 0.5s
- - output.turn_off: relay
- binary_sensor:
- - platform: gpio
- pin: D5
- filters:
- - delayed_off: 500ms
- id: pc_power
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement