Weekly programming

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
syrhus
Posts: 79
Joined: Tuesday 12 December 2017 14:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Paris
Contact:

Weekly programming

Post 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
Capture.PNG (174.65 KiB) Viewed 8152 times
odd_even.PNG
odd_even.PNG (28.16 KiB) Viewed 4578 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
Last edited by syrhus on Thursday 13 December 2018 9:06, edited 4 times in total.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Weekly heating programming

Post by emme »

I personally would LOVE it!
The most dangerous phrase in any language is:
"We always done this way"
User avatar
Denny64
Posts: 53
Joined: Friday 03 February 2017 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Italy
Contact:

Re: Weekly heating programming

Post by Denny64 »

It's fantastic. It would be very useful for timer programming
garethhowell
Posts: 115
Joined: Tuesday 17 November 2015 21:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9317
Location: St Neots, UK
Contact:

Re: Weekly heating programming

Post by garethhowell »

I’m also interested. Managing timers is one of the less well developed areas of Domoticz IMHO
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: Weekly heating programming

Post by bigpea »

Fantastic! :shock:
I'd like to have it, please! :D
syrhus
Posts: 79
Joined: Tuesday 12 December 2017 14:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Paris
Contact:

Re: Weekly heating programming

Post 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 ;)
Attachments
planning.zip
(26.09 KiB) Downloaded 334 times
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: Weekly heating programming

Post 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
Screenshot_2.png (23.26 KiB) Viewed 8114 times
syrhus
Posts: 79
Joined: Tuesday 12 December 2017 14:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Paris
Contact:

Re: Weekly heating programming

Post 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
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: Weekly heating programming

Post 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.
syrhus
Posts: 79
Joined: Tuesday 12 December 2017 14:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Paris
Contact:

Re: Weekly heating programming

Post 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
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Weekly heating programming

Post 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 :P

they are a sort of "favorites" setpoints :P
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: Weekly heating programming

Post by bigpea »

Ciao emme ;)
As you told, for me "The timerplan would switch between levels (10, 20 30 etc etc), regadless their names"
syrhus
Posts: 79
Joined: Tuesday 12 December 2017 14:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Paris
Contact:

Re: Weekly heating programming

Post 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" :D but I have to analyse how to work with levels.
If you have any suggestion on this, you're welcome :)
Swifty
Posts: 76
Joined: Saturday 31 December 2016 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Weekly heating programming

Post 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 :)
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Weekly heating programming

Post by emme »

Dear Santa... oops! :P
:lol: :lol:

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" :P :P

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 :P :P :P
The most dangerous phrase in any language is:
"We always done this way"
syrhus
Posts: 79
Joined: Tuesday 12 December 2017 14:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Paris
Contact:

Re: Weekly heating programming

Post by syrhus »

emme wrote: Tuesday 19 December 2017 11:41 Dear Santa... oops! :P
:lol: :lol:

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" :P :P

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 :P :P :P
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? :lol:

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 :(
syrhus
Posts: 79
Joined: Tuesday 12 December 2017 14:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Paris
Contact:

Re: Weekly heating programming

Post 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 :(
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Weekly heating programming

Post by emme »

Thank you so much!!!
I think you have made a GRAT job and an important step ahead for Domoticz!!! :D
The most dangerous phrase in any language is:
"We always done this way"
User avatar
Denny64
Posts: 53
Joined: Friday 03 February 2017 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Italy
Contact:

Re: Weekly heating programming

Post by Denny64 »

This is a milestone for Domoticz.

Thank you so much for jour excellent job.
syrhus
Posts: 79
Joined: Tuesday 12 December 2017 14:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Paris
Contact:

Re: Weekly heating programming

Post by syrhus »

Santa is coming! :D

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 :D
Attachments
planning.zip
(58.65 KiB) Downloaded 448 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest