Use a variable into rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Yves911
Normal user
Posts: 18
Joined: 21 May 2016, 17:38

Use a variable into rules

#1 Post by Yves911 » 02 Aug 2016, 13:31

Hi forum,

Is it possible to use variable into rules for example something like:

Code: Select all

on Elec#Count do
$tmp = 12
Publish /whatever/,[tmp]
done
$tmp = something doesn't work, any idea?

Yves911
Normal user
Posts: 18
Joined: 21 May 2016, 17:38

Re: Use a variable into rules

#2 Post by Yves911 » 02 Aug 2016, 18:45

Ok let me explain a bit more what i want to achieve here.
I am using the pulse counter to monitor my electricity consumption.
What i need to know is how many kWh have been consumed in one day.

My first idea was to use the Total variable provided by the pulse counter and reset it to 0 at the end of the day. This could be the ideal solution but i didn't managed to reset this value to 0.
So the plan B was to use a temporary variable that will be incremented each pulses and reset to 0 at the end of day.

i didn't manage to make plan A or B working, any idea?

Yves911
Normal user
Posts: 18
Joined: 21 May 2016, 17:38

Re: Use a variable into rules

#3 Post by Yves911 » 03 Aug 2016, 19:06


Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests