dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.88k stars 485 forks source link

groups/0 (all devices) not working #3744

Open popy2k14 opened 3 years ago

popy2k14 commented 3 years ago

Describe the bug

Yesterday i have updated to 2.05.88 from 02.05.84 and now my groups/0 doesnt work at all. I cant set it with phoscon "all off switch" or over rest api. There is a 404 error with HUEEssentials.

Steps to reproduce the behavior

Switch the group 0 as stated above.

Expected behavior

All lights should be controlable with group 0.

Screenshots

Environment

02.05.84 (downgraded again) 26660700

deCONZ Logs

Additional context

When ill do a get on group "0" manuall with the browser the answer is:

GET: http://192.168.0.9:8080/api/XXXXXXXXXX/groups/0 Answer: [{"error":{"address":"/groups/0","description":"resource, /groups/0, not available","type":3}}]

With other groups all is working.

ANy hints how i can get my group/0 working again?

MattWestb commented 3 years ago

Great that you have finding the bug for the "API" grope 0 !! The 0x0000 can making problem as some device is more strict following the standard. (one PM reserved = shall not being used, but its not meaning that devices shall not workig if being used.) IKEA is using the group 0xff09 as default grope for sending scene commands from the remote if not being configured (with touchlink) but it can being OK to using the reserved one for lightlink applications. The problem is if some other manufacturer is using reserved gropes for "internal things" that braking things in the system.

Good work done !!!

popy2k14 commented 3 years ago

@KodeCR that looks really promissing. Sadly i don't be able to build deconz myself.

Is it possible on your side to provide an raspbian package to test? I am here to test :-))

popy2k14 commented 3 years ago

@KodeCR is it possible for you to provide an test build for respbian?

KodeCR commented 3 years ago

Ok, I think I have a better understanding of the issue now. The Fyrtur is both a "light" and a "sensor" in deCONZ, when the light part is added, it is added to group 0xfff0, but since it the same device the sensor is also in that group on the device side, but not on the REST api side, causing it to go into this code path. It then removes this group in the rest api and with it removes the group from all devices.

Now I can fix this for group0/0xfff0, but I'm not quite sure what happens for any other group the Fyrtur is added to. The same thing could happen, or perhaps this is handled somewhere. @manup do you have insight into that?

popy2k14 commented 3 years ago

I dont know much about the code inside deconz but just an idea:

prevent group0/0xfff0 (that from the config table) to ever get deleted from the device!? Or if device is a sensor (where the code path is triggered on fyrtur) check if device is also a light -> dont remove it.

Just a few ideas, but i think @manup will have better ones :-))

MattWestb commented 3 years ago

If 0xfff0 is one default groupe the is should not being possible deleting it at all also for other part of the system or novice users like my.

I think we need cloning Manpu some more time (10 or so) ;-))

KodeCR commented 3 years ago

Solving group0/0xfff0 is not the issue, it's understanding the code well enough so that it's solved properly also in other cases. I'll create a PR soon if I don't find out/hear any more.

popy2k14 commented 3 years ago

I am here to test, can you provide an test build before PR? With this we can be sure to not break other things.

popy2k14 commented 3 years ago

Ping @KodeCR any news on the PR?

thx

Mimiix commented 3 years ago

@popy2k14 We are discussing it within a meeting atm.

popy2k14 commented 3 years ago

@Mimiix thx for the info. Please let us know your results :-))

KodeCR commented 3 years ago

Ok, I know what is going on now, and I've changed the code to only add lights to the all group, hence the blinds will never be added. Could you please test the following plugin based on the 2.8.0 release: libde_rest_plugin.so.zip (sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins)

I expect that the group0 will be removed one more time removing the group from the blinds, and then will stay after that.

Sorry for the wait.

popy2k14 commented 3 years ago

@KodeCR thx a lot. Don't worry about the delay in this crazy times.

Can I test/use this plugin on my raspbian 02.07.01 installation? (because it's based on 2.8.0)

Thx

popy2k14 commented 3 years ago

@KodeCR using your rest plugin now for 15 minutes in my 02.07.02 system and group 0 was not deleted. I would say issue fixed, thx a lot!!!! Will take a look in a few hours again and come back here.

Will the PR be merged into the next release?

popy2k14 commented 3 years ago

Seems good for me also after ~3h. thx a lot.

KodeCR commented 3 years ago

Great, thanks for testing and confirming.

The PR will need to be reviewed before it's merged, so assuming there aren't any unforeseen issues, probably next release, or the one after.

popy2k14 commented 3 years ago

Nice, thx for the info. Keep up the good work.

stale[bot] commented 3 years ago

As there hasn't been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

KodeCR commented 3 years ago

Waiting on merge of PR #3966

popy2k14 commented 3 years ago

Just to let you know guys, the test build from above running without an issue over a month now. Hope this gets merged anytime soon.

github-actions[bot] commented 3 years ago

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

popy2k14 commented 3 years ago

Not solved! Waiting on merge of PR #3966

github-actions[bot] commented 3 years ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

popy2k14 commented 3 years ago

Not solved yet

github-actions[bot] commented 3 years ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.