If possible I would like to have a timer that checks if a variable is a 0 or 1. That way I can program several timers for e.g. hollidays
e.g: a schoolholiday the var vacation is set to 1
not a schoolvacation the var vacation is set to 0
So can make timers that check the var and act accordingly....
timer- variable dependancy
Moderators: leecollings, remb0
-
- Posts: 12
- Joined: Saturday 05 November 2016 7:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.5877
- Location: netherlands
- Contact:
-
- Posts: 138
- Joined: Thursday 01 May 2014 9:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands - Sittard
- Contact:
Re: timer- variable dependancy
Did you read the wiki?
If you define a user variable called "vacation", you can use that in a script / blockly. You can either directly call the uservariable in a script like so:
I always put the uservariables in local script variables, this makes the code more readable and easier to debug imho.
In a script you would first fill a script variable based on the user variable like:
vacation = uservariables["vacation"]
Then you can just do:
If you define a user variable called "vacation", you can use that in a script / blockly. You can either directly call the uservariable in a script like so:
Code: Select all
if ( uservariables["vacation"] == "1" ) then .....
In a script you would first fill a script variable based on the user variable like:
vacation = uservariables["vacation"]
Then you can just do:
Code: Select all
if (vacation == "1") then .....
Who is online
Users browsing this forum: No registered users and 1 guest