Hi,
I do like your timeline picker and also received very positive feedback at home on this. Very easy to use. Thanks a lot
There was just 1 downside for my use-case, where I needed to adjust your code and want to share this back, in case this is also relevant for others:
Example:
Radiator setpoint should be set to 21 degrees between 8am and 5pm (working hours), but only 18 degrees between 5pm and 8am (non-working hours).
Whats happening with your regular script:
every 2 minutes the setpoint item will receive a command to set the configured temperature
Whats not working:
If during the day, for any reason, the setpoint temperature is controlled manually, than the setpoint is updated latest after 2 minutes again by the rules and the manual change is reverted back.
What I want to achieve:
Only issue an command to the setpoint, in case the value is changing → only at 8am and 5pm, not at any other time. This should help, if you e.g. at 1pm decide to increase / decrease the setpoint for the rest of the day.
What I have done:
Within conf-openHAB/automation/js/RNTs-tlp3.js I added the following line:
below line 134:
let newStateIndex = channel_conf[currDay][currTimeInterval]
let prvStateIndex = channel_conf[currDay][Math.max(0,currTimeInterval-1)]-1
changed line 182 from:
if ((newState != undefined) && (items.getItem(iTS).state != newState)) items.getItem(iTS).sendCommandIfDifferent(newState)
to:
if ((newState != undefined) && (items.getItem(iTS).state != newState) && (newStateIndex != prvStateIndex)) items.getItem(iTS).sendCommandIfDifferent(newState)
With this change, a command to the item will only be issued within the first 15 minutes after a change is configured via timeline picker. After the first 15 minutes timeline picker will not send any further command.
Also please note, that this is not perfect, as this will only consider changes during the day. If there are changes exactly at midnight, this will not work.
Maybe its helpful for others and an inspiration