Can't call hue_activate_scene service

Hi,

I’m trying to call hue scenes using NodeRed. So far strange things seem to happen and I don’t know why.

I’m injecting this simple string into the call service node with an inject node: {group_name: “kantoor”, scene_name: “groen”}

The call service node seems to put every character in that string in another instance of the object (see screenshot below).

I’m also getting this error: “Call-service API error. Error Message: extra keys not allowed @ data[‘0’]”.

I think the error can be explained because of the character splitting, but I don’t know how to fix this. Does anyone have experience with this?

Thanks in advance!

Roy

Can you post the code?

After two days I finally managed to get it working. I think it has something to do with the servicecall change from json to yaml in a recent update. I had to change the code format to this:

{
    "group_name": "{{group}}",
    "scene_name": "{{scene}}"
}

I used the change-node to set msg.group to the right group name. The same goes for msg.scene to the right scene name. It works like a charm now.

I guess you managed to get it working? If not, then I’m happy to help!

1 Like

Yes, eventually got it working! :smiley:

Can you post a pic of the node setup?

This is a simple version of my setup:

The msg.group should get the name of your lightgroup as configured in your Hue app (don’t confuse this with a zone!).

The msg.scene should get the name of your scene as configured in your Hue app.

Then I’m calling this service:

In my actual flow, I’m using a input_select to change between different scenes. In fact, choosing between the different scenes is mostly automated too. For example, when I turn on the TV, it switches to the TV scene (lower brightness).

2 Likes

Cool, thanks :slight_smile:

1 Like

I am trying to follow this but I am getting an API error. Any thoughts would be appreciated.

image

{
    "group_name": "{{Flood Lights}}",
    "scene_name": "{{Flood}}"
}

This sounds like your call service node doesn’t have the right configuration. The json looks good.

Did you change the server back to your server? Node Red also imports a server of someone else when you import a flow. So you might be using the wrong server.

Did you activate Group Support in the HUE Integration?
image

No, I did not even know that setting existed. I will try that, thanks! Do I also want the unreachable setting?

It’s my server, I set up the service node from the Node Red GUI, not an import. I only hand copied your syntax.

I like to enable both, as some of my lights are not always 100% reachable and then are not controllable via HA is not enabled. With both enabled, it basically just mirrors the experience i have with the HUE App.

Ok I turned on “Allow Hue Groups” I am still getting this error.

I have two hue bridges connected, is that possibly causing an issue?

Can you check in Home Assistant/Developer Tools/Services if you’ve got the hue.hue_activate_scene service available?

Not there…

So we’re getting closer. The problem isn’t in Node Red.

I guess that this missing service is part of the HUE integration for Home Assistant. Do you have that integration running?

Yes, I have the integration running and I am able to access senors and lights.

When I google it, I see some other people who’ve had the same problem. I’m not sure how to fix this, but there might be a topic containing your answer.