shelly-homekit icon indicating copy to clipboard operation
shelly-homekit copied to clipboard

Shelly RGBW PM Dual Input Dimming?

Open mnm736 opened this issue 10 months ago • 8 comments

I've ton a bunch of tests and research and I believe this feature is not currently available - but wanted to ask just in case I am doing something wrong. I can't seem to get it to work under RGB mode (I am using 1 color LED strip, but this also wont under the stock firmware under that mode, you must use RGB mode I've gathered). If this is something that could be added in that would be amazing.

I want to link the RGBW PM to HomeKit, but the homebridge plugin does not support it at all, My plan was to flash this firmware onto it but without this feature it wont work in my setup:

I have a one of these wired to I1 and I2, with up (I1) being on/increase brightness, and down (I2) being off/decrease brightness. this works with the below setup on the stock firmware:

Image Image

Let me know what you think thank you!

mnm736 avatar Feb 09 '25 21:02 mnm736

Hi,

yes currently we have no dimming control via buttons, not via one and also not via two.

Of course we can take that as an idea, but currently not planned

markirb avatar Feb 10 '25 18:02 markirb

ok thank you for confirming!

On Mon, Feb 10, 2025 at 1:58 PM Markus Kirberg @.***> wrote:

Hi,

yes currently we have no dimming control via buttons, not via one and also not via two.

Of course we can take that as an idea, but currently not planned

— Reply to this email directly, view it on GitHub https://github.com/mongoose-os-apps/shelly-homekit/issues/1623#issuecomment-2648959787, or unsubscribe https://github.com/notifications/unsubscribe-auth/BPKNWIO3PGCNBLNINZBUSSL2PDZFPAVCNFSM6AAAAABWZG6Q5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNBYHE2TSNZYG4 . You are receiving this because you authored the thread.Message ID: @.***>

mnm736 avatar Feb 10 '25 23:02 mnm736

@markirb I also flashed to this firmware and wanted to be able to dim my LED light strips (I'm not using the I1-I4 connections, just O1-O4 to control four separate strips). I'm a long time developer, it's been a while since I've written any C++, but if there is any guide or documentation to how to get started with this codebase, I'm happy giving it a go and trying to raise a PR?

andyjeffries avatar Sep 18 '25 07:09 andyjeffries

Hi Andy,

you can check out basics here: https://github.com/mongoose-os-apps/shelly-homekit/wiki/Development

It should be possible to just fire up GitHub codespace to get started.

Your entry point should be to introduce new input modes for the LEDs that match Shellys. https://github.com/mongoose-os-apps/shelly-homekit/blob/master/mos.yml#L103

Then somehow you need new to implement dimming here and generate appropriate events: https://github.com/mongoose-os-apps/shelly-homekit/blob/master/src/shelly_input.cpp

and handle those: https://github.com/mongoose-os-apps/shelly-homekit/blob/master/src/shelly_hap_light_bulb.cpp#L467

Grouping two inputs will be harder I think first you should try single input dimming...

markirb avatar Sep 19 '25 06:09 markirb

Thanks for that @markirb . I've got it cloned locally, Mos installed, first build underway.

The Shelly doesn't seem to have any standard connection for connecting to a computer (old school serial port, USB-C, etc). I assume you flash via the web interface instead (I've already got it installed on my device)?

Also, I guess there's no nice emulator for the device that you can develop against and see how it's working - or do you/people just write code in theory then build and deploy to your actual device?

You can ignore the next bit, saw in https://github.com/mongoose-os-apps/shelly-homekit/wiki/Development#deploying-firmware-using-ota that it seems to have a test period of two minutes or is auto-rolled back. Maybe it's still a question on what happens if it seems fine, you commit and then realise something is broken and need to recover it. But I guess you only do that if you can see the web interface comes up?

EDITED: IGNORE: And if the latter, what do you do if you completely break something (e.g. it just crashed out over and over), how do you recover the device back to a good OS install?

Thanks for any help.

I found another firmware that does support dimming (but not as nice to work with as this one, so I'm hoping to get some tips for how they implemented it too - it's GPLv3 so I won't copy code over, but at least be able to understand the mechanism of how they do it).

andyjeffries avatar Sep 19 '25 15:09 andyjeffries

No there is no standard connection. I have a USB <-> UART bridge for rescue. But normally it is not needed.

There is an emulation for Linux see ShellyU* Devices, especially ShellyURGBW2, those can be used to verify web interface and other changes first before going to the device. The devices recovery capabilities are normally good enough to recover from most errors

For GPIO emulation there is no real solution yet, so this is more on the hardware then...

markirb avatar Sep 20 '25 06:09 markirb

OK, thank you.

I think what I'll do is get another Shelly device, PSU and some basic electronic components so I can work on a test device rather than my main one.

That'll be next month, I've spent a ton on my home office renovation this month and my wife will kill me if any more Amazon boxes arrive!

andyjeffries avatar Sep 20 '25 08:09 andyjeffries

Just to update, I've decided if I've got to learn about this stuff anyway - I'm just going to go with an ESP32 and code it myself (using HomeSpan) as the learning will be more generally useful. So I won't be picking this up now.

andyjeffries avatar Sep 29 '25 07:09 andyjeffries