sbidy / pywizlight

A python connector for WiZ devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Did you backwards engineer the UDP methods?

JLannoo opened this issue · comments

If you did, how did you do it?

I'm asking because I'm working on a project for interfacing with WiZ Lights and basing most of my functionality on your documentation of the UDP methods.

While investigating I've found that some of the methods don't work with my bulbs (ESP24_SHRGBC_01) and some that you are missing.

For example, {"method":"getDevInfo","params":{}} returns:

{
  "method": "getFavs",
  "env": "pro",
  "result": {
    "favs": [
      [4,0,0,0,0,0,0],
      [14,0,0,0,0,0,0],
      [6,0,0,0,0,0,0],
      [2,0,0,0,0,0,0]
    ],
    "opts": [[],[],[],[]]
  }
}

The first number in each array is the scene code for my selected favorite scenes, but I don't know about the rest.

Also I've been trying to change the fade time with {"method":"setUserConfig","params":{"fadeIn": 0, "fadeOut": 0}} but get back "error": {"code": -32600, "message": "Invalid Request"}

I would love to collaborate in expanding the documentation and knowledge about the inner functioning of the API , but I don't know how I could go about helping you.

I was noticing that some of my bulbs became unresponsive after a software update. I wrote a library distantly based on this one, in C#, and I'm in the middle of updating the project, so I came here looking for some answers to interesting questions I had. This is definitely in the vicinity of the kind of questions I had been having.

Actually, I've managed to solve a lot of those issues. I'm in the middle of working on a new version of my own library (it's C#, things can get hairy), and so, I've got some relatively recent familiar experience with all of this.

Plus, my lib does have some features they haven't incorporated into pywizlight, but I've talked about it with them, like how the type of bulb is knowable (Lighting strip, A19, candelabra, flood light, etc.), but they don't want to program that information because they don't trust. However, in 3 years, I've found these specific markers to be reliable indicators of bulb type. Also, there are newer and older versions of the software, the reporting JSON is slightly different between the two.

Hey, there can be an increasing variation in the bulb API (because Wiz is now part of Signify / Philips Hue).
ESP24 seems to me something new (new chip or hardware platform). Potentially, they also change the API.

For having an overview of the API calls you can make and the returns, you can have a look into https://docs.pro.wizconnected.com/#introduction - this is the MQTT API which is partly also available via UDP.

ESP24_SHRGBC_01 is reported as the moduleName if the module is an ESP32-C3-WIZ20212. The chip is an ESP32-C3FH4.