[SOLVED]Automation and variable manipulation

Posted on
Tue Feb 04, 2014 3:52 am
orangy offline
Posts: 8
Joined: Feb 03, 2014

[SOLVED]Automation and variable manipulation

Hi,

I'm working through my first set of triggers, variables, and action groups and I miss some actions. Probably I just didn't find it, but here is what I'm missing:
* variable -> device
-- action to set on/off device state to boolean variable value
-- action to set dimmer value (or any other integer value) to variable value
* action to increase/decrease integer variable value by custom value, not by 1, optionally setting min/max.
* (fun) provide several different phrases to speak, when trigger is executing actions, select one randomly
* display condition in the trigger's list in a separate column

Posted on
Tue Feb 04, 2014 10:39 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Automation and variable manipulation

the following code will set the dimmer "NameOfYourLamp" to the value of your variable "testVariable"
Code: Select all
theVar = indigo.variables["testVariable"]
theValue = int(theVar.value)  # convert the string e.g. 55 to integer 55
indigo.dimmer.setBrightness("NameOfYourLamp", value= theValue)


in your action group or trigger Action section - you enter this into
Server action / script and File actions/execute script

check out the examples in the wiki sectionshttp://www.perceptiveautomation.com/wiki/doku.php?id=indigo_6_documentation:plugin_scripting_tutorial

Hope this helps

Karl
Attachments
set dimmer.tiff
set dimmer.tiff (111.79 KiB) Viewed 2381 times

Posted on
Tue Feb 04, 2014 8:18 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Automation and variable manipulation

orangy wrote:
* variable -> device
-- action to set on/off device state to boolean variable value
-- action to set dimmer value (or any other integer value) to variable value


Insert Device state into Variable

orangy wrote:
* action to increase/decrease integer variable value by custom value, not by 1, optionally setting min/max.


That can be done with a script.

orangy wrote:
* display condition in the trigger's list in a separate column


Not practical since conditions can be arbitrarily complex. Perhaps a simple indicator if there's a condition present.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest