Rotary Encoder Support#415
Conversation
986df4b to
6569123
Compare
|
Very interesting! I think a valuable addition to this fw! The ERS-10TZBVK-AA you mention default FW has an annoying issue (trigger accidentally toggle between COMMAND and EVENT mode) If your fw addition could solve this then that would be great. |
|
Posting to let anyone following know that I'm still working on this and haven't abandoned it. I think it's very close now, I've completed the firmware, tests and converter. Tonight I've managed to build and flash a ERS-10TZBVK-AA device and initial testing looks good. So its now had basic testing on Telink and Silab chips Over the next few week I plan to clean this branch up, to present clean MR for review. |
|
WOW! Thank you very much, i hope Romasku is doing well and can find time to merge this in his fw. My observations: This feels somehow odd i think this behavior should be reversed? I like this behavior (please don't change this behavior) although i think it is meant to work reversed? Would be ideal if this behavior can be configurable. edit: |
d1265db to
2063c70
Compare
Start with support for 1 device: Tuya Smart Knob (https://www.zigbee2mqtt.io/devices/ERS-10TZBVK-AA.html)
203f3b8 to
7800000
Compare
|
Thanks for the testing! Your right, I had the A and B pins for the encoder switched in the config string. Have fixed it now. Currently, clockwise is mapped to level/temp up and anti to down. I agree with you about the colour temp, the up command making the the colour colder feels wrong to me, but I believe its increasing the 'Mireds' which is inverse to Colour Temperature (High Mireds = Low Colour Temp = Cold Light) I need to look into the Battery config. Hopefully, adding BTXX to the config should be all that is needed. |
|
I have marked this as ready for review as I would be comfortable with it being merged in it's current state. |
|
Flashed the new fw bin and setting brightness works absolutely fine now. Have you also tried binding it to a group? I just did, genLevelCtrl, genOnOff and lightingColorCtrl can be bound to a group but the lights of this group don't follow/react. edit: |
|
I haven't tried a group. But its looks like there is a known issue (and a fix!) with binding to group with a Silabs device. #437 |
Hi,
I've been working on adding support for Rotary Encoders to your firmware. Is this something you'd be interested in merging?
This work is still rough and in progress, just wanted to get it out there early for feedback.
Currently it supports detecting and sending the commands to bound devices. But there is no config or multistate.
Demo
Rotary.Encoder.Demo.720.mp4
Motivation
My dream 'light switch replacement' for my smart home is a device which looks like a normal dimmer switch, is mains powered, and does on/off, brightness and color temp, via bindings. For use with smart bulbs which are always powered. I haven't found such a device, so I decided to look into creating my own. Currently I'm using 3 of the inputs from a TS0004 (https://www.zigbee2mqtt.io/devices/TS0004_switch_module.html) with a basic dev kit rotary encoder (https://www.ebay.co.uk/itm/365206572477).
There are some battery devices which I believe this change would add support for, like https://www.zigbee2mqtt.io/devices/ERS-10TZBVK-AA.html I have some, but I have not tested this on them yet.
Unit Tests
I've dropped these for now to reduce the size of this merge
The branch also includes support for unit tests, using Unity and CMock. This was something I really wanted, as my unfamiliarity with this type of programming meant I was often unsure about behaviour and needed to test it. It can of course be dropped from this merge, but I think it has value.Disclaimer ;)
I'm a professional Java and Node engineer. But C, Make and programming for embedded systems are completely new to me and very different! (though also very interesting). I have probably brought some of my high-level language habits with me. So please advise on any code smells, etc. Feedback very welcome!