Page 1 of 7
Weekly programming
Posted: Tuesday 12 December 2017 14:32
by syrhus
Hi
I'm a new Domoticz addict. I had previously a zipabox but too limited and have to pay to use user variable in command.
So, I'm concern about a thermostat program.
I've developped an "easy" way to see and create a weekly heating program up to 4 differents temperatures(adjustables).
I've changed the utility part to get this:
EDIT 12/12/2018

- Capture.PNG (174.65 KiB) Viewed 8463 times

- odd_even.PNG (28.16 KiB) Viewed 4889 times
On latest version, you can:
select time range from 1 hour to 10 mins.
program on 2 weeks with odd & even weeks mode
decactivate the entire "program" and activate it later without any need to delete all timers
The graph table load setpoints and display its (if type = "On time" or "Odd & Even weeks")
To use it, click on one of 4 temperature button and click :
- on top left corner to select all
- on hour column to select one complete hour for all days
- on semi-hour column to select half hour column for all days
- on days to select an entire day
- on a cell to select a specific time at a specific day
You can edit temperature's values on buttons to select your own ones.
When user click on Update, all setpoints are cleared and replaced by new ones.
If it is interesting the team, I would be happy to contribute and add this on gitbub.
I would like to help on web part too if you are interesting too.
Regards
Re: Weekly heating programming
Posted: Tuesday 12 December 2017 15:26
by emme
I personally would LOVE it!
Re: Weekly heating programming
Posted: Tuesday 12 December 2017 18:53
by Denny64
It's fantastic. It would be very useful for timer programming
Re: Weekly heating programming
Posted: Friday 15 December 2017 8:35
by garethhowell
I’m also interested. Managing timers is one of the less well developed areas of Domoticz IMHO
Re: Weekly heating programming
Posted: Monday 18 December 2017 10:04
by bigpea
Fantastic!
I'd like to have it, please!

Re: Weekly heating programming
Posted: Monday 18 December 2017 20:37
by syrhus
For people interesting, joined required files.
I have changed :
app/utilityControler.js
views/utility.html
css/style.css
Do a backup of your existing files before replacing by joined files.
To update files on your web browser, change in thefile
html5.appcache the ref number to force to reload aplication files.
CACHE MANIFEST
# ref
INCREASE_NUMBER_HERE
Hope this would help you to create your planning

Re: Weekly heating programming
Posted: Tuesday 19 December 2017 9:51
by bigpea
Ok, implemented!
I think your work it's fantastic!
But.. I want to try to do a change for my use, because I want to use it also for "switch selector".
you think that it's possible? I have this switch selector:

- Screenshot_2.png (23.26 KiB) Viewed 8425 times
Re: Weekly heating programming
Posted: Tuesday 19 December 2017 10:08
by syrhus
Hi bigpea
Thank you.
That's a very interesting way to use your selector switch! I've seen there is not yet mutualisation of js code between switches and utilities.
So, for now, to do what you want to achieve, you have to change :
app/lightscontroller.js
views/lights.html
and the planning javascript code to play whith your switch levels instead of the 4 temperatures values
As your request is very intersting to do this with switch levels, I will look at how to implement it on both sides (lights and utilities).
Regards
Re: Weekly heating programming
Posted: Tuesday 19 December 2017 10:39
by bigpea
yes, because the logic is the same but the objects that will be used for the set (in you case "economique", confort", etc) will be variable with the values inserted in the switch selector.
Re: Weekly heating programming
Posted: Tuesday 19 December 2017 10:50
by syrhus
Just to precise, on the 4 buttons, you can define your own temperature for each one, from the higher to the lower value.
In fact, you're right this like levels.
But may be it is more easy to change temperature values on buttons than changing level values?
Anyway, I will try to apply the same thing to lights controller and adjust to code to work either the 4 butons or on/off or switch levels.
Thanks
Re: Weekly heating programming
Posted: Tuesday 19 December 2017 11:00
by emme
syrhus, I think I can reply on behalf of bigpea (we're friends and working on the same thermostat procedure)
The timerplan would switch between levels (10, 20 30 etc etc), regadless their names
the names are the temp setpoint that are assumed in the script portion, but the timer should NOT consder them
they are a sort of "favorites" setpoints

ciao
M
Re: Weekly heating programming
Posted: Tuesday 19 December 2017 11:18
by bigpea
Ciao emme

As you told, for me "The timerplan would switch between levels (10, 20 30 etc etc), regadless their names"
Re: Weekly heating programming
Posted: Tuesday 19 December 2017 11:24
by syrhus
Hi emme
I understand the way you want to work with levels. But, with setpoints, I have to deal with the temperature value stored for each timer. There is no variable or tag stored with setpoint.
So, I created 4 values in an array sorted from higher to lower. I linked a color for each value.
It is not working with names; "confort", "eco", "night" ... are only displayed to suggest a correlated value. It is working with temperature values mapped to colors.
With levels, either the user has to enter temperature value as level number(id) which is not the default way (10-20-30) or the planning has to work with level's label which is not the most robust thing to do.
So, I clearly understand your "wishes for christmas"

but I have to analyse how to work with levels.
If you have any suggestion on this, you're welcome

Re: Weekly heating programming
Posted: Tuesday 19 December 2017 11:31
by Swifty
This looks brilliant.
Please do a pull request to get this into the main domoticz source, that way we can make use of the great addition while still maintaining smooth upgrades

Re: Weekly heating programming
Posted: Tuesday 19 December 2017 11:41
by emme
Dear Santa... oops!
I'm not a real programmer nor a coder and I strongly think that Javascript hates me, but please do not assume my next few lines as a f***ing user thinks that programmers does nothing all day except drink coffee and play games while "compiling"
If your planner works with values (setpoints) my understanding would be that it could work with levels either...
I mean... you can evaluate 4 values with different color in which you define 4 diffenet values (numbers)
what about having an array with 10 entries valued 10,20,30 etc etc (levels are integer)
so the timerplan will set that level, having it assume a specific name that will trgger the scripts and the procedure will do the rest....
please don't blame against me... it's Christmas time and we're all good guys

Re: Weekly heating programming
Posted: Tuesday 19 December 2017 13:04
by syrhus
emme wrote: Tuesday 19 December 2017 11:41
Dear Santa... oops!
I'm not a real programmer nor a coder and I strongly think that Javascript hates me, but please do not assume my next few lines as a f***ing user thinks that programmers does nothing all day except drink coffee and play games while "compiling"
If your planner works with values (setpoints) my understanding would be that it could work with levels either...
I mean... you can evaluate 4 values with different color in which you define 4 diffenet values (numbers)
what about having an array with 10 entries valued 10,20,30 etc etc (levels are integer)
so the timerplan will set that level, having it assume a specific name that will trgger the scripts and the procedure will do the rest....
please don't blame against me... it's Christmas time and we're all good guys
it seems you know real programmers! LOL How do you know I'm drinking coca and watch movies all day long while it is compiling?
I made a mistake; with levels, it is on lights controller and is stored either on/off state or level name. On setpoint, temperature value is stored. So, I will look at that seriously to provide the good way to work with lights AND setpoints.
But, sorry, not sure to upload a file before Christmas

Re: Weekly heating programming
Posted: Tuesday 19 December 2017 13:11
by syrhus
Swifty wrote: Tuesday 19 December 2017 11:31
This looks brilliant.
Please do a pull request to get this into the main domoticz source, that way we can make use of the great addition while still maintaining smooth upgrades
Thank you Switfy.
First, I will try to implement it with swtich levels too.
After, I'm modifying the html part cause of duplicated ids on the DOM and replace huge table layout with a more suitable html layout.
When I will have a "complete" suggestion, I will pull a request but I'm afraid that changing/breaking layout would not be appreciate because it means themes have to be redesigned

Re: Weekly heating programming
Posted: Tuesday 19 December 2017 14:29
by emme
Thank you so much!!!
I think you have made a GRAT job and an important step ahead for Domoticz!!!

Re: Weekly heating programming
Posted: Tuesday 19 December 2017 14:37
by Denny64
This is a milestone for Domoticz.
Thank you so much for jour excellent job.
Re: Weekly heating programming
Posted: Wednesday 20 December 2017 15:12
by syrhus
Santa is coming!
So,with this version, the user can plan for a week:
- thermostat temperature (setpoint)
- light On/Off
- light selector
Do a backup of or files before replacing with joined ones.
In the
html5.appcache file , change the ref value to force to refresh files on your web browser
Have a nice christmas day before the d day
