Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- output:
- - platform: gpio
- pin: D7
- id: relay
- switch:
- - platform: template
- id: pc
- name: "PC"
- lambda: 'return id(pc_power).state;'
- turn_on_action:
- - switch.turn_on: pc_switch
- turn_off_action:
- - switch.turn_off: pc_switch
- - platform: template
- name: "PC switch"
- id: pc_switch
- 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
- # Example configuration entry
- binary_sensor:
- - platform: analog_threshold
- id: pc_power
- sensor_id: led
- threshold: 0.1
- sensor:
- - platform: adc
- pin: A0
- id: led
- update_interval: 1s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement