Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Example configuration entry
- light:
- - platform: monochromatic
- output: output_component1
- id: xmas_light
- # Example output entry
- output:
- - platform: esp8266_pwm
- id: output_component1
- pin: D3
- switch:
- - platform: template
- id: xmas_light_switch
- name: "${device_name}"
- restore_state: true
- turn_on_action:
- - switch.template.publish:
- id: xmas_light_switch
- state: on
- - while:
- #只要開關是打開的就一直持續這個流程
- condition:
- switch.is_on: xmas_light_switch
- then:
- #10秒間將亮度調到最大
- - light.turn_on:
- id: xmas_light
- brightness: 100%
- transition_length: 10s
- - delay: 10s
- - delay: 30s
- #5秒間將亮度調到關閉
- - light.turn_on:
- id: xmas_light
- brightness: 0%
- transition_length: 5s
- - delay: 5s
- turn_off_action:
- - switch.template.publish:
- id: xmas_light_switch
- state: off
- - light.turn_off:
- id: xmas_light
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement