Timeline picker to setup heating, light and so on

Hi, is there any way to active/deactivate any single timelinepicker by rules (instead of by sitemap)?
For instance,
I use a timelinepicker as crono-Thermostat with weekly program (i.e. morning cold while we are at work/school).
I want to create a rule based on presence detection that if my kids are at home instead of school (as often happen due to COVID restriction), deactive the timelinepicker in the morning and force hot temperature till moon or till they left home and then active the timelinepicker again.

Thanks for your help
Lorenzo

@Foxejoe No, there is no api to activate/ deactivate from a rules.

Perhaps i can help with an idea:

  1. In my own heating configuration i have a switch ‘1x on’. That means the next ‘redeuce’ periode is ignored and heating is active. For this a have a proxy item. The state of this item is controlled from the timelinepicker and the state of the ‘1x on’ switch.

Here is the UI: Timeline picker to setup heating, light and so on - #496 by tose

  1. A second approch are three states:
    ‘reduce’, ‘heating’, ‘heating when inhabitant’.
    You need a proxy item again. In a rule you can check is ‘heating when inhabitant’ aktive and someone is home (switch, or MAC- Adress) then heating else reduce.
    You might be able to display the two heatingstates well in the timeline picker with a customized color scheme.

Have you considered publishing this on the marketplace ?
Please do when you package for v3.

@tose
thank you for this wunderful time line picker. I use it with the event option on. However in my use case I do not want to restore the status when “manuel” mode is activated, but remain the status as is. Therefore I removed some lines in the rule. Can you add an extra option for this?

Thanks

Hi Herman,

thanks for your feedback. Yes, i will introduce an event mode 2. In this mode the command will be sendet to the item one times. At the moment i have finished v3.0. I have to write the docs and adapt this version to OH3. After that i will realize event mode 2 with v3.1.

Fantastic, cannot wait :wink:

@tose
I was able to make the timeline picker work in the android and from external network.
I modified two lines in switchPointSet.js

replace line

let openHAB_ip = urlParams.get('ip');

by

let openHAB_ip = urlParams.get('ip')? urlParams.get('ip'): location.host;

and replace line

this.ip = "http://" + openHAB_ip + '/rest/items/';

by

this.ip = location.protocol + '//' + openHAB_ip + '/rest/items/';

now the ip parameter is optional and when you leave it out, it switches automattically to the right url when used through externally with myopenhab.org.
the 1st change, I stole from another thread where a UI 3 widget for the timepline is proposed.

Can you incoporate this in your next release?

Thanks Herman

1 Like

I’m using this in newer versions (jsr- version) of Timeline picker:

window.location.origin

This grabs the protokoll and the port in one.

I assume you are using the version for the rule DSL.
This ones are deprecated.

OK, I will wait for the V3 version on OH3.
Thanks again for all the effort.

Herman

Hi at all,

i have finished the first version of v3 of timeline picker. :grinning:
This is for openHAB 2.4 and earlier with installed new rule engine.
The version for openHAB 3 is coming as next.

tlp-slides-small

Some new features:

  • sun events
  • admin widget added
  • headline in single timeline
  • alias for switch states
  • translations for complete timeline picker

Who has running an 2.4 installation and is willing to test?
Also i need help for translations.

Here you can find the new version: see on GitLab
Feedback would be helpful. :wink:

I do not use OH2.4 anymore.
Below the dutch translation.

Thanks

  "nl" : {
    'tf0000': 'opslaan',
    'tf0001': 'annuleer',
    'tf0002': 'doorgaan',
    'tf0003': 'ok',
    'tf0004': 'bevestig',
    'tf0005': 'fout',
    'tf0006': 'opmerking',
    'tf0007': 'waarschuwing',
    'tf0008': 'titel',
    'tf0009': '',
    'tf0010': '',
    'tf0011': 'handmatig',
    'tf0012': 'aanmaken',
    // warning
    'tf0108': 'data aan het laden',
    'tf0109': 'zoek contact met je admin',
    'tf0110': 'ontbrekende of fout id voor deze tijdlijn',
    'tf0111': 'de tijdlijn parameters zijn gewijzigd',
    'tf0112': 'verwijder deze id',
    'tf0113': 'nu verwijderen',
    'tf0114': 'verkeerde parameters in de tijdlijn, contacteer je admin',
    'tf0115': 'afbeelding gestopt',
    'tf0116': 'gebruike bestaande parameters (afbreken), wis tijdlijn en gebruik nieuwe tijdlijn (doorgaan)',
    'tf0117': 'niet bestaande tijdlijn'
    'tf0118': 'Zon activering en offsets',
    'tf0119': 'alias voor commando\'s',
    'tf0120': 'zonsopkomst',
    'tf0121': 'zonsondergang',

    // label t
    'tf0201': ['ma - zo','ma - vr','maandag','dinsdag','woensdag','donderdag','vrijdag','zaterdag','zondag','za - zo'],
    'tf0202': 'inactief',
    'tf0203': 'activeren',
    'tf0204': 'deactiveren',
  }

@tose, I am trying to use v3 on OH3
After some changes to several paths in the javascript, the server side seems to execute.
However the client side fails when requesting the thing tlpicker:tlp:home, due to authentication needed for /rest/things. I can manually add the credentials in the code, but do not see how to solve this structural, since the client does not know them.
How did you envision this?

Regards Herman

Hi Herman,

as first many thanks for your translations.
You are right, the authorisation is nessesary - on the front end and on the backend side.

I push my running OH3 solution on a separte brunch. But i think it’s not smart or nice. It’s nessesary to paste a token in the code. This is not smart. But on the pro it’s running and i will think about a better solution.

I create the brunch now (without a step by step doc, this must wait)

Hi Herman,

please look here on GitLAB But attention the README is not finished. The steps in ‘v3 for openHAB 3.x (graalVM)’ are importend.

Hi, I would also like to test this, but I have problems decoding the token. Can I also just log in with user and password? What change in the headers vector would I have to make?

Edit: Problem solved

@tose, thanks for the OH3 version with GraalVM.
I have it running after some juggling with base64, it appears you to have the encode function on https://www.base64decode.org to get the right token.
I found 2 issues:

  • when you change the sunset/rise delay something gets mingled up in the data, the widget showed additonal item states. I could only resolved this by erasing the timeline and restart.
  • when using the android app or through home.myopenhab.org the widget shows “loading data” in a green square, nothing else.

Hi herman,

when you can use the widget it’s fine and thanks for your your feedback.

Is this behavior when the event mode is active? I think i remember me, that i have seen this and then ignored. :roll_eyes: I’m going to take a look at that.

Is the mobile with the android app running in the same network or connected via VPN? This should run but i will test it tomorrow. Probably the access through home.myopenhba.org not possible, because it’s a CORS- problem. Can you open the dev tools in your browser and open a side with the timelinepicker? I think you will see a CORS- Error/Warn.

When this case is true, this is a limitation.

I use the tlp in event mode, so yes to your 1st question.

With respect to the access problems: I use the android app on the local network. When I access the widget through home.myopenhab.org , it shows the message below in the dev tools. I does not sound related to CORS. As mentioned in previous posts, I used the 2.4 version (DSL) succesfully with the app and with myopenhab.org. If I can help further let me know.

Torsten,

Even without touching the sunset/sunrise offsets de timeline data gets messed up. See below only de AAN and UIT state are set in url, the other two states are added by itself.

@tose, any change to look at the mentioned issues?
I think I found one of the bugs in switchPointSet_jsr.js bij commenting out line 213

// if (this.eventMode) this.switchStates.unshift(this.content['tf0011']) // remove state manuell