Closed DaelDe closed 2 years ago
Hi @DaelDe,
Which of the change nodes did you use? Some of them having properties for ambient white or colored lamps. If you Inject the request to a light endpoint that has not the properties for this, you will get an error. You need to change / Remove these values in the Code for your setup.
you are the first one having a problem with the nodes, I just checked the first Node (light on / orange / 1s Transition) and it worked fine. And to show you a Screenshot of the Payload that comes out of the change Node. You Need to debug for Full Data object.
debugging the html request Node (Full data object) , what error Code do you get? This would be helpful to correctly determine the error.
to Turn an Light on / off, just the datapoint on.on is needed, True or False. Please edit a changenode just to do this.
in the Code you posted, i can not tell why you got a „rid“ there instead of ID. Rids are for groups.
-please Check every Node again for typos.
Greetings Andreas
@DaelDe And the Flow does not need any response, you are talking directly with the Bridge. Please try to trigger a scene as well and have a look if you get any errors. scenes are the easiest.
Thanks for your reply.
I used the "light on / orange / 1s Transition" change node.
Everything with respect to the hue API is working correctly I think, the light is changing. However, the issue comes from the API response. The link in node "BRIDGE DATA RESPONSE IN" collects the result and sends it to change node Light Name, ID, Abilities
.
But this node expects a response from a "GET" call to the API. But controlling is done with "PUT" and therefore the response is different. In the screenshot you see the node and its input.
@DaelDe i think you mixed something up.
On the picture (red square) is the debug message from the https request node (yellowish) I can tell cause it shows the status code. 200 means everything fine.
The function node is only for the request of the IDs/Rids. They have a label in the flow that nothing need to be changed.
The error message itself comes out of the node that determines the data for the lights endpoint from the bridge. (I made a red arrow to the message)
I can’t tell if you made some node connections that shouldn’t be there. The helper flow works on its own and completely fine when deploying the flow example.
Your upper arrow is pointing towards yadomi‘s hue-events-node when I see that right. this outputs the eventstream when the configuration is correct. I can’t see any payload coming from there on your screenshot.
You can disable the debug node from the light endpoint at the helper flow, and your error message will disappear.
Greetings Andreas
I did not change anything (just changed positions of nodes, wiring is untouched) on the flow but I understand it quite good so I can make my adaptions.
you said:
The function node is only for the request of the IDs/Rids. They have a label in the flow that nothing need to be changed.
However, it is directly wired to the API output, so it reacts on any API call and not only request of IDs/RIDs.
I will decouple ID/RID detection from other API calls and it should be fine. I just wonder why it does not happen on your side.
@DaelDe yes you are right with the output, I have just my phone on my hands and didn’t saw it correctly.
Yeah, you could do that, disable the link in node.
But I am still curious if you have a light setup with a special character in the name? When you requested all data in the ID helper flow, did all the arrays showed up and did you got all your data?
I can’t actually explain why this problem happens to you. You could try to import a copy of the whole flow and setup it another time.
But if your action api calls return a 200 everything is working as expected and you can ignore the message or decouple it.
Thank you for your support.
I will migrate my setup from huemagic to direct API calls. Maybe I can contribute something useful when I am finished let's see.
@DaelDe Thanks!
Describe the bug I did all steps of the install instructions. Then I added a single light id to one of the nodes in step 7 and deployed. When I now inject the timestamp to that node, the light properly changes but I get an error in the log:
TypeError: Cannot read properties of undefined (reading 'name')
. It originates from function nodeLight Name, ID, Abilities
.I did some further debugging. Input to the function node is (msg.payload):
According to Clip API v2 documentation, this is a valid response for
PUT /resource/light/{id}
.The function node itself does expect a metadata property on the data objects. This property is not available. My Bridge is Up-To-Date. It seems your flow expects a different response. What could be wrong?
To Reproduce Steps to reproduce the behavior:
Expected behavior No TypeError, instead info log that the light changed.
Desktop (please complete the following information):