A blueprint for “Friends of Hue” switch, connected through the Hue integration. Need HA version 2023.08 or newer.
It supports all states of the switch for all 4 buttons
Initial Press
repeat
short release
long release
The blueprint is below. Create a .yaml file in your blueprints/automations directory and copy the below text. For HA to read the dictory, either restart or reload automations.
Tried to get the events from the two buttom press. I can not get any events specifically for this. If I press 1+3 (the 2 top once), then I get a event with subtype 1 and one with subtype 3. The same for the 2 button below. I have also tried the 1+4, and this do not give any events.
Can you try on you device? Listen for hue_event and look at the type and subtype.
If your device have more subtypes, then it will be easy to implement. Mine do not.
I just got a Senic + Gira Friends of Hue Switch and connected it to my philips hue bridge which is added to home assistant via the official integration.
When testing the events I stumbled upon the short press problem and so your post here.
There seems to be no event trigger for pressing both buttons (1+3 or 2+4 at the same time). Instead I get no event at all when in the home assistant when listening to hue_event and pressing them at the same time. One by one does work and gives me the subtypes 1-4.
eg:
Strange to me is that the Single Rocker feature (1+3 or 2+4) seems to be removed out of the philips hue integration.
At least it does not show me when setting up a automation
Altough it seems like this was the case (or maybe still is? Maybe im missing something?)
I found this video (7:27) where there have been the triggers “Both First and 3 Button released” as well as “Both First and 3 Button long released”.
But no Holding Button 1-4 Trigger
It seems like they have done a lot of changes in the philips hue integratin regarding the avaible events/triggers of Friend of Hue Buttons
Sorry for the screenshot as well as the video beeing german.
I hope you still get my point.
the blueprint is great. However I have 2 questions:
If I have already configured the switch in the Hue app, do I need to reset if first in the Hue app? Will the Hue config and this blueprint clash if both are configured?
I don’t quite get the difference between the 4 types of press
What is the difference between short release and initial press
What is repeat? Is that like double press?
Is long release the same as pressing and holding? Can I use this for continuous dimming?
At the end of the day I would like to press and hold and while I am holding the lights dimm up or down until I release the button. Which one do I need for that?
If you have automations in both the hue system and in HA, they will both fire. This blueprint have no knowledge about the hue app. I actually use the hue app for the actual light control, and then use HA automations for other stuff, like setting music on long press etc
Initial press is when you press the button
Short_release is when you release the button after a short time
Long_release is when you release after some time, I do not know the exact time, however something like 1 sec
Repeat, is a command send from the button repeated when you hold the button. Not sure about the period between, however several every second.
You can use the repeat to make the light dim a little every time it fires. Personally I do the dimming in the hue app, much easier.
Thank you for this blueprint!
I am using the FOH Switch from Niko (Niko dimschakelaar voor het Hue systeem Niko Intense matt black) connected through the Hue integration. I can see in my devices and it registers the different actions.
However, it does not show up in the blueprint under ‘Device’? Any hints on how to get this to work?
This part of the blueprint limits to devices called “PhilipsFoH”. I believed that all FoH switches would get this name. The only reason to include this in the blueprint is to limit the device list.
Find the right manufactor name of the switch, and change the blueprint on your local machine.
It might also work like this, however can not check now.
hue-4-button-switch:
name: Hue Frinds of 4-Button Switch
description: Hue Frinds of 4-Button Switch
selector:
device:
It is the right manufacterer, that’s why I thought it was odd. It seems that it does not pop up in the devices list if I ommit the ‘maufacturer’ from the selector. Strange.
This is strange. I have the same problem if I try to create a new blueprint, however my already existing once work.
Without the selector “manufactor” I get a list of all other devices, however non of my Friends of Hue switches. Like they do not registre correctly as devices. It was working in december. Normally I just change the existing automation.
I will have a look at this during the weekend, however not sure how to solve it for now.
Due to a change in how the Hue integration populates FoH devices, this have become a bit more compliacted to create a new automation, however it still works with all features and easy to change afterwards.
The device ID need to be obtained. There might exist other simple methods, im open for suggestion.
Go to “Developer Tools”, and to “Events”. In the “Listen to events” put in “Hue_event”.
Press a button on the FoH switch. Does not matter which on
In the developer tools page the events will be shown. Copy the device ID. It will look something like
Copy the device_id. In above example this part “7a6eb279e4b55328282e219a5d1c9144”, however the number will be unique for your switch. You need this part when creating the automation
The new Blueprint is below. Use this instead of the original.
blueprint:
name: Friends of Hue 4 Button All functions (Corrected Long Press)
description: Automate your Friends of Hue 4 Button switch using Hue integration with short and long press. Be aware input.helper need to be created before automation works with corect long press
domain: automation
input:
helper-remember-longrelease:
name: Input.helper to remember longrelease
description: A toggled helper, created through "settings - devices - helpers - create helpers". The helper can have whatever name
selector:
entity:
domain: input_boolean
# hue-4-button-switch:
# name: Hue Frinds of 4-Button Switch
# description: Hue Frinds of 4-Button Switch
# selector:
# device:
# manufacturer: PhilipsFoH
hue-4-button-switch:
name: Unique ID
description: "Unique ID, find in Hue-event"
default: ""
button_1_short_release:
name: Short Release 1
description: Action to run on button upper-left short release
default: []
selector:
action: {}
button_2_short_release:
name: Short Release 2
description: Action to run on button lower-left short release
default: []
selector:
action: {}
button_3_short_release:
name: Short Release 3
description: Action to run on button upper-right short release
default: []
selector:
action: {}
button_4_short_release:
name: Short Release 4
description: Action to run on button lower-right short release
default: []
selector:
action: {}
button_1_long_release:
name: Long Release 1
description: Action to run on button upper-left long release
default: []
selector:
action: {}
button_2_long_release:
name: Long Release 2
description: Action to run on button lower-left long release
default: []
selector:
action: {}
button_3_long_release:
name: Long Release 3
description: Action to run on button upper-right long release
default: []
selector:
action: {}
button_4_long_release:
name: Long Release 4
description: Action to run on button lower-right long release
default: []
selector:
action: {}
button_1_press:
name: Press 1
description: Action to run on button upper-left initial press
default: []
selector:
action: {}
button_2_press:
name: Press 2
description: Action to run on button lower-left initial press
default: []
selector:
action: {}
button_3_press:
name: Press 3
description: Action to run on button upper-right initial press
default: []
selector:
action: {}
button_4_press:
name: Press 4
description: Action to run on button lower-right initial press
default: []
selector:
action: {}
button_1_repeat:
name: Repeat 1
description: Action to run on button upper-left repeat
default: []
selector:
action: {}
button_2_repeat:
name: Repeat 2
description: Action to run on button lower-left repeat
default: []
selector:
action: {}
button_3_repeat:
name: Repeat 3
description: Action to run on button upper-right repeat
default: []
selector:
action: {}
button_4_repeat:
name: Repeat 4
description: Action to run on button lower-right repeat
default: []
selector:
action: {}
mode: queued
max: 10
trigger:
- platform: event
event_type: hue_event
event_data:
device_id: !input hue-4-button-switch
action:
- variables:
type: '{{ trigger.event.data.type }}'
subtype: '{{ trigger.event.data.subtype }}'
- choose:
- conditions: '{{ type == ''initial_press'' }}'
sequence:
- service: input_boolean.turn_on
target:
entity_id: !input 'helper-remember-longrelease'
- choose:
- conditions: '{{ subtype == 1 }}'
sequence: !input 'button_1_press'
- conditions: '{{ subtype == 2 }}'
sequence: !input 'button_2_press'
- conditions: '{{ subtype == 3 }}'
sequence: !input 'button_3_press'
- conditions: '{{ subtype == 4 }}'
sequence: !input 'button_4_press'
- conditions: '{{ type == ''short_release'' }}'
sequence:
- choose:
- conditions:
- condition: state
entity_id: !input 'helper-remember-longrelease'
state: "on"
sequence:
- choose:
- conditions: '{{ subtype == 1 }}'
sequence: !input 'button_1_short_release'
- conditions: '{{ subtype == 2 }}'
sequence: !input 'button_2_short_release'
- conditions: '{{ subtype == 3 }}'
sequence: !input 'button_3_short_release'
- conditions: '{{ subtype == 4 }}'
sequence: !input 'button_4_short_release'
- conditions: '{{ type == ''repeat'' }}'
sequence:
- service: input_boolean.turn_off
target:
entity_id: !input 'helper-remember-longrelease'
- choose:
- conditions: '{{ subtype == 1 }}'
sequence: !input 'button_1_repeat'
- conditions: '{{ subtype == 2 }}'
sequence: !input 'button_2_repeat'
- conditions: '{{ subtype == 3 }}'
sequence: !input 'button_3_repeat'
- conditions: '{{ subtype == 4 }}'
sequence: !input 'button_4_repeat'
- conditions: '{{ type == ''long_release'' }}'
sequence:
- choose:
- conditions: '{{ subtype == 1 }}'
sequence: !input 'button_1_long_release'
- conditions: '{{ subtype == 2 }}'
sequence: !input 'button_2_long_release'
- conditions: '{{ subtype == 3 }}'
sequence: !input 'button_3_long_release'
- conditions: '{{ subtype == 4 }}'
sequence: !input 'button_4_long_release'
@khvej8 Love this! Using multiple cheaper FoH toggles and this is a great addition to control my Shelly relays! Thanks!
Two questions:
Is there not real long press action available?
Added the Hass Sky Connect for Zigbee devices last week but it’s obvisouly not possible to pair a FoH toggle with Hass directly using ZHA and the Sky Connect. Any experience around?
In the first post the possibilities are mentioned, all covered by the blueprint. Unfortunately there is not an “even longer longrelease” or a “double click” which would also be nice.
I have not tried to connect my FoH switches to a native zigbee network. There are some post about this and they are supported using Zigbee2MQTT. Look in this link: EnOcean PTM 215Z control via MQTT | Zigbee2MQTT
Be aware the blueprint will not work, as it use Hue integration events, and not MQTT events.