Trigger action of Becomes Greater Than or Equal

Posted on
Fri Mar 22, 2024 4:18 am
pnm offline
Posts: 56
Joined: Dec 03, 2014
Location: Yorkshire, UK

Trigger action of Becomes Greater Than or Equal

At the moment, if you want an action based on a specific number e.g. set a true/false variable if the temperature is above 15C, you need three triggers, one for greater than, one for less than and one for equal. Having a greater than or equal and a less than or equal would solve this.

Posted on
Fri Mar 22, 2024 5:06 am
DaveL17 offline
User avatar
Posts: 6759
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Trigger action of Becomes Greater Than or Equal

Based on your example, I'm not sure I understand. Regardless, I'd suggest doing all this with one trigger using a Python conditional.

I'd be happy to help you write one.

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

[My Plugins] - [My Forums]

Posted on
Fri Mar 22, 2024 9:15 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Trigger action of Becomes Greater Than or Equal

pnm wrote:
At the moment, if you want an action based on a specific number e.g. set a true/false variable if the temperature is above 15C, you need three triggers, one for greater than, one for less than and one for equal. Having a greater than or equal and a less than or equal would solve this.


I think you only need 2: one with a condition of greater than 14 (which will include 15 and above) and one less than 15 (which will catch everything 14 and below). Right?

In any event, as@ DaveL17 suggests a simple Python script would probably be best with just a single trigger.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Mar 22, 2024 9:20 am
pnm offline
Posts: 56
Joined: Dec 03, 2014
Location: Yorkshire, UK

Re: Trigger action of Becomes Greater Than or Equal

It was this part of the GUI I was referring to:

Screenshot 2024-03-22 151517.png
Screenshot 2024-03-22 151517.png (16.35 KiB) Viewed 611 times


So I want the variable true if over 15 or false if 15 or less. A Becomes Less Than or Equal would mean I just need two triggers

Posted on
Fri Mar 22, 2024 9:51 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Trigger action of Becomes Greater Than or Equal

You can do it in 2 by using Becomes Less Than 16...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Mar 22, 2024 9:55 am
pnm offline
Posts: 56
Joined: Dec 03, 2014
Location: Yorkshire, UK

Re: Trigger action of Becomes Greater Than or Equal

Thanks

Posted on
Fri Mar 22, 2024 10:04 am
pnm offline
Posts: 56
Joined: Dec 03, 2014
Location: Yorkshire, UK

Re: Trigger action of Becomes Greater Than or Equal

As an aside, I was using a trigger as I couldn't work out the syntax to get the value from the device using indigo.devices["System..Weather.ForecastToday"], this is the structure

Screenshot 2024-03-22 155907.png
Screenshot 2024-03-22 155907.png (46.7 KiB) Viewed 587 times

Posted on
Fri Mar 22, 2024 10:16 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Trigger action of Becomes Greater Than or Equal

Right-click on the device and select Print Device Details to Event Log. Then copy/paste the text (not a picture) from the Event Log into a reply and we can figure out how to get the value out in a script.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Mar 22, 2024 11:44 am
pnm offline
Posts: 56
Joined: Dec 03, 2014
Location: Yorkshire, UK

Re: Trigger action of Becomes Greater Than or Equal

Thanks for your help, I've got the answer from another post, I'd missed the second set of brackets so it should be:

indigo.devices["System,Weather.ForecastToday"].states["tempmax"]

.

Posted on
Fri Mar 22, 2024 12:49 pm
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Trigger action of Becomes Greater Than or Equal

You should use the ID of the device, not the name, in case you change the name in the future (the ID will never change).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 8 guests