Skip to content

Instantly share code, notes, and snippets.

@aschamberger
Created December 26, 2023 19:21
Show Gist options
  • Save aschamberger/009aee9825149f4146bb73818a252596 to your computer and use it in GitHub Desktop.
Save aschamberger/009aee9825149f4146bb73818a252596 to your computer and use it in GitHub Desktop.
blueprint:
name: Müller Licht tint Remote
description: Control lights with a Müller Licht Tint RGBW Remote
domain: automation
input:
remote:
name: Remote
description: Muller Licht Tint remote to use
selector:
device:
integration: zha
manufacturer: MLI
model: ZBT-Remote-ALL-RGBW
target_light:
name: Light(s)
description: The light(s) to control
selector:
target:
entity:
domain: light
working_scene:
name: Working Scene
description: The scene to be triggered when the Working Light button is pressed
default:
selector:
entity:
domain: scene
sunset_scene:
name: Sunset Scene
description: The scene to be triggered when the Sunset button is pressed
default:
selector:
entity:
domain: scene
party_scene:
name: Party Scene
description: The scene to be triggered when the Party button is pressed
default:
selector:
entity:
domain: scene
night_scene:
name: Night Scene
description: The scene to be triggered when the Night button is pressed
default:
selector:
entity:
domain: scene
campfire_scene:
name: Campfire Scene
description: The scene to be triggered when the Campfire button is pressed
default:
selector:
entity:
domain: scene
romantic_scene:
name: Romantic Scene
description: The scene to be triggered when the Romantic button is pressed
default:
selector:
entity:
domain: scene
power_on_defaults:
name: Power on with defaults
description: Power on with default brightness and color temp, when the "on" button
on the remote is pushed and lights turn on.
default: false
selector:
boolean: {}
default_brightness:
name: Default brightness
description: Brightness for light on.
selector:
number:
min: 1
max: 100
step: 1
unit_of_measurement: "%"
mode: slider
default: 75
default_color_temp:
name: Default color temp
description: Color temperature for light on.
selector:
number:
min: 2000
max: 7500
step: 1
unit_of_measurement: "K"
mode: box
default: 3000
step_value:
name: Brightness increment/decrement percent
description: Set the step percent value for brightness and color warmth
default: 10
selector:
number:
min: 1.0
max: 20.0
mode: slider
step: 1.0
unit_of_measurement: '%'
source_url: https://gist.github.com/aschamberger/009aee9825149f4146bb73818a252596
mode: restart
max_exceeded: silent
variables:
power_on_defaults: !input 'power_on_defaults'
step_value: !input 'step_value'
working_scene: !input 'working_scene'
sunset_scene: !input 'sunset_scene'
party_scene: !input 'party_scene'
night_scene: !input 'night_scene'
campfire_scene: !input 'campfire_scene'
romantic_scene: !input 'romantic_scene'
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
event: '{{ trigger.event.data.cluster_id }}'
value: '{{ trigger.event.data.args.value }}'
- choose:
- conditions:
- '{{ event == 6 }}'
sequence:
- choose:
- conditions: '{{ power_on_defaults }}'
sequence:
- service: light.toggle
target: !input 'target_light'
data:
color_temp_kelvin: !input 'default_color_temp'
brightness_pct: !input 'default_brightness'
default:
- service: light.toggle
target: !input 'target_light'
- conditions:
- '{{ event == 8 }}'
- '{{ trigger.event.data.params.step_mode==0 }}'
sequence:
- service: light.turn_on
target: !input 'target_light'
data:
brightness_step_pct: '{{ step_value }}'
transition: 1
- conditions:
- '{{ event == 8 }}'
- '{{ trigger.event.data.params.step_mode==1 }}'
sequence:
- service: light.turn_on
target: !input 'target_light'
data:
brightness_step_pct: -{{ step_value }}
transition: 1
- conditions:
- '{{ trigger.event.data.command == ''move_to_color_temp'' }}'
sequence:
- service: light.turn_on
target: !input 'target_light'
data:
color_temp: '{{ trigger.event.data.args[0] }}'
- conditions:
- '{{ trigger.event.data.command == ''move_to_color'' }}'
sequence:
- service: light.turn_on
target: !input 'target_light'
data:
xy_color: '[{{ trigger.event.data.args[0]|float/45875 }}, {{trigger.event.data.args[1]|float/45875 }}]'
- conditions:
- '{{ working_scene }}'
- '{{ event == 5 }}'
- '{{ value == 3 }}'
sequence:
- service: homeassistant.turn_on
entity_id: !input 'working_scene'
- conditions:
- '{{ sunset_scene }}'
- '{{ event == 5 }}'
- '{{ value == 1 }}'
sequence:
- service: homeassistant.turn_on
entity_id: !input 'sunset_scene'
- conditions:
- '{{ party_scene }}'
- '{{ event == 5 }}'
- '{{ value == 2 }}'
sequence:
- service: homeassistant.turn_on
entity_id: !input 'party_scene'
- conditions:
- '{{ night_scene }}'
- '{{ event == 5 }}'
- '{{ value == 6 }}'
sequence:
- service: homeassistant.turn_on
entity_id: !input 'night_scene'
- conditions:
- '{{ campfire_scene }}'
- '{{ event == 5 }}'
- '{{ value == 4 }}'
sequence:
- service: homeassistant.turn_on
entity_id: !input 'campfire_scene'
- conditions:
- '{{ romantic_scene }}'
- '{{ event == 5 }}'
- '{{ value == 5 }}'
sequence:
- service: homeassistant.turn_on
entity_id: !input 'romantic_scene'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment