Last active
August 23, 2025 19:53
-
-
Save SirEdvin/0f61ab3c08718571c824b5842a9feeaa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Smart Light Control with Switch | |
| description: > | |
| Control lights with a smart switch button. First press turns on the switch, | |
| subsequent presses toggle lights with different brightness and color temperature | |
| based on light mode (Day/Night). | |
| domain: automation | |
| input: | |
| switch_device: | |
| name: Smart Switch Device | |
| description: The smart switch device that triggers the automation | |
| selector: | |
| device: | |
| switch_device_action: | |
| name: Smart Switch Device action | |
| selector: | |
| select: | |
| options: | |
| - single_left | |
| - single_right | |
| - double_left | |
| - double_right | |
| - single | |
| - double | |
| switch_device_entity: | |
| name: Switch device entity | |
| selector: | |
| entity: | |
| filter: | |
| - domain: switch | |
| target_light: | |
| name: Target Light | |
| description: The light entity to control | |
| selector: | |
| entity: | |
| filter: | |
| - domain: light | |
| day_color_temp: | |
| name: Day Mode Color Temperature | |
| description: Color temperature for day mode (in mireds) | |
| default: 280 | |
| selector: | |
| number: | |
| min: 153 | |
| max: 500 | |
| step: 1 | |
| day_brightness: | |
| name: Day Mode Brightness | |
| description: Brightness percentage for day mode | |
| default: 100 | |
| selector: | |
| number: | |
| min: 1 | |
| max: 100 | |
| step: 1 | |
| night_color_temp: | |
| name: Night Mode Color Temperature | |
| description: Color temperature for night mode (in mireds) | |
| default: 380 | |
| selector: | |
| number: | |
| min: 153 | |
| max: 500 | |
| step: 1 | |
| night_brightness: | |
| name: Night Mode Brightness | |
| description: Brightness percentage for night mode | |
| default: 30 | |
| selector: | |
| number: | |
| min: 1 | |
| max: 100 | |
| step: 1 | |
| extra_triggers: | |
| name: Extra triggers for light | |
| default: [] | |
| selector: | |
| trigger: | |
| extra_conditions: | |
| name: Extra conditions | |
| default: [] | |
| selector: | |
| condition: | |
| trigger: | |
| - platform: device | |
| device_id: !input switch_device | |
| domain: mqtt | |
| type: action | |
| subtype: !input switch_device_action | |
| - triggers: !input extra_triggers | |
| condition: !input extra_conditions | |
| action: | |
| - if: | |
| - condition: device | |
| device_id: !input switch_device | |
| entity_id: !input switch_device_entity | |
| domain: switch | |
| type: is_off | |
| then: | |
| - service: switch.turn_on | |
| target: | |
| entity_id: !input switch_device_entity | |
| else: | |
| - if: | |
| - condition: state | |
| entity_id: !input target_light | |
| state: "on" | |
| then: | |
| - service: light.turn_off | |
| target: | |
| entity_id: !input target_light | |
| else: | |
| - if: | |
| - condition: state | |
| entity_id: input_select.light_mode | |
| state: Night | |
| then: | |
| - service: light.turn_on | |
| target: | |
| entity_id: !input target_light | |
| data: | |
| color_temp: !input night_color_temp | |
| brightness_pct: !input night_brightness | |
| else: | |
| - service: light.turn_on | |
| target: | |
| entity_id: !input target_light | |
| data: | |
| color_temp: !input day_color_temp | |
| brightness_pct: !input day_brightness | |
| mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment