Timeline picker to setup heating, light and so on

@MilosM Thank’s for your feedback and advice. You are solveing this task. :+1:

In general i will not change anything in the ruleDSL version of timelinepicker. The javascript version is the future, my time is limited and unfortunately i can’t see how many guys is using the timelinepicker and the various versions. So it’s not so cool, to invest a lot of time for to few installations. (5?, 50?, 300?)

The new v3 is maintained! :grinning:

Here you will find new features:

  • switching depending of sunrise and sunset
  • easer installation (a pretty solution for the token for access on the REST- API is missing but the version is running pretty well)

There are two versions:

I posted this infos a few months ago. The interest is pretty limited and i was busy with other things.
Tester and feedback woud be a good idea. Than i can/would update the OP in this thread.

5 Likes

Ok, I was trying to use this updated version. So far no luck. I continue to have the following error:
[WARN ] [b.automation.script.file.RNTs-tlp3.js] - tlp - E002: error in inner loop {}

The API-token has been set to the three files named. Took some detour before reading to use encoding instead of decoding.

Next issue is with the sitemap not showing anything in the windows. Just the windows and some indication of an icon plus the title. I tried with Chrome and Safari.

Any idea how to resolve these issues?
All files have been double and triple checked for its right location. The conf file has been tried and the link in the site map as well.

The second issue is primary. First you need to see the timeline in UI. Please post the line from your sitemap-file where you call the timelinePicker.

The second you can post the output from the developer console when you refresh the site with the timeline picker.

Ok, long time spend and finally seeing some progress. In Chrome I do see the charts and can change settings. Still there is an issue. When restarting the webpage the graph every time asks for either continue with accepting a change or clear timeline.

The ‘.conf’ file is not in use/empty. Therefore I would expect to set the id in the url together with the name for the linked item. How else would the chart know which item to link to.

Webview url=“http://xx.xx.xx.xx:8080/static/tlp-jsr/index.html?id=uid_140&conf=params&mode=15,67&states=Tag,Nacht,Komfort&linkedItems=BadUG&lang=en&deactivation&event&dark&zoom=force” height=14

Please tell us what was wrong.

What happens, when you refresh the site in your browser? Are you see empty timelines?
You can post the output from the developer console in crome. First refresh the site, set some entrys in the timeline and save this value’s.

I have no clue what made in run the end. After numerous reboots, trying with the paths in the files etc. it suddenly showed the desired info on the Chrome.

Ok, lets come to the error list. For some strange reason I do have Vietnamese fonts only. The software is looking for Robot_Medium.

Next thing see in the image.
image

Have you past the token in file tlp_thing_controller?
(base64 !)

The output from your console shows the refresh moment not the moment when you save the timeline.

checked the token between the three files. Its exactly the same in all files.

after pressing save it only says ‘update succeeded’ in switchPointSet jar.js:343

before that it shows
TypeError: Cannot read properties of undefined (reading ‘event’)
at switchPointSet_jsr.js:263:70
switchPointSet_jsr.js:293 TypeError: Cannot read properties of undefined (reading ‘event’)
at switchPointSet_jsr.js:263:70
switchPointSet_jsr.js:293 TypeError: Cannot read properties of undefined (reading ‘event’)
at switchPointSet_jsr.js:263:70

and another copy from Chrome

GET http://192.168.0.5:8080/basicui/fonts/Roboto-Regular.ttf 404 (Not Found)
roboto.css:1 GET http://192.168.0.5:8080/basicui/fonts/Roboto-Medium.ttf net::ERR_ABORTED 404 (Not Found)
tlp_thing_controller.js:29 TypeError: Failed to fetch
at MaterialLayout.init (ripple.js:243:1)
at new MaterialLayout (ripple.js:243:1)
at n (ripple.js:243:1)
at i (ripple.js:243:1)
at Object.o [as upgradeAllRegistered] (ripple.js:243:1)
at ripple.js:243:1
tlp_thing_controller.js:29 TypeError: Failed to fetch
at MaterialLayout.init (ripple.js:243:1)
at new MaterialLayout (ripple.js:243:1)
at n (ripple.js:243:1)
at i (ripple.js:243:1)
at Object.o [as upgradeAllRegistered] (ripple.js:243:1)
at ripple.js:243:1
tlp_thing_controller.js:29 TypeError: Failed to fetch
at tlp_thing_controller.js:26:11
at new Promise ()
at tlpThing.get (tlp_thing_controller.js:12:12)
at tlp_thing_controller.js:137:16
at new Promise ()
at tlpThing.get_id (tlp_thing_controller.js:134:12)
at Vue._initTimelineView (switchPointSet_jsr.js:234:20)
at Vue.created (switchPointSet_jsr.js:97:10)
at callHook (vue.js:2921:21)
at Vue._init (vue.js:4617:5)
tlp_thing_controller.js:29 TypeError: Failed to fetch
at tlp_thing_controller.js:26:11
at new Promise ()
at tlpThing.get (tlp_thing_controller.js:12:12)
at tlpThing.getAll_id (tlp_thing_controller.js:177:31)
at VueComponent._initAdminSetupView (tlpAdminSetup.js:101:16)
at VueComponent.created (tlpAdminSetup.js:87:10)
at callHook (vue.js:2921:21)
at Vue._init (vue.js:4617:5)
at new VueComponent (vue.js:4785:12)
at createComponentInstanceForVnode (vue.js:4304:10)
tlp_thing_controller.js:29 TypeError: Failed to fetch
at tlp_thing_controller.js:26:11
at new Promise ()
at tlpThing.get (tlp_thing_controller.js:12:12)
at VueComponent._initAdminSetupView (tlpAdminSetup.js:105:18)
at VueComponent.created (tlpAdminSetup.js:87:10)
at callHook (vue.js:2921:21)
at Vue._init (vue.js:4617:5)
at new VueComponent (vue.js:4785:12)
at createComponentInstanceForVnode (vue.js:4304:10)
at init (vue.js:4125:45)
switchPointSet_jsr.js:293 TypeError: Cannot read properties of undefined (reading ‘event’)
at switchPointSet_jsr.js:263:70
switchPointSet_jsr.js:293 TypeError: Cannot read properties of undefined (reading ‘event’)
at switchPointSet_jsr.js:263:70
switchPointSet_jsr.js:293 TypeError: Cannot read properties of undefined (reading ‘event’)
at switchPointSet_jsr.js:263:70
vue.js:8542 Download the Vue Devtools extension for a better development experience:
GitHub - vuejs/devtools: ⚙️ Browser devtools extension for debugging Vue.js applications.
vue.js:8553 You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at Production Deployment — Vue.js

Okay. But here is the first time we need access to OH and use the token. Have you really encoded in base64?

I can reproduce the error message. However, it is not important at the moment.

for the token… at first I followed your description going with the decode. There were quite different errors when using this token. So I have to assume when using the correct way for the encrypting of the token and the error messages disappeared that on this end I should be fine.

Used the link you provided for encoding.

Just did the encoding again. Behaviour remains the same.

When encoding there are basically two options. Destination character set is set to UTF8 and destination newline character is set to LF (Unix).

I’m using a RaspberryPi with this two options and it’s works as well.

I still suspect that the thing will not be created and you haven’t access to OH REST-interface.
Perhaps you will send me a pm with your token. After the timeline picker is working you can revoke this token and create a new one.

This is the importend point, when the timeline picker is creating the thing. What can be seen in your console?

Revoke the token and create a new one, so you are safe again.
When i decode the token it’s seems okay or it’s inside the namespace from OH.

Now we need the console output from chrome when you save the timeline.

by the way, this is what it looks like in case of faulty token

tlp_thing_controller.js:26 GET http://192.168.0.5:8080/rest/things/tlpicker:tlp:home 500 (Server Error)
(anonymous) @ tlp_thing_controller.js:26
get @ tlp_thing_controller.js:12
(anonymous) @ tlp_thing_controller.js:137
get_id @ tlp_thing_controller.js:134
_initTimelineView @ switchPointSet_jsr.js:234
created @ switchPointSet_jsr.js:97
callHook @ vue.js:2921
Vue._init @ vue.js:4617
Vue @ vue.js:4716
(anonymous) @ switchPointSet_jsr.js:27
tlp_thing_controller.js:26 GET http://192.168.0.5:8080/rest/things/tlpicker:tlp:home 500 (Server Error)
(anonymous) @ tlp_thing_controller.js:26
get @ tlp_thing_controller.js:12
(anonymous) @ tlp_thing_controller.js:137
get_id @ tlp_thing_controller.js:134
_initTimelineView @ switchPointSet_jsr.js:234
created @ switchPointSet_jsr.js:97
callHook @ vue.js:2921
Vue._init @ vue.js:4617
Vue @ vue.js:4716
(anonymous) @ switchPointSet_jsr.js:27
tlp_thing_controller.js:26 GET http://192.168.0.5:8080/rest/things/tlpicker:tlp:home 500 (Server Error)
(anonymous) @ tlp_thing_controller.js:26
get @ tlp_thing_controller.js:12
(anonymous) @ tlp_thing_controller.js:137
get_id @ tlp_thing_controller.js:134
_initTimelineView @ switchPointSet_jsr.js:234
created @ switchPointSet_jsr.js:97
callHook @ vue.js:2921
Vue._init @ vue.js:4617
Vue @ vue.js:4716
(anonymous) @ switchPointSet_jsr.js:27
tlp_thing_controller.js:26 GET http://192.168.0.5:8080/rest/things/tlpicker:tlp:home 500 (Server Error)
(anonymous) @ tlp_thing_controller.js:26
get @ tlp_thing_controller.js:12
getAll_id @ tlp_thing_controller.js:177
_initAdminSetupView @ tlpAdminSetup.js:101
created @ tlpAdminSetup.js:87
callHook @ vue.js:2921
Vue._init @ vue.js:4617
VueComponent @ vue.js:4785
createComponentInstanceForVnode @ vue.js:4304
init @ vue.js:4125
createComponent @ vue.js:5595
createElm @ vue.js:5542
createChildren @ vue.js:5669
createElm @ vue.js:5571
patch @ vue.js:6117
Vue._update @ vue.js:2660
updateComponent @ vue.js:2788
get @ vue.js:3140
Watcher @ vue.js:3129
mountComponent @ vue.js:2795
Vue.$mount @ vue.js:8527
Vue.$mount @ vue.js:10926
Vue._init @ vue.js:4627
Vue @ vue.js:4716
(anonymous) @ switchPointSet_jsr.js:27
tlp_thing_controller.js:26 GET http://192.168.0.5:8080/rest/things/tlpicker:tlp:home 500 (Server Error)
(anonymous) @ tlp_thing_controller.js:26
get @ tlp_thing_controller.js:12
_initAdminSetupView @ tlpAdminSetup.js:105
created @ tlpAdminSetup.js:87
callHook @ vue.js:2921
Vue._init @ vue.js:4617
VueComponent @ vue.js:4785
createComponentInstanceForVnode @ vue.js:4304
init @ vue.js:4125
createComponent @ vue.js:5595
createElm @ vue.js:5542
createChildren @ vue.js:5669
createElm @ vue.js:5571
patch @ vue.js:6117
Vue._update @ vue.js:2660
updateComponent @ vue.js:2788
get @ vue.js:3140
Watcher @ vue.js:3129
mountComponent @ vue.js:2795
Vue.$mount @ vue.js:8527
Vue.$mount @ vue.js:10926
Vue._init @ vue.js:4627
Vue @ vue.js:4716
(anonymous) @ switchPointSet_jsr.js:27
switchPointSet_jsr.js:293 TypeError: Cannot read properties of undefined (reading ‘event’)
at switchPointSet_jsr.js:263:70
switchPointSet_jsr.js:293 TypeError: Cannot read properties of undefined (reading ‘event’)
at switchPointSet_jsr.js:263:70
switchPointSet_jsr.js:293 TypeError: Cannot read properties of undefined (reading ‘event’)
at switchPointSet_jsr.js:263:70
tlp_thing_controller.js:178 Uncaught (in promise) TypeError: Cannot use ‘in’ operator to search for ‘error’ in {“error”:{“message”:“Illegal base64 character 2e”,“http-code”:500,“exception”:{“class”:“java.lang.IllegalArgumentException”,“message”:“Illegal base64 character 2e”,“localized-message”:“Illegal base64 character 2e”}}}
at tlpThing.getAll_id (tlp_thing_controller.js:178:17)

thought to use the direct output for the oh3 token since I am using similar for other rules. In this case it is not working.

Yes, you must go the way in the description, it’s nessesary to decode in base64.

this is what I get after I changed the timeline and pressed save

tlp id uid_110 - update succeed switchPointSet_jsr.js:343

it adds up the success events every time I update and save

What are your setting for the implicit user role and basic authentication? May be there is the reason for the trouble.

To me it looks like loading and saving have different directories. If i press Cancel after reloading the sitemap all data is available.

You mean your entrys in the timeline you have saved are present?

encode rather than decode??? Decode gives a loooong list of error messages

I have checked the settings in API-security.
implicity userrole is activated
basic authentication is disabled

Now i have no glue whats going wrong.
I summarise once:

  • you can create a timeline (id)
  • this will written in your thing (jsondb from OH)
  • you can call this created and stored timeline but you get the message this is a new timeline and you must abort this question

Can you confirm this summary?

P.S. please remove the browser cache an check again.