deCONZ - Official thread

Yes, this is an unwanted side effect from me normalising the bridged in the integration. I didn’t realise that the deconz groups unique ids where based on the bridgeid

2 Likes

I now manually created light groups, but the slider entity row doesn’t support group entity’s, unfortunately. Not sure what to do now…

Have the same issue after the upgrade to 104 - all deconz entities, groups etc. became unavailable, but was able to manage everything from Deconz UI. Played a bit with the config, tried restoring Deconz addon from the backup - didn’t help.

Then opened Integrations tab and found that Deconz integration is discovered but not enabled, enabling this restored all settings immediately.

1 Like

@Robban but is there anything those can do who havent upgraded yet or us this simply a given issue in current system/setup.

The only thing would be to shut down hass update the groups unique ids (a simple search and replace) and then upgrade hass

To those that already have the problem here is the step by step to get you back in shape.

It is a an improved version of a posting I did earlier in 0.104: Sentry, Signal Messenger, IntesisHome, Sure Petcare, KEF

To fix the deconz specific issue do this in this exact order.

Go to the Integrations page and open the Deconz Integration. You now see all your deconz devices listed. You can easily see the duplicate light groups as two lights with same name. First will be the old and 2nd is the new.

Walk through each duplicated group and click on the first device to open the device setting screen
This should list the entities and there should be only 1 for a deconz group
Verify that it has an entity associated with it not ending with _2
Click on the small gearwheel to edit the entiry
Delete this entity (delete link in lower left corner of the popup window). This is only enabled if the device is not available.
Back in the device view click on the gearwheel at the upper right corner of the screen to edit the device name.
Give this old group Device (not entity - device!!) to a name that we can later find. I called mine the old group name appended by crap (that was my mood in the situation). Use a string that is unique
Go back to the list of devices and open the other new duplicate group device
Rename the associated entity to same name but remove the _2

Note that you have to delete the old entity first before you can rename the new _2 because you cannot rename to an existing name.

Do this with all the duplicate groups.

In principle all works now. But you still have some old “cruft” devices in the core.device_registry that you cannot delete from any user interface. I am sure that will haunt you again in future and can cause more duplication to occur. The only way to delete deconz devices is to hack the JSON file

So next steps are…

Stop Home Assistant to avoid hacking live data.

Go to .storage and save a backup of core.device_registry

Now open the core.device_registry in a text editor and search for that name you appended to the old devices (crap in my case).

Now carefully delete the entire JSON object that contains this crap device. Be careful with the commas. Especially if it is the last member you delete. There can be no trailing comma in the list. That is why we saved a backup in case we goof up. Hacking JSON is horrible but it is the only way because Home Assistant still has no user interface for deleting devices.

To the deconz integration developer. I will love you forever if you add a delete link similar to the one presented for entities when you open the gearwheel link for the deconz devices. And it would be best if it is not enabled until you have deleted all the associated entities. The users need this when you remove a device from your deconz. E.g. when a bulb goes broken and you replace it.

1 Like

Yep, same thing happened to me after a reboot after upgrading to 104. Had to re-enable the integration before anything in deCONZ was available to control in HA and now they all have a “_2” in the entity names that I have to fix.

1 Like

Could you be more precise, do you mean in core.device_registry, then after that upgrading hass wouldn’t have any side effect for light groups or do we’ll still need to do lots of cleaning ?
Otherwise any chance it could be fixed in a 0.104.x release ?

1 Like

If you go through these steps you shouldn’t be needed to clean stuff up afterwards

  1. Shut down home assistant
  2. Go to home-assistant/.storage
  3. Open core.entity_registry and core.device_registry
  4. Look for unique ids looking something like 12345EFFFF67890-/group/0
  5. Remove the four F so you get something like 12345E67890-/group/0
  6. Update home assistant and start it up again
5 Likes

Thanks ! I’ll try it today and post my feed back.

I’ve successfully applyed your step by step guide, it took me about 2~3 minutes and I do not see any duplicate light groups in HA or DeConz UI.

Many thanks !

1 Like

Thanks for the instructions!

Just to be sure - in the core.device_registry there is this one line with those 4 F-letters without any “group ending”. I suppose these F-letters needs to be removed also?

image

No don’t, only entries ending with /goup/N need to be updated

OK - Thanks!
Even if the “id” is identical with the rest ending with “groups” …

image

Something that annoys me with phoscon is that there is no button to add a new sensor in mobile mode. Why!?

Is this only required if you have auto-generated groups in phoscon, or all groups?

And apologies for the remedial questions but I assume you shutdown home assistant using Configuration -> Server Control -> STOP (under Server Management), and you would still have access to the .storage files using Samba?

How then do you update home assistant before finally restarting? Running standard HASSIO

David. I have noticed that it is only the groups in Phoscon that actually have lights below them that gets imported into Home Assistant. I have many auto generated groups in Phoscon that get created when you add remote controls. I guess the idea is that you can then easily add lights to the new remote. I never used this feature. Instead if manually created groups and added lights to them and I do all control from Home Assistant. The only reason I create Deconz groups is to enable smooth increase and decrease like I have descibed here

So I had one group for every room in my house - total of 7 or 8 that I had to fix.

With Robban’s work around you can now…

If you did not already upgrade to 0.104 - then simply follow Robban’s JSON file hack. It is much less steps and less risk of messing up

If you did the upgrade and have a recent snapshot - then roll back to the snapshot - do the file hack with Home Assistant stopped - then restart Home Assistant and do a normal upgrade

If you do not have a recent backup and you upgraded then you have to do all my steps. Or remove the deconz integration completely and start over again. That may be much harder because you probably did some renaming and tweaks you have forgotten about.

I think there is but it may only work in “horizontal” mode … ?

Wow. Never have i had the thought to move the mobile to horizontal to check if it works. That’s much better. But still weird it doesn’t work in portrait.

There is a new bug someone raised and it is worse than you may think.

When home assistant triggers a deconz.device_refresh ALL my automations that have a deconz device as trigger are triggered.

My alarm system starts. My TV and amplifier turns on. My toilet flushes (yes I have automated my toilet with an IKEA button) and light turns on and off and end up in some random state depending on which automation ran first. This is really bad. Especially if this device refresh gets triggered duing startup or any other time. I can see in my log that 650 automation start and stop events were triggered. The whole house becomes a madhouse when I run the command

EDIT: I have added more info to the bug report. What happens is that the device_refresh triggers false events for every sensor you have and that triggers all the automations that have these events as triggers. See bug report.

2 Likes