sydspost / Domoticz-WiZ-connected-plugin

Domoticz WiZ connected plugin
MIT License
5 stars 6 forks source link

Error adding new devices. #8

Open Klevebrand1 opened 2 years ago

Klevebrand1 commented 2 years ago

I have a problem adding new devices. Errorcode Error: (Wiz) Device creation failed , Hardware/Unit combination (12:8) already exists in Domotics.

Klevebrand1 commented 2 years ago

Solved. I had a broken lamp. It had unit id: 7 So my unit ID was 1.2.3.4.5.6.8 and when I tried to add 2 new lights it became a problem.

Had to remove unit ID 8 and add all that was missing.

Maybe it is possible to fix in the plugin so you do not have to delete them all if you have to add new ones if someone breaks.

sydspost commented 2 years ago

I altered the function for determing a free unitnumber slightly. But the problem is that i have just one wiz device at my home, so i can't test it. Can you test the new routine ?

Please replace the function "nextUnit" on row 357 with this code:

356 # Find the smallest unit number available to add a device in domoticz
357 def nextUnit():
358     units=set(range(1,256))
359     free=units.difference(Devices)
360     return list(free)[0])
361

Can you inform me of your testresults. If the problem is solved i will incorporate the code in the plugin on github

sydspost commented 2 years ago

Please,

Confirm if nu code-snippet solved your problem, then i van incorperate this solution in the plugin.

Syds

Klevebrand1 commented 2 years ago

Sorry. Have no time to test.

Den mån 13 dec. 2021 17:37sydspost @.***> skrev:

Please,

Confirm if nu code-snippet solved your problem, then i van incorperate this solution in the plugin.

Syds

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sydspost/Domoticz-WiZ-connected-plugin/issues/8#issuecomment-992659729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWDBXYVJGFFDVT7ULPWRKL3UQYOLTANCNFSM5HGODHWA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.