@laursen perhaps you can give me your thoughts on this? As described above, when migrating from API v1 to v2 the binding will attempt to create new API v2 things with data that mirror any respective matching legacy things. In API v1 there is a distinction between ‘light’ things and ‘sensor’ things. Whereas in API v2 we have ‘device’ things that cover everything. I don’t know enough about the reality of API v1 thing ids, but it is theoretically possible for both hue:bridge:[sensor]:7
and hue:bridge:[light]:7
legacy things to exist. ?? … in which case the migration mirroring would try to create the v2 thing hue:bridge-api2:device:7
two times in the Inbox. Which would obviously not work. => Perhaps this is the issue that @somy has encountered? => WDYT?
Yes, I believe both a sensor and a light with the same id can exist.
Yes I believe that’s the case. I didn’t try to remove it from V1 before migrating to V2, but for other devices I’m able to have both V1 and V2 running in parallel. I cannot test this further as I have now removed and reset the dimmer switch, afterwards everything works without issue
Next will migrate Hue Lab Colorloop to Prism. The only issue I have is Hue Dimmer Switch doesn’t allow me to program long click event, only Hue Lab allows to define long press for effects. Is it possible to program long press event with OpenHAB?
Yes it does. See the doc for button-last-event trigger channels here.
Thanks - missed that part when I scan the document. With Prism I can now convert everything to V2.
I still miss the sunset, but that can be programmed easily (I did for sunrise).
Hi all,
Need some advice on what is the best approach to send effect to a group of lights if I want the transition is in sync?
I have some outdoor spot lights and in HomeKit I can group them as one light, but looks like I can’t do it in Hue app. I’d like to trigger colorloop on them, but send effect command one by one make them out of sync. Is there a way to create a group in Hue and send command to the group via OpenHAB? Appreciate any suggestion, thanks!
Edit: I have tried group by room, but there is no effect channel for rooms.
No.
Effects are state attributes of individual lights. There is no way to synchronize Effects across lights. By contrast Scenes are state attributes across Rooms or Zones and they are (therefore) synchronized across all lights therein.
If you want to synchronize a Color Loop across multiple lights, then in OH you would have to do that ‘manually’ in a rule.
Thanks for your reply! Will try program in a rule - I just hope that they could add the option to control the transition speed, it’s quite easy to be out of sync with the current speed lol
Try something like this…
var hue = 0
val sat = 100
val bri = 100
rule "Color Loop 36 steps at 10 second duration i.e. full cycle 6 minutes"
when
Time cron "0/10 * * ? * * *"
then
// set 10 second dynamic transition
myLight1_Dynamics_Channel_Item.sendCommand(10);
myLight2_Dynamics_Channel_Item.sendCommand(10);
myLight3_Dynamics_Channel_Item.sendCommand(10);
// set next color
val nextColor = new HSBType(new DecimalType(hue), new PercentType(sat), new PercentType(bri)).toString();
myLight1_Color_Channel_Item.sendCommand(nextColor);
myLight2_Color_Channel_Item.sendCommand(nextColor);
myLight3_Color_Channel_Item.sendCommand(nextColor);
// step the loop
hue = hue + 10;
if (hue >= 360) {
hue = 0;
}
end
Wow, amazing!!
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.
@laursen thanks for sharing. The photo of the pcb shows physically 4 buttons. So can you suggest how the pcb would physically generate the other two ‘virtual’ button events in v1? I would hypothesise that the virtual button event was generated when both the 0 and 1 button would be pressed at the same time. If that is the case you could also test for two buttons down in an API v2 rule. Or??
Right, I forgot this important “detail”: You are totally right, there are only four physical buttons. Your hypothesis is correct, when upper button left+right are clicked at the same time, this is considered to be this virtual “middle button”. This interpretation is done by the PCB and sent as a separate event, so in API v2 there will be no observable changes for either buttons.
Hmm. It would be interesting to try having a v1 Bridge thing with just this one switch in it, in ‘parallel’ to your v2 system, and see if the virtual buttons are still reported by that. If so then it might be worth reporting to Hue signify that their v2 firmware has this bug.
I heard this year first from the API v2 due to a new motion sensor which was not discovered. I tried to switch all Things to the new API. But with the groups now Zones I have a big problem: There is no “color” channel. Do I have to recreate the Zone in the Hue App or do you use API v1 also?
That us correct. Rooms and zones only have on/off a dimmer channels. Exactly like in the Hue app. To set color you either do it for each specific lamp, or via a scene.
Hi All
Just wondering is the latest changes to the Hue App indicate that scenes etc can now be applied directly to a single light?
Thanks
Mark
No. Scenes are applicable to Rooms or Zones, whereas Effects are applicable to Lights (Devices).
(If you want to apply a scene to just one light then you need to put that light in a zone of its own).