Page 1 of 1

Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 4:18 am
by pnm
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.

Re: Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 5:06 am
by DaveL17
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.

Re: Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 9:15 am
by jay (support)
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.

Re: Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 9:20 am
by pnm
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 1487 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

Re: Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 9:51 am
by jay (support)
You can do it in 2 by using Becomes Less Than 16...

Re: Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 9:55 am
by pnm
Thanks

Re: Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 10:04 am
by pnm
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 1463 times

Re: Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 10:16 am
by jay (support)
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.

Re: Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 11:44 am
by pnm
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"]

.

Re: Trigger action of Becomes Greater Than or Equal

PostPosted: Fri Mar 22, 2024 12:49 pm
by jay (support)
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).