Feature request: GUI to set multiple timers at once, depending on variables

Functionality and usage of the OpenNethome Server
Don MC
Posts: 31
Joined: Mon Nov 16, 2015 7:40 am

Feature request: GUI to set multiple timers at once, depending on variables

Post by Don MC »

I use NetHome partly to control wake-up times etc. I have made a whole load of Timers, Scenes and Triggers to do something as simple as waking up and leaving for work. A normal morning would be something like this (wakeup is at 07:00, we leave the house at 08:00):

-At 06:30 a dawn light sets in, slowly increasing the dim level until the light is on 100% at 07:00 - (IntervalTimer).
-The coffee maker switches on at 06:55 to make sure it is ready by 07:05, when we stumble into the kitchen - (WeekTimer).
-The car heater switches on at different times, depending on the outside temperature. The aim is to have the car ready at the time of departure. There are three diffrent triggers for pre-set levels (Above +3°C = no heating, +3°C to -5°C = 45 minutes heating, -5°C to -12°C = 60 minutes of heating, below -12°C = 120 minutes of heating) - (ValueTriggers setting WeekTimer).
-All lights switch off at the time of departure - (WeekTimer controlling Scene).

It would be nice to have some kind of control that can be programmed to set all these timers at once (well, maybe apart from the car heater, that would need an entirely different solution, see below). You would enter a time and it would set the different timers at predetermined offsets. Example:
Enter wake-up time 07:00 and the program does the following:
-Sets dawn light to start at 06:30 (-30 minutes offset).
-Sets coffee timer to switch on at 06:55 (-5 minutes offset).
-Sets lights to switch off at 08:00 (+60 minutes offset).
-Sets "car ready for departure" time at 08:00 (+60 minutes offset).


The car heater would need an entirely different system. A complex timer item that is trigged by the outside temperature and offsets the switch-on time by predefined increments depending on the outside temperature. Example:
Above +3°C = disable heater timer (set timer to 'nothing').
+3...-5°C = set "heater On time" at -45 minutes offset.
-5...-12°C = set "heater On time" at -60 minutes offset.
Below -12°C = set "heater On time" at -120 minutes offset.

Even though the departure time would be set at, say, 08:00, the heater would stay switched on for an additional 15 minutes (until 08:15). This is because we don't always leave at excactly 08:00. Sometimes it's a little before that, sometimes a little after. That would be an additional offset parameter (trailing time offset).


Now if for some reason I have to get up at 06:00 on some mornings, I need another bunch of Scenes and Triggers to do this. I've programmed a few scenes that set all these timers in half-hour increments and enable/disable different triggers, depending on if I want to wake up at 06:00, 06:30, 07:00, 07:30 or 08:00. That adds up to an awful lot of scenes, triggers and stuff. Just to get up in the morning. And even then, they are a pain in the ass to use.


So the bottom line is: It would be nice to have one timer item (or action scene) that would set all these different times from just one time that is entered into the box. It could be like:
Enter wake-up time: __:__
Enter departure time: __:__
and it would do all the rest according to different offset times (these could be set in a different window).

The car heater would probably need a timer/trigger item of its own. It could receive the departure time from the item above, but would then set the different temperature variables, the heating times and the trailing time depending on what the user has entered in its settings window.


Since I don't know how to do this, I wonder if anyone on this forum already has done something like this, or at least can point me in the right direction?

EDIT: It could be something like the item DayLiteTimer, which can have offset times added or subtracted to sunrise (R) or sunset (S). You know like [S+00:30] for a time 30 minutes after sunset.
Here, the hypotethical 'MorningTimer' could have offset times depending on WakeupTime (W) or DepartureTime (D). For example, my dawn light timer would be set to start at [W-00:30], my coffee maker would be set to switch on at [W-00:05] and all my lights to switch off at [D].
The MorningTimer could get its W and D times from a simple GUI page, that only has two boxes for entering the times. The page would be easily accessible and usable on the phone as well as on the computer.
stefangsbb
Site Admin
Posts: 313
Joined: Sun Nov 30, 2014 2:16 pm

Re: Feature request: GUI to set multiple timers at once, depending on variables

Post by stefangsbb »

Wow, you have quite a setup there... It seems you are really using the system fully!!

I do understand the problem, but I would have to think a bit to come up with a reasonable and general solution. One way would of course be to add the possibility to do Python-scripting as one user have done, but that requires programming knowledge and that should not really be required to use the system.

Another way would be to expand the timers to have one or two "variables" that can be configured as separate attributes in the timer and that could be used the same way as "R" and "S" on the timer expressions. I have been thinking of a "next generation" timer and this is really good input for that.
Don MC
Posts: 31
Joined: Mon Nov 16, 2015 7:40 am

Re: Feature request: GUI to set multiple timers at once, depending on variables

Post by Don MC »

I'm not nearly using the system to it's max :) There's still a lot more potential.

That "NG timer" would be great. Also, an "NG ValueTrigger" would be great as well. The current trigger only has two values (min and max) and I'm forced to use multiple ValueTrigger items for that car heater system. If the temparature drops below Min in TriggerA, it activates triggerB that goes a little further down on the temperature scale. Then if it drops below Min in TriggerB, it activates TriggerC and so on. Each switchover also sets the CarHeaterTimer to a different time setting. This is how I achieved the different temperature ranges for the car heater. Perhaps not a very elegant solution, but it was the first best solution I could come up with at the time.

I'm constantly thinking of better ways of doing that. I have a few ideas to reduce the number of triggers needed, but I need to think them through before trying them out. The above system isn't perfect either. Let's say the temperature is 0 degrees and the system has set the heater to switch on at 07:15 (45 minutes before [D]). Then, at 07:05, the temperature suddenly drops to -6 degrees and the system sets the timer to 07:00 (1h before [D]). What happens then? Does the timer switch on at all, or does it wait until 07:00 the following morning? -Luckily this hasn't happened to me yet, but it is a potential problem.


If you need to brainstorm ideas for timer or trigger items, I'd be glad to help out. I don't know much about programming, but I do understand how these items "think" and I do know swedish. It's easier to brainstorm in your own language.
stefangsbb
Site Admin
Posts: 313
Joined: Sun Nov 30, 2014 2:16 pm

Re: Feature request: GUI to set multiple timers at once, depending on variables

Post by stefangsbb »

Well, maybe we could start throwing some ideas out here so others can participate. Here are some ideas so far:

1) The NG timer should be able to know if it should be on or off when you activate it or start the system and issue the correct command. So if it has a time period set to 08:00-10:00 and you activate the timer at 09:00 it should send an on-command.

2) It should be easy to reuse settings from another day, often you have to repeat the same line over and over again. One idea would be that if you specify time as " that would mean "same as yesterday", so if you have the same schedule for the whole week, you would specify that for Monday and then just specify " for the rest of the days.

3) To simplify the random times, maybe you could specify a random time span separately in the Item as an attribute, Random = 00:30, and in the time periods you would use the R-variable like: 08:00+R-10:00, meaning that the start time would be at some point in time between 07:30 and 08:30

4) What we discussed before - variables: In the Item you can specify two variables A and B for example as attributes and then you can use them in the time expressions. You could set Variable A=08:00 and variable B=00:15 and in the time expression write: A-10:00+B, meaning start at 08:00 and end at 10:15. These variables could for example be used as wake up time, and the value of the variable could be changed with scene scripts.
Don MC
Posts: 31
Joined: Mon Nov 16, 2015 7:40 am

Re: Feature request: GUI to set multiple timers at once, depending on variables

Post by Don MC »

Those are all great ideas. I support all of them. One question:

4) Do you mean the variables can be used as either Time Of Day and/or Time Interval?
If you set Variable A=08:00 and variable B=00:15, then that B could mean either "fifteen minutes past midnight" or just "fifteen minutes".
Your example says "A-10:00+B, meaning start at 08:00 and end at 10:15".
Could it also be used as A-B, meaning start at 08:00 and end at 00:15?
With brackets: [A]-[10:00+B] or [A]-. A plus sign or minus sign before the "B" INSIDE brackets changes the meaning of "B" from "fifteen minutes past midnight" to "fifteen minutes"?


Then it would be great to be able to set one or more of those variables depending on the input of ValueTriggers. I am again speaking of that car heater.
Let's say wake-up time is at 07:00 and departure time is at 08:00. Then I would enter Variable A at "07:00" and Variable B at "08:00". There could also be a Variable C. All of them could be set by any other Scene or Item.

Normally, the CarTimer would be set at [B-C]-[B+00:15]
If the temperature rises above +3°C, then Variable C would be set at "00:00" (in this case zero minutes).
A drop in temperature below +3°C makes the trigger set Variable C at "00:45".
A drop below -5°C sets C at "01:00".
And so on...

Also, I'd like to be able to set the interval between ValueTrigger checks. As of now, the interval is one minute. If I have anything in ActionWhileOverMax, then that command would be sent every minute the value is over max. I'd like to be able to change that to 10 or 15 minutes or so, because I don't want to send unnecessary radio messages every minute.
TotalPE
Posts: 19
Joined: Mon Dec 15, 2014 9:08 am

Re: Feature request: GUI to set multiple timers at once, depending on variables

Post by TotalPE »

Okey, i have a question about a new funktion i would like to have in the timer item.
Scenario, I use Nethome to steer the radiators in my house. My kids is at my place every secound week, changing sundays. When my kids isn't at my place i let the temp go down to 18.5 degrese in their rooms, and when they are at my place i let the temp be at 21.5 degrese
I would like to have a timer that i can use for this, if i call it a "every secound week timer funktion". Something like, switch on every secound sunday, and the other secound sunday turn of.
I have managed to accomplished this with several timers that turn on and of each others with delays in several scenes, but i think it shuld be very mytch simpler if there was an "do-this-every-secound-week" funktion.

Regards
stefangsbb
Site Admin
Posts: 313
Joined: Sun Nov 30, 2014 2:16 pm

Re: Feature request: GUI to set multiple timers at once, depending on variables

Post by stefangsbb »

My current idea (that I am experimenting with) is that I do not make any distinction if it is "time of day" or "time", I just treat all as time and add them up and in the end see it as "time after 00:00". I am changing the syntax a bit to make it easier to parse, and in return the syntax can be simpler. I will not need any []-characters. Instead I use -> to separate start and end time, and you can use variable and any number of additions/subtractions like:

08:00+A+I-01:05->10:00-A
R-01:00->S+01:00

The separator / means "the first of the expressions" and \ means "the last of the expressions":

06:00->10:00/R+00:20

The "every other week" schedule was a bit harder, I am thinking on how I would introduce that, but it might be some kind of separate Item for handling schedules over longer periods?
TotalPE
Posts: 19
Joined: Mon Dec 15, 2014 9:08 am

Re: Feature request: GUI to set multiple timers at once, depending on variables

Post by TotalPE »

Thank you for reply. I perhaps have an idea how one of those "every two weeks"-funktion could be
Let say you have an calendar funktion, or an droplist where you shoose a weekday, and another droplist where users can choose to repeat every one, two, three, four weeks. Or if you insted of the secound droplist have an text-field where you allow the user to enter the number of days between repetitions.

Regards
/Christian
stefangsbb
Site Admin
Posts: 313
Joined: Sun Nov 30, 2014 2:16 pm

Re: Feature request: GUI to set multiple timers at once, depending on variables

Post by stefangsbb »

I have now implemented the next generation timer, and it is called SunTimer. It is in the nightly build and the documentation is on: http://wiki.nethome.nu/doku.php?id=SunTimer. Please try it out and report feedback.

(I have not come up with any good way of handle "every other week" yet)
Don MC
Posts: 31
Joined: Mon Nov 16, 2015 7:40 am

Re: Feature request: GUI to set multiple timers at once, depending on variables

Post by Don MC »

Excellent! Thank you. Will study it.

One more thing: The ValueTrigger could use another function: Action while between Min and Max.
That could be left empty (= no action) if so wished, but could also be used to trigger events.
Post Reply