I now also noticed something in my setup that I realize was broken since I upgraded to Hue API v2. I’m posting it here, not on GitHub, because I it seems from the API there’s absolutely nothing to do, so it’s just knowledge sharing.
I have a few Friends of Hue switches named ZGP2801K4-FOH-E ST:
For the curious, they are fit into 3D-prints and look more like this on the wall:
Anyway. Until Hue API v2 I could use two “hidden” buttons, for example top middle one (between |
and O
on this example), e.g:
rule "Family room 1.1 middle button"
when
Channel 'hue:0830:home:foh1:tap_switch_event' triggered 101.0
then
if (LeKlintSnowdrop_Brightness.state > 0)
{
LeKlintSnowdrop_Brightness.sendCommand(OFF)
}
else
{
LeKlintSnowdrop_Brightness.sendCommand(ON)
}
end
The other hidden button had event id 104.0.
In API v1, GET /sensors/194
:
{
"state": {
"buttonevent": 101,
"lastupdated": "2024-05-07T20:34:38"
},
"swupdate": {
"state": "notupdatable",
"lastinstall": null
},
"config": {
"on": true
},
"name": "Friends of Hue Switch Alrum 1",
"type": "ZGPSwitch",
"modelid": "FOHSWITCH",
"manufacturername": "PhilipsFoH",
"productname": "Friends of Hue Switch",
"diversityid": "xxx",
"uniqueid": "xxx",
"capabilities": {
"certified": true,
"primary": true,
"inputs": [
{
"repeatintervals": [],
"events": [
{
"buttonevent": 16,
"eventtype": "initial_press"
},
{
"buttonevent": 20,
"eventtype": "short_release"
}
]
},
{
"repeatintervals": [],
"events": [
{
"buttonevent": 17,
"eventtype": "initial_press"
},
{
"buttonevent": 21,
"eventtype": "short_release"
}
]
},
{
"repeatintervals": [],
"events": [
{
"buttonevent": 19,
"eventtype": "initial_press"
},
{
"buttonevent": 23,
"eventtype": "short_release"
}
]
},
{
"repeatintervals": [],
"events": [
{
"buttonevent": 18,
"eventtype": "initial_press"
},
{
"buttonevent": 22,
"eventtype": "short_release"
}
]
}
]
}
}
In API v2, GET https://hue.local/clip/v2/resource/device/00000000-0000-0000-0000-000000000000
:
{
"errors": [],
"data": [
{
"id": "00000000-0000-0000-0000-000000000000",
"id_v1": "/sensors/194",
"product_data": {
"model_id": "FOHSWITCH",
"manufacturer_name": "PhilipsFoH",
"product_name": "Friends of Hue Switch",
"product_archetype": "unknown_archetype",
"certified": true,
"software_version": "0.0.0"
},
"metadata": {
"name": "Friends of Hue Switch Alrum 1",
"archetype": "unknown_archetype"
},
"services": [
{
"rid": "00000000-0000-0000-0000-000000000001",
"rtype": "button"
},
{
"rid": "00000000-0000-0000-0000-000000000002",
"rtype": "button"
},
{
"rid": "00000000-0000-0000-0000-000000000003",
"rtype": "button"
},
{
"rid": "00000000-0000-0000-0000-000000000004",
"rtype": "button"
},
{
"rid": "00000000-0000-0000-0000-000000000005",
"rtype": "zgp_connectivity"
}
],
"type": "device"
}
]
}
No event visible directly here, and since further information can only be obtained from the four button resources listed here, no luck. Example:
{
"errors": [],
"data": [
{
"id": "00000000-0000-0000-0000-000000000001",
"id_v1": "/sensors/194",
"owner": {
"rid": "00000000-0000-0000-0000-000000000000",
"rtype": "device"
},
"metadata": {
"control_id": 1
},
"button": {
"last_event": "short_release",
"button_report": {
"updated": "2024-05-05T20:10:33.033Z",
"event": "short_release"
},
"repeat_interval": 0,
"event_values": [
"initial_press",
"short_release"
]
},
"type": "button"
}
]
}
This “secret” functionality once available got lost with the new API.
For those buttons I use only for other purposes than lighting I already some time ago repaired them with ConBee II where I can get events for all six buttons. However, I had noticed for some time that the “secret” buttons didn’t really work anymore, but only yesterday while migrating some more DSL rules to JavaScript, I found this old rule broken and left since upgrading to API v2.