Differens between two variables?

Posted on
Thu Jan 03, 2019 5:29 am
Gusten offline
Posts: 171
Joined: Dec 30, 2015
Location: Sweden, Gothenburg

Differens between two variables?

Hi
I am trying to build a smarter floor heating, today i have standard thermostats and i have a concreet floor. The problem is that here in sweden we can have a big diffence between temperatur.
So if we have 10 degrese C for a week suddenly we can have -5 degrease, the i take time for the concreate floor to heat up and it gets cold inside.

So the idea is to take todays lowest temp and towmorows lowest temp, and if the differ to much i will start heating the floor in advace

To make this happen i wonder if there is a easy way using Python script to take variable A minus Variable B and insert the result in Variable C

Thanx

//Martin

Posted on
Thu Jan 03, 2019 6:38 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Differens between two variables?

Replace the variable ID values in this script with the appropriate IDs for your variables.

Code: Select all
variable_a = indigo.variables[1961258112].value
variable_b = indigo.variables[389753528].value
variable_c = indigo.variables[314742858]

diff = float(variable_a) - float(variable_b)

indigo.variable.updateValue(variable_c, str(diff))  # variable values must be stored as strings

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Jan 03, 2019 9:16 am
Gusten offline
Posts: 171
Joined: Dec 30, 2015
Location: Sweden, Gothenburg

Re: Differens between two variables?

Perfect

Thanx

Posted on
Thu Jan 03, 2019 5:01 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Differens between two variables?

Gusten wrote:
Perfect

Thanx

You are most welcome.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests