deCONZ - Official thread

@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

Sorry to hear how 0.104.1 has caused you deconz grief but when everything is ultimately resolved, please take a moment to create a new topic explaining how you implemented ‘remote-control flushing’. I don’t think I’ll do it but I am curious to know what you used to achieve it.

Good luck with the deconz issue.

1 Like

My single lights are working as it should, but all the groups are unavailable…

Edit: thank @KennethLavrsen, that worked

I am working for several weeks with my RaspBee unable to find any switches with the search and I am getting now a slight suspicion that the RaspBee is not found by my Rpi.

I am using Hassos on a RPI4.

These are my devices:

serial:

* /dev/ttyAMA0
* /dev/ttyS0
input:
disk:
* /dev/mmcblk0p7
* /dev/mmcblk0p2
* /dev/mmcblk0p5
* /dev/mmcblk0p6
* /dev/mmcblk0
* /dev/mmcblk0p3
* /dev/mmcblk0p4
* /dev/mmcblk0p1
* /dev/mmcblk0p8
gpio:
* gpiochip504
* gpiochip0
* gpiochip100
audio:
* 0:
  * name: bcm2835_alsa - bcm2835 ALSA
  * type: ALSA
  * devices:
    * [object Object]
    * [object Object]
    * [object Object]

That is my clean and simple config

{
  "device": "/dev/ttyAMA0",
  "vnc_password": ""
}

This is what I am getting in the log,…

17:17:20:282 GW firmware version: 0x00c80000
17:17:23:244 try to reconnect to network try=2
17:17:28:245 try to reconnect to network try=3
17:17:30:276 dev /dev/ttyAMA0
17:17:30:276 GW firmware version: 0x00c80000
17:17:33:244 try to reconnect to network try=4
17:17:38:245 try to reconnect to network try=5
17:17:40:271 dev /dev/ttyAMA0

And this is my lovely Phoscon UI