Enable / Disable all events in a switch planning alltogether
Moderators: leecollings, remb0
-
- Posts: 73
- Joined: Wednesday 16 September 2015 22:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Paris area, France
- Contact:
Enable / Disable all events in a switch planning alltogether
Hi,
It would be nice to have the possibility to enable or disable all events in a switch planning at once. Currently, one must activate or deactivate events one by one.
Example of possible usage :
- Disable all events for a heating device during the summer / enable them in the winter
- Disable the watering of my land when it rains
- Disable a switch when not in use (ex: my Christmas tree lights)
Or is there already a way to do this ?
Thank you to the developers of this superb software, anyway.
Oliviers
It would be nice to have the possibility to enable or disable all events in a switch planning at once. Currently, one must activate or deactivate events one by one.
Example of possible usage :
- Disable all events for a heating device during the summer / enable them in the winter
- Disable the watering of my land when it rains
- Disable a switch when not in use (ex: my Christmas tree lights)
Or is there already a way to do this ?
Thank you to the developers of this superb software, anyway.
Oliviers
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
Re: Enable / Disable all events in a switch planning alltoge
I use a bash-script to enable/disable timers via json.
Available methods are:
* enabletimer
* disabletimer
* enablescenetimer
* disablescenetimer
Use like:
http://<ip>:<port>/json.htm?type=command¶m=enabletimer&idx=<id>
Good luck!
Available methods are:
* enabletimer
* disabletimer
* enablescenetimer
* disablescenetimer
Use like:
http://<ip>:<port>/json.htm?type=command¶m=enabletimer&idx=<id>
Good luck!
-
- Posts: 550
- Joined: Tuesday 17 June 2014 22:14
- Target OS: NAS (Synology & others)
- Domoticz version: 4.10538
- Location: NL
- Contact:
Re: Enable / Disable all events in a switch planning alltoge
Possible other solutions
Make the actions temperature dependent using blocklyoliviers wrote: - Disable all events for a heating device during the summer / enable them in the winter
Measure soil moisture, or rain or retrieve rain from buienradaroliviers wrote: - Disable the watering of my land when it rains
Switch Christmastree based on date and time using blocklyoliviers wrote: - Disable a switch when not in use (ex: my Christmas tree lights)
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
-
- Posts: 73
- Joined: Wednesday 16 September 2015 22:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Paris area, France
- Contact:
Re: Enable / Disable all events in a switch planning alltoge
Mmmmm.....
Thanks for the suggestions, but it isn't that easy....
For example, I can't just rely of the ground moisture for watering my land.... Even if it is very dry, I may want to turn watering off because I know that rain is coming tomorrow, for example. Or because I don't want to let it run when I'm away (what if the valve doesn't switch off for some reason??)
There are other cases where I would just like to "disable" a switch and all related actions temporarily. Ex: Don't turn that light on (my Chistmas tree!) because I'm away from home for the weekend.
Furthermore, calculations in Blockry are somehow difficult and cumbersome.... Never been able to do something reliable and ended up writing a Lua script.
It would be easier to just have a check box "switch active or not", isn't it ??? Or scenario/scene active or not.
Oliviers
Thanks for the suggestions, but it isn't that easy....
For example, I can't just rely of the ground moisture for watering my land.... Even if it is very dry, I may want to turn watering off because I know that rain is coming tomorrow, for example. Or because I don't want to let it run when I'm away (what if the valve doesn't switch off for some reason??)
There are other cases where I would just like to "disable" a switch and all related actions temporarily. Ex: Don't turn that light on (my Chistmas tree!) because I'm away from home for the weekend.
Furthermore, calculations in Blockry are somehow difficult and cumbersome.... Never been able to do something reliable and ended up writing a Lua script.
It would be easier to just have a check box "switch active or not", isn't it ??? Or scenario/scene active or not.
Oliviers
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Enable / Disable all events in a switch planning alltoge
Just use some dummy switches. Easy and very reliable.
-
- Posts: 73
- Joined: Wednesday 16 September 2015 22:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Paris area, France
- Contact:
Re: Enable / Disable all events in a switch planning alltoge
Could you please elaborate a little bit ? How can I do that with a dummy switch ? And without having to write tens of Lua scripts ..?
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
- Egregius
- Posts: 2582
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: Enable / Disable all events in a switch planning alltoge
Well, you create a dummy switch and then use that status in blockly/lua/php/... to act on it.
Example:
Switch "Heating" -> If Heating == On set setpoint 20...
Switch "Rainexpected" -> If Rainexpected == Off switch watering on
If you want some more advanced stuff you'll have to code some blockly/lua/php scripts.
I handle EVERYTHING with one PHP file.
Example:
Switch "Heating" -> If Heating == On set setpoint 20...
Switch "Rainexpected" -> If Rainexpected == Off switch watering on
If you want some more advanced stuff you'll have to code some blockly/lua/php scripts.
I handle EVERYTHING with one PHP file.
-
- Posts: 625
- Joined: Thursday 02 October 2014 6:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.2
- Location: Geleen
- Contact:
Re: Enable / Disable all events in a switch planning alltoge
I use a dummy switch called Override. When I (or someone else) sets this to On, events are not handled anymore.
Every event has a check for this switch.
Comes in very usefull when I missed/made a program error or missed some special situation to prevent things from happening.
Or when the daily schedule is completely different because of some situation.
Every event has a check for this switch.
Comes in very usefull when I missed/made a program error or missed some special situation to prevent things from happening.
Or when the daily schedule is completely different because of some situation.
-
- Posts: 73
- Joined: Wednesday 16 September 2015 22:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Paris area, France
- Contact:
Re: Enable / Disable all events in a switch planning alltoge
OK, and thanks for your suggestions !
I agree with you that I can solve my problem by writing scripts. Although the scripts could be quite complex. For some of my switches, I have ten or more scheduled events which would all need to be activated or deactivated. It's not, like you wrote, Egregius, "switch watering off", but rather "Do not execute any of the twelve events that I have declared in the switch "planning" screen. Not the one scheduled at 20:00, not the one scheduled at 20:15, not the one scheduled at 20:30, .... and so forth.
So, back to my original suggestion: It would be nice to have a checkbox, in the switch configuration panel, which would globally enable or disable the switch and all its related events. Would be easier and more accessible for non-programmers than writing scripts, isn't it ???
Best regards,
Oliviers
I agree with you that I can solve my problem by writing scripts. Although the scripts could be quite complex. For some of my switches, I have ten or more scheduled events which would all need to be activated or deactivated. It's not, like you wrote, Egregius, "switch watering off", but rather "Do not execute any of the twelve events that I have declared in the switch "planning" screen. Not the one scheduled at 20:00, not the one scheduled at 20:15, not the one scheduled at 20:30, .... and so forth.
So, back to my original suggestion: It would be nice to have a checkbox, in the switch configuration panel, which would globally enable or disable the switch and all its related events. Would be easier and more accessible for non-programmers than writing scripts, isn't it ???
Best regards,
Oliviers
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
-
- Posts: 73
- Joined: Wednesday 16 September 2015 22:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Paris area, France
- Contact:
Re: Enable / Disable all events in a switch planning alltoge
Hi everybody,
Finally I found a solution to do this.... Update the switch configuration in the domoticz.db database directly.
1. I started by installing sqlite3 on my raspberry pi:
2. I wrote two bash scripts, one to turn all events from my real switch to "Active", the other one to turn them to "Inactive": (in this example, "Talus" is the name of my real switch)
and
3. I created a Virtual switch and assigned these two scripts to "Action On" and "Action off":
4. When that virtual switch is turned ON, all planning events of the real switch are activated:
....and they are deactivated when that virtual swith is set to OFF:
Looks like my "problem" is solved !
Best regards to all, and sorry for the screenshots in French!
Oliviers
Finally I found a solution to do this.... Update the switch configuration in the domoticz.db database directly.
1. I started by installing sqlite3 on my raspberry pi:
Code: Select all
sudo apt-get update
sudo apt-get install sqlite3
Code: Select all
#!/bin/bash
sqlite3 /home/pi/domoticz/domoticz.db 'update timers set active=1 where devicerowid in (select id from devicestatus where name = "Talus");'
Code: Select all
#!/bin/bash
sqlite3 /home/pi/domoticz/domoticz.db 'update timers set active=0 where devicerowid in (select id from devicestatus where name = "Talus");'
4. When that virtual switch is turned ON, all planning events of the real switch are activated:
....and they are deactivated when that virtual swith is set to OFF:
Looks like my "problem" is solved !
Best regards to all, and sorry for the screenshots in French!
Oliviers
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Enable / Disable all events in a switch planning alltogether
This does not work for SetPoint thermostat. I noticed that the javascript function is updateSetpointTimer, so I tried enablesetpointtimer and enabletimer as well, but it does not work. Any clue what would be the right method if any?I use a bash-script to enable/disable timers via json.
Available methods are:
* enabletimer
* disabletimer
* enablescenetimer
* disablescenetimer
Debian buster on NUC and three RPi with buster.
Re: Enable / Disable all events in a switch planning alltogether
I think it was not implemented. I will look into that...Number8 wrote:This does not work for SetPoint thermostat. I noticed that the javascript function is updateSetpointTimer, so I tried enablesetpointtimer and enabletimer as well, but it does not work. Any clue what would be the right method if any?I use a bash-script to enable/disable timers via json.
Available methods are:
* enabletimer
* disabletimer
* enablescenetimer
* disablescenetimer
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Enable / Disable all events in a switch planning alltogether
Great, thank you
Debian buster on NUC and three RPi with buster.
Re: Enable / Disable all events in a switch planning alltogether
ywNumber8 wrote:Great, thank you
PullRequest already commited: https://github.com/domoticz/domoticz/pull/600
Should be available in next beta.
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Enable / Disable all events in a switch planning alltogether
Thanks Eduard, I'll wait next beta, should'nt take that long
Shall I use enabletimer in the JSON request as for the switch timer or another keyword?
Cheers
Shall I use enabletimer in the JSON request as for the switch timer or another keyword?
Cheers
Debian buster on NUC and three RPi with buster.
Re: Enable / Disable all events in a switch planning alltogether
The available methods areNumber8 wrote: Shall I use enabletimer in the JSON request as for the switch timer or another keyword?
* enabletimer
* disabletimer
* enablescenetimer
* disablescenetimer
* enablesetpointtimer (*)
* disablesetpointtimer (*)
[EDIT] (*) Available in next beta
Re: Enable / Disable all events in a switch planning alltogether
New beta is availanle. Does it work?
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Enable / Disable all events in a switch planning alltogether
I just upgraded this early morning. Both functions work just great. Thanks Eduard.
Debian buster on NUC and three RPi with buster.
Re: Enable / Disable all events in a switch planning alltogether
Number8 wrote:I just upgraded this early morning. Both functions work just great. Thanks Eduard.
-
- Posts: 105
- Joined: Sunday 02 February 2014 23:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Portugal
- Contact:
Re: Enable / Disable all events in a switch planning alltogether
is the disablescenetimer/enablescenetimer working fine?
i cant get this working.
the status are fine but the timer dont change.
{
status: "OK",
title: "DisableSceneTimer"
}
thanks
i cant get this working.
the status are fine but the timer dont change.
{
status: "OK",
title: "DisableSceneTimer"
}
thanks
Who is online
Users browsing this forum: No registered users and 0 guests