OpenZWave / open-zwave

a C++ library to control Z-Wave Networks via a USB Z-Wave Controller.
http://www.openzwave.net/
GNU Lesser General Public License v3.0
1.05k stars 918 forks source link

Rgbgenie #2531

Open UpDryTwist opened 3 years ago

UpDryTwist commented 3 years ago

Added support for RGBGenie switch (which should also improve support for other Sunricher switches, and maybe others). The RGBGenie is a rebranded Sunricher switch. It's wall-mounted, and offers a variety of controls for controlling RGB lights, including color setting, dimming, transition speed, and setting scenes. The version I have (ZW-3004) allows setting groups of devices, as well as three global scenes.

"Normal" mode for this switch would be to associate with your Z-Wave devices, and send them commands. It's supposed to be pretty quick and good at this. I wanted to use it to control a bunch of wifi lights, however, which meant I needed to receive its commands. I'm using python-openzwave + open-zwave.

The prior code expected to be SENDING commands to lights (and multi-association devices), so I needed to extend a bunch of the command classes so that they'd anticipate RECEIVING commands for color, etc.

I had to add a new configuration option -- MultiChannelSenderOnly -- to allow the code to behave properly when we have a device that will send us multi-channel commands, but does not expect to receive them.

I made three associated bug fixes or enhancements along the way:

I'll be separately adding a pull request to python-openwave to support these changes there.

UpDryTwist commented 3 years ago

FYI, failing as I'm honestly not sure what to do about the sequence number in manufacturer_specific.xml, given that I'm far behind the main on this one. Just need to update that to whatever it's supposed to be (?).

l3arcf commented 3 years ago

Wouldn't you change the revision number to 133? Excuse my brevity here, I'm just wondering. It's certainly not my area of expertise.

UpDryTwist commented 3 years ago

I guess. But 133 was used previously in the master (which is now on something like 154), so I wasn't sure the proper number to use ... Anyhow, the XML compiles fine, it's just this one check, that I guess should be set to whatever the final master # is if this is accepted, + 1. (?).

l3arcf commented 3 years ago

Well, a clean slate on the check will get faster/better attention than a failing one. Good luck!

UpDryTwist commented 3 years ago

Corresponding PR made in OpenZWave/python-openzwave. PR #207. This enhancement (in open-zwave) doesn't require that PR, but the change in python-openzwave is necessary to fully support the RGBGenie() (to handle level change events, and to be able to switch the log file path), and so does require this PR.

That is, open-zwave PR #2531 --/ does not require /-> python-openzwave PR #207 python-openzwave PR #207 --/ does require /-> open-zwave PR #2531.