question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sonoff TH10/16 temperature threshold config

See original GitHub issue

A configurable temperature threshold for the heater mode for the Sonoff TH10/16 would be really useful - i.e

I am using a TH16 to trigger a system that heats a hot tub, and it’s inefficient to have it cycle rapidly to keep an exact temperature. I would like it to turn on when it is 2 degrees below the target temperature, and then turn off when it reaches the target.

I am sure this would be useful for other cases where rapid on/off is inefficient, or also where a range of temperatures is acceptable.

Here is how I think it can be implemented:

https://github.com/bwp91/homebridge-ewelink/blob/9ef9c2de83e7fff68960639999cdf487eb7ff15f/lib/device/simulation/th-heater.js#L298-L306

gets replaced with something like (a similar pattern can also be used in th-cooler.js)

if (this.cacheTemp < value - deviceConf.targetTempThreshold) {
    params.mainSwitch = 'on'
    params.switch = 'on'
    newHeat = 'on'
} else if (this.cacheTemp >= value) {
    params.mainSwitch = 'off'
    params.switch = 'off'
    newHeat = 'off'
}

and then to the config https://github.com/bwp91/homebridge-ewelink/blob/9ef9c2de83e7fff68960639999cdf487eb7ff15f/config.schema.json#L1120

add this

"targetTempThreshold": {
  "type": "number",
  "title": "Target Temperature Threshold",
  "description": "You can add a threshold so the device only switches on when the current temperature is at least the threshold away from the target temperature. This can be useful for devices that don't require an exact temperature and you want to reduce the on-off cycles. Must be positive and can include a decimal point.",
  "placeholder": 0,
  "condition": {
    "functionBody": "return (model.thDevices && model.thDevices[arrayIndices] && ['th', 'sc', 'hc', 'panel'].includes(model.thDevices[arrayIndices].deviceModel) && ['heater',  'cooler'].includes(model.thDevices[arrayIndices].showAs) && !model.thDevices[arrayIndices].ignoreDevice);"
  }
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bwp91commented, Feb 12, 2022

Hi @robjampar

Thanks for this suggestion. I have just released a new version of the plugin with some form of this feature, I haven’t tested it myself.

1reaction
bwp91commented, Feb 16, 2022

The code references you have mentioned should be fixed in 8.12.1-beta.1… I will get back to you with explanations about the rest of the points you have mentioned… 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set Sonoff TH10/16 to different temperature-operations for ...
This tutorial only demonstrates the 28°C at 18:00 – 23:59 because the other timeframe can be setup in exactly the same way or...
Read more >
SONOFF TH10/TH16-Smart WIFI Switch Monitoring ...
In conjunction with TH sensor, SONOFF TH10/TH16 can monitor temperature & humidity, and remotely control home devices and appliances.
Read more >
TH16 temperature sensor to control sonoff R3 at time intervals ...
I assume the set temperatures are hard coded from the config file? min_temp and max_temp constrain the range of temperatures that can be...
Read more >
Sonoff TH10/TH16 Switch Module Configuration for Tasmota
Sonoff sensors with 2.5mm jack. Sonoff sells 3 sensors with 2.5mm jack to use with the Sonoff TH. Sonoff Si7021 Temperature & Humidity...
Read more >
Email or Text temperature alerts using TH16? : r/sonoff - Reddit
That said, is there any relatively simple way to send an email or text alert when a temperature threshold is reached on a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found