deconz-community / node-red-contrib-deconz

Node-Red Nodes for deCONZ connectivity.
GNU General Public License v3.0
84 stars 16 forks source link

Error trying to apply a light scene #190

Closed thecode closed 2 years ago

thecode commented 2 years ago

Current Behavior

Trying to call a light group scene from node-red raise the following error:

26 Dec 23:44:38 - [error] [deconz-output:Parents Room Fan Lights Night Mode] Error while processing command #1, TypeError: Cannot read properties of undefined (reading 'mode')
TypeError: Cannot read properties of undefined (reading 'mode')
    at CommandParser.getRequests (/config/node-red/node_modules/node-red-contrib-deconz/src/runtime/CommandParser.js:238:44)
    at /config/node-red/node_modules/node-red-contrib-deconz/nodes/out.js:182:4

The scene call fails and does not change the scene, added a flow json bellow Pictures to show the setup: image image image

Expected Behavior

Call group scene should work :-)

Steps To Reproduce

Create a group scene and call the scene

Example flow

Sample flow with timestamp node and deconz output node

[{"id":"a88f01d97540c6e3","type":"deconz-output","z":"9cfb01d0.1ec66","name":"Parents Room Fan Lights Night Mode","config_version":2,"server":"c37efbbc.780be8","statustext":"","statustext_type":"default","search_type":"device","device_list":["groups/device_id/1"],"device_name":"","query":"{}","commands":[{"arg":{"group":{"type":"num","value":"1"},"scene":{"type":"num","value":"1"},"retryonerror":{"type":"num","value":"0"},"aftererror":{"type":"continue","value":""}},"type":"deconz_state","domain":"scene_call","uniqueId":"ui-id-14"}],"specific":{"delay":{"type":"num","value":"50"},"result":{"type":"at_end","value":""}},"x":730,"y":1740,"wires":[[]]},{"id":"772908b603987adc","type":"inject","z":"9cfb01d0.1ec66","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":480,"y":1740,"wires":[["a88f01d97540c6e3"]]},{"id":"c37efbbc.780be8","type":"deconz-server","name":"Phoscon-GW","ip":"core-deconz","port":"40850","ws_port":"8081","secure":false,"polling":""}]

Environment

Zehir commented 2 years ago

The UI on your screenshoot should have a new field between the type and the picker. Did you refresh your browser ?

thecode commented 2 years ago

Thanks for the fast reply, I did refresh the browser before, using Chrome "Empty Cache and hard reload" solve the issue. Adding the picture with the new field if others encounter this issue also: image

Zehir commented 2 years ago

The auto migration feature should have handle this case. Did you save this node with the wrong UI ?

Zehir commented 2 years ago

I also found a side issue when importing your flow but it's a really edge case when you try to load the scene picker when your configuration is invalid.

thecode commented 2 years ago

I added this node after updating the plugin to 2.2.0, restarted node-red and reloaded the page (just closed and opened again did not try to force refresh it) The comment in the 2.2.0 change log reminded me that I wanted to use Deconz scenes for a long time so I decided to check it

Zehir commented 2 years ago

I added this node after updating the plugin to 2.2.0, restarted node-red and reloaded the page (just closed and opened again did not try to force refresh it) The comment in the 2.2.0 change log reminded me that I wanted to use Deconz scenes for a long time so I decided to check it

ok that why this throw errors ;)

Zehir commented 2 years ago

Ok now the user won't be able to reproduce this beavior. It's fixed in 2.2.1