Global variables in rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
kopetnik
New user
Posts: 1
Joined: 13 Jun 2016, 23:50

Global variables in rules

#1 Post by kopetnik » 14 Jun 2016, 00:05

Is there any possibility to use global variables or equivalent in rules?

Let's say I want to create some thermostat logic using rules, now I have something like:

Code: Select all

  if [DS#Temperature]>18
    gpio,5,1
  else
    gpio,5,0
  endif  
What if I want to be able to setup or change this temperature threshold (here 18) externally eg. via HTTP or MQTT?
Something like:

Code: Select all

  
On System#Boot do
var,T1,18
...  
if [DS#Temperature]>[Var#T1] 
Any idea how to accomplish it with existing code?

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 119 guests