Hi there,
I am using a ZG-101ZS switch combined with the blueprint ZHA - Tuya 4-Button Scene Switch
The switch panel is integrated in HA and it works fine with a single lamp, but I want to do more than that.
What I am trying to achieve:
There are 4 buttons on the switch (with single/double and long press modes). Huiskamer = Livingroom and Badkamer = Bathroom
- First button (single click = taking a shower and get dressed): turn on the “badkamer light (= a Sonoff ZBMINI-L2 Extreme)” + turn on the radio station (arrow classic rock) through my sonos “badkamer” and these actions has to stop after 45 minutes.
- Second button (single click = morning routine): Same actions as the first button, but it has to stop after 20 minutes.
- Third button (single click = only light): Turn on the light of the “badkamer”
- Third button (double click): Turn off the lights of the “badkamer”
- Fourth button (single click): Turn the lights (all HUE lights) in the “huiskamer” off
- Fourth button (double click): Turn the lights (all HUE lights) in the “huiskamer” on
The action of the fourth button is working, so this is great.
But when I am pressing the first, second or third button, the lights wil go on. But the Sonos isn’t playing any music and after 45 minutes the lights or the music (when choose this option manually) won’t go “off”.
Is there anybody who can help me with this issue? Thanks in advance.
I will paste my YAML code.
alias: Badkamer Switch
description: ""
use_blueprint:
path: amrutprabhu/ZHA_Tuya_4_Button_Scene_Switch.yaml
input:
tuya_4button_scene_switch: 1ef0a18230d6b172c4bde8831cb58d7c
button_one_short_press:
- type: turn_on
device_id: 8c9fb5d3c5c7bc06a17c2836b17a24ce
entity_id: 16784c3261799fad932a77abb8a6baf5
domain: switch
- action: media_player.play_media
target:
entity_id: media_player.sonos_badkamer
data:
media_content_id: FV:2/10
media_content_type: favorite_item_id
metadata:
title: Arrow Classic Rock
thumbnail: https://cdn-profiles.tunein.com/s6702/images/logoq.jpg?t=152752
media_class: genre
children_media_class: null
navigateIds:
- {}
- media_content_type: favorites
media_content_id: ""
- media_content_type: favorites_folder
media_content_id: object.item.audioItem.audioBroadcast
- delay:
hours: 0
minutes: 45
seconds: 0
milliseconds: 0
button_one_double_press: []
button_two_short_press:
- type: turn_on
device_id: 8c9fb5d3c5c7bc06a17c2836b17a24ce
entity_id: 16784c3261799fad932a77abb8a6baf5
domain: switch
- action: media_player.play_media
target:
entity_id: media_player.sonos_badkamer
data:
media_content_id: FV:2/10
media_content_type: favorite_item_id
metadata:
title: Arrow Classic Rock
thumbnail: https://cdn-profiles.tunein.com/s6702/images/logoq.jpg?t=152752
media_class: genre
children_media_class: null
navigateIds:
- {}
- media_content_type: favorites
media_content_id: ""
- media_content_type: favorites_folder
media_content_id: object.item.audioItem.audioBroadcast
- delay:
hours: 0
minutes: 20
seconds: 0
milliseconds: 0
button_three_short_press:
- type: turn_on
device_id: 8c9fb5d3c5c7bc06a17c2836b17a24ce
entity_id: 16784c3261799fad932a77abb8a6baf5
domain: switch
button_three_double_press:
- type: turn_off
device_id: 8c9fb5d3c5c7bc06a17c2836b17a24ce
entity_id: 16784c3261799fad932a77abb8a6baf5
domain: switch
button_four_short_press:
- action: light.turn_off
metadata: {}
data: {}
target:
device_id: c8e79ce8bee26badaaea0845f31719af
button_four_double_press:
- action: light.turn_on
metadata: {}
data:
kelvin: 3185
target:
device_id: c8e79ce8bee26badaaea0845f31719af