Rotary Encoder Support#415
Draft
Haydend wants to merge 64 commits into
Draft
Conversation
Setup is very rough!
Not done yet!
This allows us to drop all reference to the hal stub. And to control the response from hal_millis()
Tested by binding a light and toggling it on & off
…oggle command and level up/down Will re-add logic as when we need a feature
986df4b to
6569123
Compare
Haydend
commented
May 2, 2026
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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!