Skip to content

adds safety watchdog for led thermal throttling#2059

Open
kamilsss655 wants to merge 3 commits intoopenshwprojects:mainfrom
kamilsss655:safety-thermal-throttle
Open

adds safety watchdog for led thermal throttling#2059
kamilsss655 wants to merge 3 commits intoopenshwprojects:mainfrom
kamilsss655:safety-thermal-throttle

Conversation

@kamilsss655
Copy link
Copy Markdown

Closes: #2054

Tested this with 3 different bulbs, it works really well. My stronger bulbs are throttled less, than the ones that get hot more easily. The constants I've added are sane defaults that I think make sense for the model I tested with, however ideally these could be configured by users themselves. I didn't dive into config implementation so I didn't want it to be part of this PR.

I've enabled it only for LN882H, because that's what I could test with. However it likely could work with other platforms as well.

Notes:

  • Additionally I fixed multiple re-definitions of g_wifi_temperature - as including new_common.h is sufficient and proper approach IMO
  • Added low pass IIR filter to LN882H temp readings to smooth it out
    • you might consider porting it to all the other sensors as it really smooths out the signal and helps the throttling algorithm

Please let me know if you have any questions/suggestions.

@kamilsss655 kamilsss655 changed the title adds safety watchdog for led thermal throttling (WIP) adds safety watchdog for led thermal throttling Mar 29, 2026
@kamilsss655 kamilsss655 changed the title (WIP) adds safety watchdog for led thermal throttling adds safety watchdog for led thermal throttling Mar 29, 2026
@MaxineMuster
Copy link
Copy Markdown
Contributor

since the values are "hardcoded" for the moment and you have the bulbs ;-):

maybe you could try my try for a simple "config" command?

grafik

there's probably much room for improvement, but as a start ...

config.diff.txt

@kamilsss655
Copy link
Copy Markdown
Author

Hey @MaxineMuster these look good. I don't see any changes to the throttling logic, so if the command stuff (which I am unfamiliar with) is ok it will likely work. 👍

I'd imagine what you've done to be a natural progression of the initial thermal throttling implementation, so I view your changes as positive addition. I am not the maintainer of this repo, but I'd suggest you follow-up with a PR once this one get's merged. I won't be around to test these soon, but the code looks good to me.

WDYT @openshwprojects ?

@openshwprojects
Copy link
Copy Markdown
Owner

It's very good, but it does not justify separate directory. We need a file for that. Either next to newLEDDriver or just make it a driver, put entry in drv_main.c, call it LEDThrottle or anything, etc. So basically just rename/organization, so it's more intuitive.

While seeing "safety" name myself, i would never guess it's a LED dimmer limit.

@kamilsss655
Copy link
Copy Markdown
Author

Thanks for the review and the feedback — glad you find the feature useful.

I understand the concern about naming and placement. At the moment I’m already using this in my setup and don’t really have the bandwidth to rework the structure.

If you’d prefer it organized differently (e.g. merged into an existing driver or renamed), feel free to adjust it as you see fit. I’m happy for the contribution to be adapted to match the project’s conventions.

Let me know if anything functional needs clarification from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Thermal throttle for lightbulbs (LN882H, BP5758D)

3 participants