How to create a dashboard virtual switch to disable/enable a saved blockly event?

Moderator: leecollings

Post Reply
edozwart
Posts: 10
Joined: Sunday 12 November 2017 20:27
Target OS: Windows
Domoticz version:
Contact:

How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by edozwart »

hi everybody!

merry christmas to everybody! Can you help me out? I am trying to create a virtual switch on my "switches" panel (via hardware/dummy switch) to disable/enable my saved blockly event, but I don't know how to. My goal is that my script is normally enabled, the lights will be off at night, but it can happen that I want them enabled so easily want to disable the script (with my phone for example).

Please let me know if you know how to handle this.

thanks!
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by Egregius »

Create a dummy switch and check it's status in your script.
Something like:
if(switch['dummy']=='On') AND ...
edozwart
Posts: 10
Joined: Sunday 12 November 2017 20:27
Target OS: Windows
Domoticz version:
Contact:

Re: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by edozwart »

hi Egregrius,

thanks for pointing me into the right direction! I can create that script using blockly for example but I don't know how to point to the saved event to disable that. Can you help me with that? Can that be done with blockly itself?

Thanks!
SweetPants

Re: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by SweetPants »

I'm not sure if this also counts for blockly events because I don't use that, but for LUA and dzVentz it works

/json.htm?type=events&param=updatestatus&eventid=21&eventstatus=0

use this JSON to get the list of events

/json.htm?type=events&param=list

edit: Should also work for Blockly
Last edited by SweetPants on Monday 25 December 2017 10:49, edited 2 times in total.
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by Egregius »

edozwart wrote: Monday 25 December 2017 9:09 hi Egregrius,

thanks for pointing me into the right direction! I can create that script using blockly for example but I don't know how to point to the saved event to disable that. Can you help me with that? Can that be done with blockly itself?

Thanks!
You don't disable your script, you just add another if statement so that the script is only executed when that switch is on.
edozwart
Posts: 10
Joined: Sunday 12 November 2017 20:27
Target OS: Windows
Domoticz version:
Contact:

Re: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by edozwart »

hi sweet and Egregius,

thanks for the quick advice and helping me out! I used the tip from Egregius, works like a charme, thank you very much! Hereby my blockly script, maybe also handy for other people:

thanks guys!
Attachments
Knipsel.PNG
Knipsel.PNG (45.34 KiB) Viewed 2119 times
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: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by Denny64 »

In the last pass I would do:

Else if Time > 22:01 and Living Lamp Ceiling (3) = ON
Set Living Lamp Ceiling (3) = OFF

This to have more precision on the switch log and avoid to send frequent and useless commands on the z-wave network.
edozwart
Posts: 10
Joined: Sunday 12 November 2017 20:27
Target OS: Windows
Domoticz version:
Contact:

Re: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by edozwart »

Thanks Denny64 for the tip, good point! I have updated my script!

love this forum!
SweetPants

Re: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by SweetPants »

Egregius wrote: Monday 25 December 2017 10:46
edozwart wrote: Monday 25 December 2017 9:09 hi Egregrius,

thanks for pointing me into the right direction! I can create that script using blockly for example but I don't know how to point to the saved event to disable that. Can you help me with that? Can that be done with blockly itself?

Thanks!
You don't disable your script, you just add another if statement so that the script is only executed when that switch is on.
Be aware, your script is still fired. If it is time based every minute
edozwart
Posts: 10
Joined: Sunday 12 November 2017 20:27
Target OS: Windows
Domoticz version:
Contact:

Re: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by edozwart »

hi! I know, I have ordered a dusk sensor to improve this and to avoid to use times.
matteos1
Posts: 36
Joined: Monday 08 May 2017 17:29
Target OS: -
Domoticz version:
Contact:

Re: How to create a dashboard virtual switch to disable/enable a saved blockly event?

Post by matteos1 »

googlecustomer wrote:For making this just click on this link
http://www.digitaljournal.com/pr/3600586
Spam???
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest