Page 1 of 1

How to use WiZ lights with Domoticz

Posted: Saturday 23 October 2021 17:09
by lassehifi
WiZ Connected is a series of lights and other Wifi connected IoT. The units are cheap and works well. The WiZ app is actually good and easy to use. But, if you have a Domoticz system you would of course like to integrate the WiZ units. Below are two solutions:

1. Use the Domoticz plugin

Install this plugin:
https://github.com/sydspost/Domoticz-Wi ... ted-plugin
If you are lucky everything goes OK and you can control your WiZ units.

2. Use UDP commands


I will describe my solution for a Windows system. If you are running Linux I guess it is almost the same.

- In your router, add a static IP to your WiZ lights.
- Add a virtual (dummy) light in Domoticz.
- Download Swiss File Knife and copy just the exe file sfk.exe to a folder, that you will use for your script action below
- In the virtual light you created, have a level for every action you would like, for exemple ”Off” and ”On”.
- Connect the level to a script action, see the screenshot below
Domoticz_Wiz_Setup.jpg
Domoticz_Wiz_Setup.jpg (34.97 KiB) Viewed 17993 times

- Now you can control your WiZ lights!

The UDP command lines used in the script actions

I got the idea from this site:
https://aleksandr.rogozin.us/blog/2021/ ... mmand-line

I noticed for sending from a Windows cmd you need to escape the ” sign. As an exemple, the command for a light is like this (replace the IP address xx.xx.xx.xx with your fixed IP-address of your light):

Turn ON

Code: Select all

sfk udpsend xx.xx.xx.xx:38899 -listen {\"id\":1,\"method\":\"setState\",\"params\":{\"state\":true}}
Turn OFF

Code: Select all

sfk udpsend xx.xx.xx.xx:38899 -listen {\"id\":1,\"method\":\"setState\",\"params\":{\"state\":false}}
Good luck with your WiZ lights and units!

Re: How to use WiZ lights with Domoticz

Posted: Sunday 16 July 2023 16:08
by Menno
Thanks for this!
Is just found one of these lights 50% discounted for €7, so decided to pick it up.
Used the app to connect it to wifi.
Decided not to use the plugin, it depends on python3-scapy which wants to pull in 193 additional packages and take up 866 MB of disk space.
Instead I perused the site you referred to to make two small scripts:

wiz-on:
#!/bin/bash
echo '{"id":1,"method":"setState","params":{"state":true}}' | nc -u -w 1 192.168.178.93 38899 > /dev/null 2>&1

wiz-off:
#!/bin/bash
echo '{"id":1,"method":"setState","params":{"state":false}}' | nc -u -w 1 192.168.178.93 38899 > /dev/null 2>&1

And made the dummy hardware, new switch and have those scripts executed.
I noted giving the full path like in your example does not work (anymore?), so for me it looks even more simple:

On action: script://wiz-on
Off action: script://wiz-off

Re: How to use WiZ lights with Domoticz

Posted: Friday 23 February 2024 12:59
by domo67
lassehifi wrote: Saturday 23 October 2021 17:09 WiZ Connected is a series of lights and other Wifi connected IoT. The units are cheap and works well. The WiZ app is actually good and easy to use. But, if you have a Domoticz system you would of course like to integrate the WiZ units. Below are two solutions:
was looking for this, glad to find it. Thanks for this mate

Re: How to use WiZ lights with Domoticz

Posted: Thursday 11 April 2024 12:43
by Derik
Dear...

I am looking for wiz working with domoticz.
Love a home script or directly...

Is there no api of this type

Re: How to use WiZ lights with Domoticz

Posted: Thursday 11 April 2024 19:53
by waltervl
Derik wrote: Thursday 11 April 2024 12:43 Dear...

I am looking for wiz working with domoticz.
Love a home script or directly...

Is there no api of this type
In the first topic of this discussion a Domoticz plugin is mentioned.....