Timeline picker to setup heating, light and so on

can’t get it to run on OH 3.1
Downloaded the files from the openHAB3_oldRuleDSL branch, copied the files. Then I used the example.rules to create the Items, linked the Items with my heating setpoint items in the config part. It shows the Timeline picker, but the DevTools says “warn in API call; transfered data is empty or not valid”.
OH log sends this output:

13:41:45.179 [ERROR] [.openhab.core.model.script.timepicker] - error in transfer string

Any idea what I’m doing wrong?
Thanks

Yes, one idea could it be:
You doesn’t installed the Jasonpath transformation. Right?

you’re right, thank you. Now I’ve installed the JsonPath transformation, there’s the next error:

07:50:39.093 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'timeLinePicker.rules'
07:50:48.484 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'timeLinePicker-1' failed: cannot invoke method public java.util.Set java.util.HashMap.keySet() on null in timeLinePicker
07:50:49.496 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'timeLinePicker.rules'
07:51:00.651 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'timeLinePicker-1' failed: json string can not be null or empty in timeLinePicker

Please post your item definition (including the both groups) and the part ‘data structure’ in the rules file with your personal definitions.

TransferItems:

Group   gTimepicker
Group   gTimepickerObserver
String TimelineHelper "[%s]"
String TransferItem1 "[%s]"      (gTimepicker)
String TransferItem2 "[%s]"      (gTimepicker)

rules config:

// -------------------- part of config -----------------------------------------------------------------------

val HashMap<String,ArrayList<String>> timePicker = newHashMap(
    "TransferItem1" -> newArrayList('HeizungSchlafzimmer_SetPointTemperature')
)

// -------------------- end of config ------------------------------------------------------------------------

“HeizungSchlafzimmer_SetPointTemperature” is a Number:Temperature item, referring to my homematic thermostat. This item is also member of the group “gTimepicker”

Why do you join ‘HeizungSchlafzimmer_SetPointTemperatur’ with gTimepicker? Have you read this in the doc? That’s not correct.
But the error-message is not directly correspondending with this. Perhaps the error is triggert in first run of rule. Please remove the group from the item above.

Yes, in the doc on gitlab it shows the example.item, where the dummy items all are in the gTimepicker group. If I remove the item from the group, i still get one of the two errors:

10:16:15.228 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'timeLinePicker-1' failed: json string can not be null or empty in timeLinePicker

That’s odd with the doc. I will this correct, thanks for your reply.
I can look at the error tonight.

In the first step i have no idea where the error occurs.
For my self i’m using since a long time the javascript version and unfortunaly OH 2.4. So i’m not able to reproduce the error.

What can you do?

  1. Change to javascript- version. (It’s the best way but you must adapt some path’s in the javascript rule file)
  2. You must insert debug lines in the rule, after each line with the JSonpath - transform (6 lines).
    This pattern: logInfo(“TL”,“a001”), logInfo(“TL”,“a002”), logInfo(“TL”,“a003”), …

Than we can look where the error occurs.

btw: I’m pretty sure others are unsing this timeline picker version. Perhaps noone has reported this error!?

Hi @samu00,
please look on the gitlab repository. I have merged a pending commit with some changes. (thanks at Kupfer on gitlab for your work). Perhaps you can try to reinstall the complete timeline picker and i hope the error is gone.

Thank you very much, its working fine now.

Hi,

first of all, thanks for this great tool! I tried to setup (still on 2.5.10) and I can see the timeline perfectly:

However, I can’t make any changes to the timeline. The Chrome console doesn’t show any errors. Any idea what I might have done wrong here?

Oh dear… I think I should have taken another cup of coffee… Of course, I have to select the “on” in the legend frist… Everything works like it should - sorry for the confusion!

1 Like

Hi,

First, thanks for this great work.
I have installed this in my OH3 environment to control my heating and want to share some observations. Not sure if I missed something or if this is something for the backlog:

  1. Only change item status at the beginning of a given period
    Example: You have configured heating period (e.g. 21°C) in an office room from 7am - 5pm and non-heating (e.g. 18°C) while you are not working.

Current behavior: Every 15 min when the rule is running, the temperature will be set and overwrites any manual adjustment (e.g. if you turn off the heating because a window is open or if you increase from 21 to 23 because it is too cold, this will automatically change back when the rule is running again).

Ideal behavior: Having an option that any change is only applied once (e.g. changing from 18 to 21 at 7am and changing back to 18 at 5pm), but in the meantime, when no change is applied in the timeline do not publish any update and allow any manual adjustment.

→ this one is currently a no-go for me, to not use your timeline, even though I like it a lot. Maybe worth if someone else can share if/how they solved this use case

  1. It would be great if there is an option through a switch item or other command, to activate / deactivate the timeline from any other rule or script and not only manually through the UI. This would help to support more automated use cases (e.g. only run the heating schedule if someone is at home, but if no presence is detected automatically disable the timeline)

  2. The timeline can also be useful to turn on / off light and do some kind of presence simulation. Therefore it would be helpful if the schedule cannot only be set at a fixed time, but also at a range and the change will be actioned at a random time within the range.
    E.g. turn on the light at a random time between 6-7pm and turn of at any time between 10.30-11pm
    (yes I know this can be achieved with a scheduled rule and some javascript, but if I want to schedule different things it would be nice to schedule them all in the same place)

The timeline picker is working correct. But there is a the event mode. For really simple usecases this could be an option for you.

I think much more better is a separate gate (item) so you can control your heating with different priorities for different rooms:
1 … manual overide
2 … window control
3 … scheduling

The same as before, a gate would solve this. The deactivation from other rules is not easy implementable. But i’m working at a new version, not as binding but think based. Here could a deactivation from other rules possible.

That’s looks interesting. Can you provide the code for this mode? My own to-do list is unfortunally long and time is a limiting factor. :wink:

Hello,

I have many years the timeline picker on OpenHAB2.
Now I have a new installed OpenHAB3, and it looks like fine.
Only I can’t save the configrued timeslots:
I click to the button “SAVE” and then of the button “SURE”, but by SURE nothing happens.

Where can my mistake be?
Thanky! Michael

Tell us the used version RuleDSL or javascript.
The second think: Open the developwer console in your browser, press the button ‘sure’ and show the output in the console.

deleted

Please read the docu in the OP. Also, there are some post’s in this thread with an additional description to this mode.

Actually I would not prefer a further language. The Javascript and the Rule DSL versions are running with OH2.4, 2.5 and also OH3. It s a big task to mainten this versions. I can’t see the advantage of additional languages. Questions in conjunction with other languages is too much.
I’m working at new features in the moment (sunset, sunrise, command mappings) and will only support the Javascript version. I hope the integration of graalVM will go some steps and the installation will be much more easyer.

1 Like

Hi Torsten,

I’m just starting to automate the heating system and your timeline control seems like a very good component for it. I’m running on OH 3.1 and was using DSL rules till now. I see, that you prefer JSR version. Does your component support OH 3.1 and the upcoming 3.2 as well? I do not have any experience with the JSR in OH, but have long term experience with Javascript, so I would prefer switching to it from DSL (what I do not really like).
For the JS version of the timeline, is this the correct branch to download:
Files · develop-migrationToJSR223_javascript · Torsten / openhab timeline picker · GitLab?

Thanks!