Cannot create switch key assignments due to bug in PWA

Running version 2.12.06

There is a bug in switch-wizard-editor-rules.js which prevents switch key assignments to be made. When creating any key assignments through any of the create* methods, the code looks for a sensor in app.sensors using the uniqueid field for lookup. There is no uniqueid field though, so let sensor will always be undefined and the code for creating the assignment fails. The correct lookup field is called id.

The following fixes it for the time being:

cd /usr/share/deCONZ/webapp/pwa/js
cp switch-wizard-editor-rules.js switch-wizard-editor-rules.js.bak
sed -i 's/uniqueid/id/g' switch-wizard-editor-rules.js

Cheers, Uli

Any news on this? Hast this been fixed in more recent versions? Would be nice to have a confirmation before updating…


Hi, I havent followed that issue and don’t know what the problem was in version 2.12.6 but in the current version 2.13.4 the correct uniqueid field is used when creating a rule and the sensors in app.sensors deliver that field correctly.

Edit: both id or uniqueid can be used in rules. The real question is why the sensor object did not delivered a uniqueid in your case.