Philips Hue API2: set Scene via hue:actions and DSL

Hello.
What is correct syntax for setting a scene for a room with hue actions.

val hueActionsRoom = getActions("hue","hue:room:xxxxxxxxxxxxxxxx:yyyyyyyy-zzzz-vvvv-wwww-123456789012")
hueActionsRoom.dynamicCommand("scene", new StringType("71f96029-4b9f-4946-bcba-313392e521a1"), Long.valueOf(20000))

The Thing and all Items works fine.
The ID for the scene comes from the console:

openhab> hue:bridge-api2:xxxxxxxxxxxxxxxx scenes

Does anyone have an example of how to set this correctly?
Thanks in advance.

Edit:
Sorry. I forgot the Warning:

2024-01-04 22:20:35.906 [WARN ] [e.internal.handler.Clip2ThingHandler] - Command '71f96029-4b9f-4946-bcba-313392e521a1' is not supported on channel 'hue:room:xxxxxxxxxxxxxxxx:yyyyyyyy-zzzz-vvvv-wwww-123456789012:scene'.

And it doesn’t matter whether I use the ID or friendly name of the Scene

And as a further supplement:

hueActionsRoomAZ.dynamicCommand("brightness", new PercentType (100), Long.valueOf (60000))

works perfectly

Scene is a channel (advanced) of a room or zone. To activate the scene you just command the channel item value. There is no rule action for activating scenes.

Hello Andrew.
Thanks for your respond.
Yes: It is possible to set a scene directly with this channel, but I would like to change the scenes slowly, just like dimming with brightness via actions.

There is the channel ‘action’
https://www.openhab.org/addons/bindings/hue/doc/readme_v2.html#channels-for-rooms-and-zones

and below a sample with the scene:
https://www.openhab.org/addons/bindings/hue/doc/readme_v2.html#rule-actions

Am I getting this wrong?

I don’t know. Can you try in MainUI to set the dynamics Channel to say 20000 and then very quickly set the scene Channel to some new value?

I would like to have this as well - are you sure this is possible (e.g. with HUE App)?
It would be nice if e.g. lambs switch on slowly or switch off slowly - but I never found this possibilty in the the HUE App.

The dynamics your are talking about is to my understanding how fast effects (within a running scene) are changing - not the speed of changing from one scene to another.

But maybe I am wrong…?

No. This option is not available in the app either.
I have given up my plan.
But the documentation is not really clear here.
Why or for what do I need action on scenes?

The dynamics apply in four ways…

  1. When applied to an effects channel command => the speed of the effects
  2. When applied to a dimming / color / colorTemperature channel command => the speed of the transition
  3. I think it also applies to an onOff channel command => the switch command is delayed
  4. When applied to a scene command => the speed of the transition

EDIT: I just checked the Hue API description which says the following … so either the API description is wrong, or something is fishy in the binding…

image

Aha. I see your error…

The StringType value should not be a resource name. It should be the name of the scene as it appears in MainUI or in the App.

1 Like

Now it works.
I thought I had tried this before.
Thank you very, very much.
That’s what I love about OH: Even if it’s such a small thing, somehow you get it done, usually with the help of the community.

2 Likes

this is fantastic - your question Christian and the answer from Andrew made it possibile for me to enable this feature for my lambs as well :slight_smile:

Now lambs are swtiching on slowly and switching off slowly - I was searching for that feature since a while :smiley:
Thanks @cidi and @AndrewFG :ok_hand:

1 Like