Open junnuvi opened 3 years ago
Hello junnuvi. What modification did you make to the Plugin to make it work for color lamps?
Try this. http://ihan.tutkalla.com/wiz_plugin_rgb.py Also you need manually modify domoticz device type to rgbww lamp. Type=241, Switchtype=7,Subtype=7
Thanks junnuvi but.... where and how do I manually modify domoticz devicde type. I replaced plugin.py by your wiz_plugin_rgb.py and renamed it to plugin.py. In the fyle I change Subtype=8 tp Subtype=7 But that was obviously not the solution. ( I feel a bit stupid:)
You need to modify device type in sqlite database.
Thank you junuvi, that did the job.
Rene,
My plan is to adjust the plugin so it will detect if it's a warm white of a color bulb, and give it according to its detection the right subtype. Also depending on if it's a warme white or color bulb the correct message to Domoticz to update the device status. But i have no color bulbs at my home, so maybe you can give me the output of the following command:
echo '{"method":"getPilot"}' | nc -u -w 1
You get an answer like: {"method":"getPilot","env":"pro","result":{"mac":"a8bb5042a55c","rssi":-49,"state":false,"sceneId":11,"temp":2700,"dimming":40}}
If you post your output here, maybe i can improve the functionality of the plugin.
Thanks in advance,
Syds
Hello Syds, This is the response
{"method":"getPilot","env":"pro","result":{"mac":"6c2990905a81","rssi":-59,"state":true,"sceneId":11,"temp":3000,"dimming":20}}
Succes René
Sydspost,
Back to original topic. Are you able to replicate my problem? This is pretty annoying that plugin crashes every time when bulb is unreachable. I'm totally rookie with python so I was not able to fix it by myself. For now I disabled plugin to prevent domoticz to crash.
For future, it would be nice to have possibility to add devices manually and disable auto discovery. It does not work on all networks for example in situations when there is no automatic dns update feature in router.
I see once in a while the following error. Domoticz does not crash and the problem disappears automatically.
2021-12-01 03:04:24.345 Error: WiZ connected hardware (11) thread seems to have ended unexpectedly
In my case it will not crash immediately after bulb is disconnected (powered off from manual switch):
After Wiz connected plugin crashes other plugin threats will crash as well.. And some time after that whole Domoticz process will die.
Junnuvi, can you uncomment lines 123 until 125 in the plugin:
# if not dev.available():
# Domoticz.Error('Command for DeviceID='+Devices[Unit].DeviceID+' but device is offline.')
# return
and check if this solves your problem ?
Problem was too long default timeout.
Fixed like this:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.settimeout(5)
try:
sock.sendto(mJSON, (host, port))
received = sock.recv(1024).decode('utf-8')
except:
Domoticz.Error('Command for DeviceID='+Devices[Unit].DeviceID+' but device is offline.')
return
finally:
sock.close()
Btw, I found another fork of you plugin which has in my opinion better autodiscovery https://github.com/faust93/Domoticz-WiZ-connected-plugin
Thanks for all your work with plugin.
I have couple wiz devices which are connected to wall switch. When ever I shutdown lights from switch and try to control that device it will cause Domoticz-Wiz plugin and other plugins too to crash..
Only restarting domoticz will fix the issue.
My plugin is slightly modified because I have RGBW wiz devices but I don't believe modifications will cause this issue.