I am posting my modified version here. Group-button is working, scenes per group are working. I had to modify it to work with mqtt-input, my remote-entity provided by zb2mqtt did not contain the payloads needed to make use of the state machine. Thus I am using mqtt instead.
alias: Tint-Remote total
description: ""
triggers:
- trigger: mqtt
topic: zigbee2mqtt/Tint-Remote
alias: Sobald MQTT-Topic von gewünschter Tint-Remote empfangen wurde
conditions:
- alias: Aber nur, wenn Trigger einen der angegbenen Werte enthält
condition: template
value_template: >-
{{ trigger.payload_json.action in ('off', 'on', 'color_move',
'color_temperature_move', 'brightness_step_down', 'brightness_step_up',
'brightness_down_hold', 'brightness_down_release', 'brightness_up_hold',
'brightness_up_release', 'scene_3', 'scene_1', 'scene_2', 'scene_6',
'scene_4', 'scene_5') }}
enabled: true
actions:
- variables:
group_id_0: 16387
group_id_1: 16388
group_id_2: 16389
group_id_3: 16390
stepsize: trigger.payload_json.action_step_size |int
light_id_0: light.deckenleuchte_kinderzimmer
light_id_1: null
light_id_2: 07b5e005cdd9adabf8602df39e061a24
light_id_3: light.deckenlampe_annabell
input_working_scene_0: []
input_sunset_scene_0: []
input_party_scene_0: []
input_night_scene_0: []
input_campfire_scene_0: []
input_romantic_scene_0: []
input_working_scene_1: []
input_sunset_scene_1: []
input_party_scene_1: []
input_night_scene_1: []
input_campfire_scene_1: []
input_romantic_scene_1: []
working_scene_2: scene.stehlampe_reading_scene
sunset_scene_2: scene.stehlampe_sunset_scene
party_scene_2: scene.stehlampe_party_scene
night_scene_2: scene.stehlampe_night_scene
campfire_scene_2: scene.stehlampe_fire_scene
romantic_scene_2: scene.stehlampe_romantic_scene
working_scene_3: scene.deckenlampe_annabell_reading_scene
sunset_scene_3: scene.deckenlampe_annabell_sunset_scene
party_scene_3: scene.deckenlampe_annabell_party_scene
night_scene_3: scene.deckenlampe_annabell_night_scene
campfire_scene_3: scene.deckenlampe_annabell_fire_scene
romantic_scene_3: scene.deckenlampe_annabell_romantic_scene
enabled: true
alias: Variablen definieren, die benötigt werden
- data:
level: info
message: >-
Tint Button pressed: {{ trigger.payload_json.action }} Group: {{
trigger.payload_json.action_group }} Length {{ input_working_scene_1 |
length }}
action: system_log.write
enabled: false
- choose:
- conditions:
- alias: Testen, ob Gruppen-ID gleich 'group_id_0'
condition: template
value_template: "{{ trigger.payload_json.action_group == group_id_0 }}"
enabled: true
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"on\", \"off\" ) }}"
alias: Testen, ob Trigger-Action gleich 'on' oder 'off'
sequence:
- data: {}
target:
entity_id: "{{ light_id_0 }}"
action: light.turn_{{ trigger.payload_json.action }}
alias: ON / OFF
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"color_move\" ) }}"
alias: Testen, ob Trigger-Action gleich 'color_move'
sequence:
- data:
xy_color:
- "{{ trigger.payload_json.action_color.x | float }}"
- "{{ trigger.payload_json.action_color.y | float }}"
target:
entity_id: "{{ light_id_0 }}"
action: light.turn_on
alias: COLOR_MOVE
- conditions:
- condition: template
value_template: >-
{{ trigger.payload_json.action in (
"color_temperature_move" ) }}
alias: Testen, ob Trigger-Action gleich 'color_temperatur_move'
sequence:
- data:
color_temp: >-
{{ trigger.payload_json.action_color_temperature | float
}}
target:
entity_id: "{{ light_id_0 }}"
action: light.turn_on
alias: COLOR_TEMPERATURE_MOVE
- conditions:
- alias: >-
Testen, ob Trigger-Action gleich 'brightness_step_down'
oder 'brightness_step_up'
condition: template
value_template: >-
{{ trigger.payload_json.action in (
"brightness_step_down", "brightness_step_up") }}
sequence:
- variables:
factor: >-
{% if trigger.payload_json.action in (
"brightness_step_down") %} -12 {% else %} 12 {% endif %}
- data_template:
brightness_step_pct: "{{ factor | int }}"
target:
entity_id: "{{ light_id_0 }}"
action: light.turn_on
alias: BRIGHTNESS_STEP_DOWN / BRIGHTNESS_STEP_UP
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_1\" ) }}"
alias: Testen, ob Trigger-Action gleich 'scene_1'
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ sunset_scene_0 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ sunset_scene_0 }}"
default: []
alias: SCENE_1
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_2'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_2\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ party_scene_0 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ party_scene_0 }}"
default: []
alias: SCENE_2
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_3'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_3\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ working_scene_0 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ working_scene_0 }}"
default: []
alias: SCENE_3
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_4'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_4\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ campfire_scene_0 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ campfire_scene_0 }}"
default: []
alias: SCENE_4
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_5'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_5\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ romantic_scene_0 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ romantic_scene_0 }}"
default: []
alias: SCENE_5
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_6\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ night_scene_0 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ night_scene_0 }}"
default: []
alias: SCENE_6
default: []
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action_group == group_id_2 }}"
enabled: true
alias: Testen, ob Gruppen-ID gleich 'group_id_2'
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"on\", \"off\" ) }}"
alias: Testen, ob Trigger-Action gleich 'on' oder 'off'
sequence:
- data: {}
target:
device_id: "{{ light_id_2 }}"
action: light.turn_{{ trigger.payload_json.action }}
alias: ON / OFF
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"color_move\" ) }}"
alias: Testen, ob Trigger-Action gleich 'color_move'
sequence:
- data:
xy_color:
- "{{ trigger.payload_json.action_color.x | float }}"
- "{{ trigger.payload_json.action_color.y | float }}"
target:
device_id: "{{ light_id_2 }}"
action: light.turn_on
alias: COLOR_MOVE
- conditions:
- condition: template
value_template: >-
{{ trigger.payload_json.action in (
"color_temperature_move" ) }}
alias: Testen, ob Trigger-Action gleich 'color_temperatur_move'
sequence:
- data:
color_temp: >-
{{ trigger.payload_json.action_color_temperature | float
}}
target:
device_id: "{{ light_id_2 }}"
action: light.turn_on
alias: COLOR_TEMPERATURE_MOVE
- conditions:
- alias: >-
Testen, ob Trigger-Action gleich 'brightness_step_down'
oder 'brightness_step_up'
condition: template
value_template: >-
{{ trigger.payload_json.action in (
"brightness_step_down", "brightness_step_up") }}
sequence:
- variables:
factor: >-
{% if trigger.payload_json.action in (
"brightness_step_down") %} -12 {% else %} 12 {% endif %}
- data_template:
brightness_step_pct: "{{ factor | int }}"
target:
device_id: "{{ light_id_2 }}"
action: light.turn_on
alias: BRIGHTNESS_STEP_DOWN / BRIGHTNESS_STEP_UP
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_1\" ) }}"
alias: Testen, ob Trigger-Action gleich 'scene_1'
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ sunset_scene_2 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ sunset_scene_2 }}"
default: []
alias: SCENE_1
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_2'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_2\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ party_scene_2 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ party_scene_2 }}"
default: []
alias: SCENE_2
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_3'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_3\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ working_scene_2 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ working_scene_2 }}"
default: []
alias: SCENE_3
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_4'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_4\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ campfire_scene_2 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ campfire_scene_2 }}"
default: []
alias: SCENE_4
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_5'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_5\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ romantic_scene_2 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ romantic_scene_2 }}"
default: []
alias: SCENE_5
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_6\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ night_scene_2 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ night_scene_2 }}"
default: []
alias: SCENE_6
default: []
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action_group == group_id_3 }}"
enabled: true
alias: Testen, ob Gruppen-ID gleich 'group_id_3'
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"on\", \"off\" ) }}"
alias: Testen, ob Trigger-Action gleich 'on' oder 'off'
sequence:
- data: {}
target:
entity_id: "{{ light_id_3 }}"
action: light.turn_{{ trigger.payload_json.action }}
alias: ON / OFF
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"color_move\" ) }}"
alias: Testen, ob Trigger-Action gleich 'color_move'
sequence:
- data:
xy_color:
- "{{ trigger.payload_json.action_color.x | float }}"
- "{{ trigger.payload_json.action_color.y | float }}"
target:
entity_id: "{{ light_id_3 }}"
action: light.turn_on
alias: COLOR_MOVE
- conditions:
- condition: template
value_template: >-
{{ trigger.payload_json.action in (
"color_temperature_move" ) }}
alias: Testen, ob Trigger-Action gleich 'color_temperatur_move'
sequence:
- data:
color_temp: >-
{{ trigger.payload_json.action_color_temperature | float
}}
target:
entity_id: "{{ light_id_3 }}"
action: light.turn_on
alias: COLOR_TEMPERATURE_MOVE
- conditions:
- alias: >-
Testen, ob Trigger-Action gleich 'brightness_step_down'
oder 'brightness_step_up'
condition: template
value_template: >-
{{ trigger.payload_json.action in (
"brightness_step_down", "brightness_step_up") }}
sequence:
- variables:
factor: >-
{% if trigger.payload_json.action in (
"brightness_step_down") %} -12 {% else %} 12 {% endif %}
- data_template:
brightness_step_pct: "{{ factor | int }}"
target:
entity_id: "{{ light_id_3 }}"
action: light.turn_on
alias: BRIGHTNESS_STEP_DOWN / BRIGHTNESS_STEP_UP
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_1\" ) }}"
alias: Testen, ob Trigger-Action gleich 'scene_1'
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ sunset_scene_3 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ sunset_scene_3 }}"
default: []
alias: SCENE_1
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_2'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_2\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ party_scene_3 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ party_scene_3 }}"
default: []
alias: SCENE_2
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_3'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_3\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ working_scene_3 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ working_scene_3 }}"
default: []
alias: SCENE_3
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_4'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_4\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ campfire_scene_3 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ campfire_scene_3 }}"
default: []
alias: SCENE_4
- conditions:
- alias: Testen, ob Trigger-Action gleich 'scene_5'
condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_5\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ romantic_scene_3 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ romantic_scene_3 }}"
default: []
alias: SCENE_5
- conditions:
- condition: template
value_template: "{{ trigger.payload_json.action in ( \"scene_6\" ) }}"
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ night_scene_3 | length > 0 }}"
sequence:
- action: scene.turn_on
metadata: {}
target:
entity_id: "{{ night_scene_3 }}"
default: []
alias: SCENE_6
default: []
default: []
enabled: true
mode: queued
max: 5
max_exceeded: silent