Two Error messages explained and suggested action, and one question
I tried to understand the two annoying deCONZ messages that I see in the Domoticz log.
Error: deCONZ: Websocket error, unknown device > 65520 (groups)Error: deCONZ: This device doesn't support action
These two occurred where I have a Zigbee motion sensor which triggers a Domoticz event script that then switches another Zigbee light switch on for 2 minutes. I think I know what happened and I made some changes to plugin.py to "fix them".
Issue 1 The current code writes a Websocket error, and continues; if this item is a group, it tries to look it up by its key which returns the name "All".
I suggest to check for ID == '65520' and to silently return if true.
Notes:
- About the specific number 65520, see: https://www.tabsoverspaces.com/233613-where-does-the-65521-static-or-65520-instance-number-of-methods-in-a-class-come-from . I think that the gateway uses this number as some kind of default.
- When I request all groups using
curl, I only get the two groups, with IDs 1 and 7. (The gap between 1 and 7 is because I cleaned up some older groups. I probably don;t even need groups for my purpose).
Issue 2
It seems that onCommand() is called for sensors and the code writes this message if _type == 'sensors'. Maybe onCommand should not be called at all, and it may be better to just ignore this without writing the message.
Below are the changes that I made locally to plugin.py:
$ diff plugin.ori plugin.py
301c301
< Domoticz.Error("This device doesn't support action")
---
> # Domoticz.Error("This device doesn't support action")
969c969
< Domoticz.Debug("### WebSocket Data : " + str(_Data) )
---
> Domoticz.Debug("### WebSocketConnexion Data : " + str(_Data) ) #FJ: make consistent with onMessage called
1012c1012,1014
< Domoticz.Error("Websocket error, unknown device > " + str(_Data['id']) + ' (' + str(_Data['r']) + ')')
---
> # Domoticz.Error("Websocket error, unknown device > " + str(_Data['id']) + ' (' + str(_Data['r']) + ')')
> if (_Data['id'] == '65520' ):
> return # FJ: This ID is an internal ID from the gateway
$
The question
Finally, when running my tests I found the lamp's brightness decreasing every time it was switched OFF.
The lamp type is
IKEA of Sweden TRADFRI bulb E27 WS opal 1000lm Color temperature light 2.0.022
Every time when the light was switched off, the level (_json['bri'] ) decreased until it settled on steady state: 40
I don't see why it would end on 40, but why is the OFF command decrementing the level?
the log below shows that I set the brightness of the lamp using the Domoticz UI which also turns the lamp ON.
Then, using the Web UI, I keep switching OFF and ON and you see the level decrease until it reaches 40.
This simulates the same calls as what I think happens when the sensor activates my script, which simply calls light.switchOn().checkFirst().forSec(120) .
2025-08-23 15:40:06.209 deCONZ: onCommand called for Unit 9: Parameter 'Set Color', Level: 48, Hue: {"b":0,"cw":123,"g":0,"m":2,"r":0,"t":132,"ww":132}
2025-08-23 15:40:07.488 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 47, Hue:
2025-08-23 15:40:19.435 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 47, Hue:
2025-08-23 15:40:28.596 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 46, Hue:
2025-08-23 15:40:32.750 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 46, Hue:
2025-08-23 15:40:36.925 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 45, Hue:
2025-08-23 15:40:40.781 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 45, Hue:
2025-08-23 15:40:44.557 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 44, Hue:
2025-08-23 15:40:48.214 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 44, Hue:
2025-08-23 15:40:51.874 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 43, Hue:
2025-08-23 15:40:57.390 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 43, Hue:
2025-08-23 15:41:03.220 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 42, Hue:
2025-08-23 15:41:17.992 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 42, Hue:
2025-08-23 15:41:23.862 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 41, Hue:
2025-08-23 15:41:30.639 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 41, Hue:
2025-08-23 15:41:35.454 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 40, Hue:
2025-08-23 15:41:41.277 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 40, Hue:
2025-08-23 15:41:45.850 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 40, Hue:
2025-08-23 15:41:52.025 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 40, Hue:
2025-08-23 15:41:57.128 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 40, Hue:
2025-08-23 15:43:02.508 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 40, Hue:
2025-08-23 15:43:11.691 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 40, Hue:
2025-08-23 15:47:45.631 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 40, Hue:
2025-08-23 15:47:52.348 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 40, Hue:
Yet another light is turned ON via a Domoticz group setting, and instead of the Set Level command the Set Color command with level = nn is used where the value of Level is taken from the "State" field of the group and since this is set every time the lamp is switched 'on' decreasing brightness does not occur there.
Thanks, --frans.
Hello, but the first error message happen only one time ? It's something normal, it just say deconz found a new "thing", and after that the code ask for information to deconz and add it to the plugin database, and remember it, up the next restart, it's something normal, it can happen too if you include new device, the time for the plugin to detect them. If I m right, it's the deconz hidden group for "All Devices" This group is hidden so the plugin can't guess it at start, it just wait for the first request with it in the API.
A “All” group is generated by the REST API by default and add all light in it. This group is avaliable at “/api//groups/0” but his ID is not always “0”; In that case the group is also avaliable at “/api//groups/65520”.
The onCommand is from domoticz, so more chance the problem come from it. You have the same result when you just clic on the widget (to turn it off) ?
Error: deCONZ: This device doesn't support action
This one happen if you make an action (send order) to a deconz device that make only return, like a battery powered switch. This must not happen, or if you clic on the widget by error (or use it in automation)
Hi, you are correct that the first message is shown only once. And then the group is added, but not persisted, which means that when the plugin (or Domoticz) is restarted the error will be written again. I did not notice this, because when I was making changes, I restarted the plugin, so every test was a "first time". I also found that a group with ID 0 and 65520 exist if you request them by their ID, but they do not show when you request just all groups with "/api/groups/". Still, I don't see the value of these "internal" groups. Perhaps just removing the error message or change it to just informational is a better idea and the current behavior remains). I am not a fan of displaying error messages when the only thing a user can do is to ignore them.
Regarding the second message, Error: deCONZ: This device doesn't support action, the plugin already knows that this command is for a sensor, so why write the error? The plugin cannot do anything with it anyway, so writing the message only spoils the error log.
I will do some more research on why the Level keeps decreasing. If I find something there I will open up a new issue
I am not a fan of displaying error messages when the only thing a user can do is to ignore them
Lol, you have problem with error message ? Here you know what is it, you don't ignore it now ^^.
There are here just to warm you, don't worry the plugin is able to work even there is error, most of them are not blocking (lot of try/catch) Only blocking errors are problematics because something is realy broken, and you can have bad reaction on domoticz, for others all will be invisible, lot of errors can be solved by the plugin itself after a time.
And I don't use different level, because users can miss them, it's realy error log so > log level, but not status log.
All users have this error message and you are the first one who have problem with it :)
Hidding error is not a good thing for me. if one day deconz change the ID for the "all device" group (this already happen), or use another one for the ID 65520 ? if the user clic on a battery swith or use it as wired switch in automation, I think it will be happy to have the error message saying it make somethng wrong nope ? In a normal use this message never happen.
About the error, you can add the group the the banned device (the banned.txt file) ? If I remember it works for groups too. And I m sure like 99% of people you don't use this group.
Don't worry, it is a choice you made and there are good reasons to do it your way. After having worked fr many years in business critical environments I learned not to ignore messages flagged as Errors. Sometimes, they could have a lower priority (like using Domoticz.Log) and have a bit more more information.
deCONZ: Device 5 doesn't support action: Off instead of an error "This device doesn't support action"
Remember my question regarding decreasing values of the Level and val? I traced that down. I think there is an error in fonctions.py.
In ReturnUpdateValue(command, val, option = None)
When calculating the Level from the 'bri' of the light:
Line #514
if command == 'bri':
#kwarg['nValue'] = 1
#val = int(float(val) * 100 / 255 ) # FJ: incorrect, this results in decreasing values
val = round(int(val)*100 / 254 ) # FJ: this matches the calculation of bri from Level
This made the calculation first, and turned the result into an int
However, since, 'val' was a converted to a string, you must first cast it to an int, and round the result, the same way 'bri' was calculated in onCommand() for Command == Set Level and Command == 'ON
_json['bri'] = round(Level*254/100)
I thought the decrease was caused by the OFF command, however, it was actually happening during the Set Level command, executed as part of switching the light to ON, by either the UI or the trigger from the motion sensor. After I applied the change the level does no longer decrease.
Thanks for your comments.
Ha yes, there is something bad here. I m remember, I m using at maximum 254, because it's possible to have issue with 255. From API documentation it say the value is from 0 to 255 but in deconz code, it use at maximum 254.
if (ok && bri <= 0xFF)
{
valueOk = true;
hasBri = true;
targetBri = bri > 0xFE ? 0xFE : bri;
}
I m asking to others devs what is the real maximum value, give me some time to be sure.
After I applied the change the level does no longer decrease.
Wich one change ? if you use a set level command alone (without scripting) it's a one shoot command, it don't send repetive request decreasing.
But yes the good command will be surely
val = round(int(val)*100 / 254 )
deCONZ: Device 5 doesn't support action: Off instead of an error "This device doesn't support action"
Right, I will add more information
Wich one change ? if you use a set level command alone (without scripting) it's a one shoot command, it don't send repetive request decreasing.
It is not really a one-shoot command. Because the light gets switched off and back on again. The value of Bri get changed because it is used to calculate the Level, and the value of level is used (in fonctions.py) to re-calculate the Bri value for deCONZ. So after couple of iterations you may notice it.
IMO it does not really matter if you choose 255 or 254, as long as you use the same value in both formulas.
In fact because you round the values, even with the maximum brightness (255), the level becomes: round(100.3937) = 100%
No that I want to say it's you send the request 'Set level 50", the plugin make the request with 124,125 or 126 the device change the level and return a value 124,125 or 126 and it's all.
Even the value is not the same, nothing more happen
2025-08-23 15:40:48.214 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 44, Hue:
2025-08-23 15:40:51.874 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 43, Hue:
2025-08-23 15:40:57.390 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 43, Hue:
2025-08-23 15:41:03.220 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 42, Hue:
2025-08-23 15:41:17.992 deCONZ: onCommand called for Unit 9: Parameter 'Set Level', Level: 42, Hue:
2025-08-23 15:41:23.862 deCONZ: onCommand called for Unit 9: Parameter 'Off', Level: 41, Hue:
Here you have something making a new request every time. And the value is decreased because of the convertion issue you have found.
On my side, if I m make many requests on/off (manually using the Domoticz Gui), I have the same value
2025-08-28 19:10:57.633 Status: User: admin (IP: 192.168.1.149) initiated a switch command (36/Deconz - Dimmer salon/On)
2025-08-28 19:10:57.658 Deconz: onCommand called for Unit 8: Parameter 'Set Level', Level: 20, Hue:
2025-08-28 19:10:58.426 Status: User: admin (IP: 192.168.1.149) initiated a switch command (36/Deconz - Dimmer salon/Off)
2025-08-28 19:10:58.446 Deconz: onCommand called for Unit 8: Parameter 'Off', Level: 20, Hue:
2025-08-28 19:11:22.724 Status: User: admin (IP: 192.168.1.149) initiated a switch command (36/Deconz - Dimmer salon/On)
2025-08-28 19:11:22.764 Deconz: onCommand called for Unit 8: Parameter 'Set Level', Level: 20, Hue:
2025-08-28 19:11:23.919 Status: User: admin (IP: 192.168.1.149) initiated a switch command (36/Deconz - Dimmer salon/Off)
2025-08-28 19:11:23.968 Deconz: onCommand called for Unit 8: Parameter 'Off', Level: 20, Hue:
2025-08-28 19:11:24.789 Status: User: admin (IP: 192.168.1.149) initiated a switch command (36/Deconz - Dimmer salon/On)
2025-08-28 19:11:24.823 Deconz: onCommand called for Unit 8: Parameter 'Set Level', Level: 20, Hue:
2025-08-28 19:11:25.651 Status: User: admin (IP: 192.168.1.149) initiated a switch command (36/Deconz - Dimmer salon/Off)
2025-08-28 19:11:25.700 Deconz: onCommand called for Unit 8: Parameter 'Off', Level: 20, Hue:
I think you are more sensible than me at this bug because you are using a script that read the level value ? Instead of using a fixed value.
Because the light gets switched off and back on again
This is not normal.
So I have updated the "beta" branch with your 2 changes
- val = round(int(val)*100 / 254 )
- deCONZ: The Domoticz Unit X doesn't support action (sensors)"
Have used the Domoticz unit number, because the problem is from domoticz, easier to find the Unit, no need to check the deconz api
Have used the Domoticz unit number, because the problem is from domoticz, easier to find the Unit, no need to check the deconz api
It took me a while to figure out how to get from the Unit number to the name of the device.
Using the following code, you get a nice combination that provides all info you want from Devices[Unit]
Domoticz.Error(f"Device Unit {Unit}: {Devices[Unit].Name} ({Devices[Unit].ID}) doesn't support command: {Command}")
Which includes the unit number , the Domoticz Name and ID), and the function.
2025-08-29 15:53:17.061 Error: deCONZ: Device Unit 5: deCONZ -Sensor1 (112) doesn't support command: Off
ok, updated, except the action, because it don't support action at all, no need to be precise.