Timeline picker to setup heating, light and so on

@dimmenhau, @ghof thank’s for your help. The solution form dimmenau is a bit shorter, so i will create a new brunch on gitlab with a timelinepicker version for OH3 and update the OP with a note and the link. At first i thought for OH3 i will only use the javascript version. But the discussions around helper libraries are odd, and i’m not sure if or when a file-based development is possible. So it’s good to get a runnable version with the Rules-DSL.

And last but not least @Mohammad_Chaaban

Sarcasm ON: So, sorry that you whast your time. My time is unlimited and your comment is encouraging.

Sorry bro, not meant what u understand… i meant to say my effort to upgrade to OH3 without making sure that ur fantastic time picker solution will work on OH3…sorry again for misunderstanding… off course i appreciate what u did, all we do… i have been using this for the last 1.5 year… u r a life saver…

Ah, then also sorry for the misunderstanding. :slightly_smiling_face:
I will now update the OP and insert the link for the OH3:

2 Likes

Hi Torsten,
After upgrading to OH3 i had some problems with the timelinepicker, at first (as above) with the: (now.getMinuteOfDay() / 15).intValue` the change to (now.getMinute() / 15).intValue
did not give an error but there was also no action from the timelinepicker I eventually chanced it to:
((now.getHour() * 60 + now.getMinute()) / 15).intValue
I also had issues with the ScriptServiceUtil. It took me a while and changed the following:

import org.eclipse.smarthome.model.script.ScriptServiceUtil
to
import org.openhab.core.model.script.ScriptServiceUtil

After this it all works for me.

I hope this is usefull,

Regards Robert

1 Like

Hi Robert,
i have also read a report on gitlab and changed the import line. (timeLinePicker.rules)
Please can you check if it really nessesary this to change:

Hi Torsten,

It seems nessesary as in the releasenotes from OH3:

"Rules now use Java Time API instead of Jodatime so some expressions need to be adapted:

  • getHourOfDay → getHour, getMinuteOfHour → getMinute, getMonthOfYear → getMonthValue"

as you can see getMinute = getMinuteOfHour and not getMinuteOfDay so to get the previous getMinuteOfDay we must take the hours*60 and add the getMinute. I’m sure there are other (nicer) options but it works fine.

Greetings Robert

1 Like

Hi Robert,

i have edit the rules file. But another question. In Line 86 of timeLinePicker.rules (v 0.8.1) is

var Number currDay = now.getDayOfWeek()

Can you confirm that this works? The old and expected output is:
0 - monday, 1 - tuesday, … 6 - sunday (edited after the post from rmvdmrl)
1 - monday, 2 - tuesday, … 7 - sunday

Hi Torsten that is a good question, I only use mode 17 (all day’s) and i didn’t get an error (and it works). So had to do some testing.
As it is now (today) the now.getDayOfWeek() returns “Friday”
so it must be chanced aswell to:

var Number currDay = now.getDayOfWeek.getValue()

then today(on friday) it returns 5 (I did try -1 to get to the above values (0-6) but then it switches on the wrong day so i quess 5 is good for friday).

Greetings Robert

Hi Robert,
thank you for your help. I have edited the file on gitlab and you are right. The correct values are:
1 - monday, 2 - tuesday, … 7 - sunday (i have edit the post above to avoid irritations)

P.S. In the javascript version is sunday - 0. This was my confusion.

Hello everybody,
I have now managed to set up a heating control system with the timeline. There are a total of 4 heating modes (normal, vacation, absent and summer mode). In summer mode, all radiators are off. Every other heating mode has its own timeline with different heating times.
Now I have the problem that no matter which mode I have selected (except summer mode, of course), it always triggers all timelines at the respective set times.

Can you somehow configure it in such a way that only the respective timeline that was selected using the heating mode is triggered?

The rule is written in DSL

Thanks in advance

Greetings Didschu

I did the same in my configuration… if torsten allow me, u can ignore lines 163,164,165,166,172,173,174,175 in the rule file of v. 0.8.0

Hi @Mohammad_Chaaban , yes of course. It’s open source and you can change what ever you want.
But this lines are to prevent for multiple sending a command. This will not change the functionality.

@Didschu You can’t disable a timeline from a rule.

@tose :
Also, is there generally no way to deactivate a timeline or to age it?

No, this is not possible.

You should work with separate items for each season. Then you can define a item that’s represent the current season. The last item is the gate.
For the next one you need a separate rule. Here you can select the setpoint correspondeing to seson and send it to your valves or devices.

Hi @tose, i did this to prevent items from changing back to their initial state… it worked…

@Mohammad_Chaaban Ah i remember me that someone posted this here. I think you are using the event mode.
If this approach works for you, it’s ok, but much better would be not to use event mode. Then you don’t have to change the codebase.

i get with the latest v0.8.1 rule an error:

2021-01-22 09:45:00.990 [ERROR] [openhab.core.model.script.timepicker] - error in transfer string

My glass sphere is broken, sorry. Now you must write two hints more as the error message itself.
(OH version?, new install?, what are you changed?)

i have the latest OH3 docker container in use, it is a new install, i have everytihng like in the example, i use the openhab-timeline-picker-openHAB3_oldRuleDSL, also i have TransferItem1 and TransferItem2, both with one item in the ().
For the sitemap i used a working one from the oh 2.5 setup, ony with the change of days, 1,3,5
The downloaded files also the latest

First check if JSONpath installed.

I’m not sure if 1,3,5 is working. Please try 1,2,3,4,5,6,7 and when the timelinepicker is working you can remove 2,4,6,7 and try again.