Sonoff TH10/16 temperature threshold config
See original GitHub issueA 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:
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:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
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.
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… 😃