As i didnt find any Blueprint for this device, I tried to create my own.
With a lot of help from KI
blueprint:
name: Bosch Universal Switch II - BHI-US
description: >
Work in Progress
domain: automation
input:
mqtt_device:
name: Zigbee2MQTT Name
description: Devicename Zigbee2MQTT
selector:
device:
filter:
- integration: mqtt
manufacturer: Bosch
base_topic:
name: Zigbee2MQTT Base mqtt topic
description: Default zigbee2mqtt
default: zigbee2mqtt
button_top_left_selection:
name: Top left Button
collapsed: true
input:
button_top_left_short:
name: Top left short press
default: []
selector:
action: {}
led_top_left_short_color:
name: Top left short press - color
default: "Off"
selector:
select:
options:
- "Off"
- "Red"
- "Green"
- "Blue"
- "White"
led_top_left_short_mode:
name: Top left short press - mode
default: "Solid"
selector:
select:
options:
- "Solid"
- "Flash"
- "Pulse"
button_top_left_long:
name: Top left long press
default: []
selector:
action: {}
led_top_left_long_color:
name: Top left long press - color
default: "Off"
selector:
select:
options:
- "Off"
- "Red"
- "Green"
- "Blue"
- "White"
led_top_left_long_mode:
name: Top left long press - mode
default: "Solid"
selector:
select:
options:
- "Solid"
- "Flash"
- "Pulse"
trigger_variables:
base_topic: !input base_topic
mqtt_device: !input mqtt_device
trigger:
- platform: mqtt
domain: mqtt
device_id: !input mqtt_device
type: action
subtype: button_top_left_shortpress
discovery_id: "{{ base_topic }}/action"
id: top_left_short
- platform: device
domain: mqtt
device_id: !input mqtt_device
type: action
subtype: button_top_left_longpress
discovery_id: "{{ base_topic }}/action"
id: top_left_long
action:
- choose:
- conditions: "{{ trigger.id == 'top_left_short' }}"
sequence:
- !input button_top_left_short
- variables:
led_color: !input led_top_left_short_color
led_mode: !input led_top_left_short_mode
led_payload: >-
{% set color_map = {
'Red': ('ff','00','00'),
'Green': ('00','ff','00'),
'Blue': ('00','00','ff'),
'White': ('ff','ff','ff'),
'Off': ('00','00','00') } %}
{% set r,g,b = color_map.get(led_color, ('00','00','00')) %}
{% set mode_code = {'Solid':'01','Flash':'02','Pulse':'03'}.get(led_mode, '00') %}
{ r }{ g }{ b }000{ mode_code }{ r }{ g }{ b }0{ mode_code }
- if: "{{ led_color != 'Off' }}"
then:
- action: mqtt.publish
data:
topic: "{{ base_topic }}/set"
payload: >-
{{
"config_led_top_left_press": "{{ led_payload }}"
}}
- delay: "00:00:05"
- action: mqtt.publish
data:
topic: "{{ base_topic }}/set"
payload: >-
{{
"config_led_top_left_press": "000000000000000000"
}}
- conditions: "{{ trigger.id == 'top_left_long' }}"
sequence:
- !input button_top_left_long
- variables:
led_color: !input led_top_left_long_color
led_mode: !input led_top_left_long_mode
led_payload: >-
{% set color_map = {
'Red': ('ff','00','00'),
'Green': ('00','ff','00'),
'Blue': ('00','00','ff'),
'White': ('ff','ff','ff'),
'Off': ('00','00','00') } %}
{% set r,g,b = color_map.get(led_color, ('00','00','00')) %}
{% set mode_code = {'Solid':'01','Flash':'02','Pulse':'03'}.get(led_mode, '00') %}
{ r }{ g }{ b }000{ mode_code }{ r }{ g }{ b }0{ mode_code }
- if: "{{ led_color != 'Off' }}"
then:
- action: mqtt.publish
data:
topic: "{{ base_topic }}/set"
payload: >-
{{
"config_led_top_left_longpress": "{{ led_payload }}"
}}
- delay: "00:00:05"
- action: mqtt.publish
data:
topic: "{{ base_topic }}/set"
payload: >-
{{
"config_led_top_left_longpress": "000000000000000000"
}}
mode: single
at the moment i am stuck at 2 errors.
Thanks