mjwwit / node-red-contrib-ikea-tradfri

Node-RED nodes to get updates from and control devices connected to an IKEA TRADFRI gateway
3 stars 3 forks source link

Using a Trader Group gives error message #11

Closed ahartman closed 1 year ago

ahartman commented 3 years ago

I just starting using your NodeRed plugin after having said good-bye to HomeAssistant due to instability. Wonderful that you can address light groups as that saves a lot of nodes. In my case, the groups that your nodes show are the Rooms in the IKEA app and that is exactly what I need. However using one of your nodes with a group selected and no individual lights gives following error message: Invalid message received, using node config! Invalid value "" supplied to : TradfriStateInputMessage/0: Partial<{ topic: (Int | Array) }>/topic: (Int | Array)/0: Int Invalid value "" supplied to : TradfriStateInputMessage/0: Partial<{ topic: (Int | Array) }>/topic: (Int | Array)/1: Array

Funny thing is, the state node gives this error message but then provides correct state. The switch and lights control nodes give the error but do not switch on or off.

Another thing: the returned status for a lightbulb says it is powered by "InternalBattery", see attached screen image. That is, of course not true.

Regards, ahartman, belgium

Schermafbeelding 2021-06-30 om 08 56 58

Further testing: I seem to get the error message each time, below is the result of switching off one single light: Invalid message received, using node config! Invalid value 1625039840617 supplied to : TradfriLightControlMessage/0: Partial<{ topic: (Int | Array), payload: TradfriLightControlAction }>/payload: TradfriLightControlAction

Further testing: The JSON below does not work, the topics are valid Tradfri lightbulbs. { "topic": [ 65538, 65543 ], "payload": { "onOff": false } }

mjwwit commented 3 years ago

The first issue appears to be caused by an invalid value for the topic property in your message. This property expects to receive one or more instanceIDs or groupIDs. An empty string ("") does not satisfy this constraint.

The second issue seems very similar, but is focused on the payload property. It expects to receive an object describing the action you want to perform, but instead it's receiving a number.

The interesting thing is your example message looks perfectly fine. That message should turn off lightbulbs 65538 and 65543. Are you sure that's the entire message your sending, and not a nested property of the message?

ahartman commented 3 years ago

Dear mjwwit,

The message is the whole object. In fact, I also get the message when I do not send a JSON but use a light selected in your status node. I get the error message and then a correct output for the selected light! I suspect the testing conditions for the error message may not be correct; I just basically get it every time.

I use version 0.4.7.

============= If I ask a group status, I get a list of only deviceIDs; it would be much better if that gave me list of complete device objects, saving me a lot of work. If I ask a group status, isOn seems always to be false. in my opinion, if all devices in a group are on, the group isOn status should be true.

============= The Monitor node says 'event updated' but it doesn't tell the change; A similar node for Hole Assistant give 'old state' and 'new state' for updates to that you can work out what was updated.

Regards, ahartman, belgium

mjwwit commented 3 years ago

The message is the whole object. In fact, I also get the message when I do not send a JSON but use a light selected in your status node. I get the error message and then a correct output for the selected light! I suspect the testing conditions for the error message may not be correct; I just basically get it every time.

Interesting... If I use your exact message payload (but replace the IDs with my own bulb IDs) it works perfectly fine... There must be something else going on. What does your node configuration look like?

If I ask a group status, I get a list of only deviceIDs; it would be much better if that gave me list of complete device objects, saving me a lot of work.

This would indeed be nice to have. When I find the time I may just attempt to implement this.

If I ask a group status, isOn seems always to be false. in my opinion, if all devices in a group are on, the group isOn status should be true.

If the status of a group reports isOn to be false, then sadly this is what the Gateway reports it to be. Nothing more I can do sadly.

The Monitor node says 'event updated' but it doesn't tell the change; A similar node for Hole Assistant give 'old state' and 'new state' for updates to that you can work out what was updated.

This would also be nice to have, but this will require quite a bit of work. The gateway doesn't say exactly what has been changed.

mjwwit commented 1 year ago

I don't have the time to support a project that I'm no longer using. I am therefore closing this issue.