Python code to determine if it is Touch/App/Server/webserver

Posted on
Wed Sep 01, 2021 3:31 am
Lalit offline
Posts: 71
Joined: Jul 05, 2006
Location: Paris (France)

Python code to determine if it is Touch/App/Server/webserver

Hi,

I would like to know by which « system » (touch/app/server/webserver) a device/schedule/trigger/action is executed.
My notifications (sms/e-mail) would be more pertinent and precise.

If it's possible, what is the Python syntax?

Thanks.

Posted on
Wed Sep 01, 2021 4:30 am
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Python code to determine if it is Touch/App/Server/webse

Schedules and triggers are always initiated by the Indigo server. Action Groups could be initiated by anything. There's no way to tell what.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Sep 01, 2021 11:17 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Python code to determine if it is Touch/App/Server/webse

Joe is correct, but I wanted to comment that adding the plumbing needed for better tracking of execution origination is definitely on my request / ToDo list.

Image

Posted on
Wed Sep 01, 2021 12:11 pm
FlyingDiver offline
User avatar
Posts: 7221
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Python code to determine if it is Touch/App/Server/webse

That said, if you can give us an example of what you're trying to do, there might be some solutions. For example, if you're executing the same action group from the Indigo client AND from the control page, you could have the action first set a variable, THEN execute the action group which uses the contents of the variable in some way.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Sep 01, 2021 4:42 pm
Lalit offline
Posts: 71
Joined: Jul 05, 2006
Location: Paris (France)

Re: Python code to determine if it is Touch/App/Server/webse

matt (support) wrote:
...adding the plumbing needed for better tracking of execution origination is definitely on my request / ToDo list.

Cool, this is exactly what I'm looking for.
But as it's on the ToDo list we don't know when it will be available.
Just have to be patient as you have a lot of things to deal with.

Thanks Matt for your answer!

Posted on
Wed Sep 01, 2021 5:04 pm
Lalit offline
Posts: 71
Joined: Jul 05, 2006
Location: Paris (France)

Re: Python code to determine if it is Touch/App/Server/webse

FlyingDiver wrote:
That said, if you can give us an example of what you're trying to do, there might be some solutions. For example, if you're executing the same action group from the Indigo client AND from the control page, you could have the action first set a variable, THEN execute the action group which uses the contents of the variable in some way.

I have a keypad to arm/disarm my alarm linked with a Fibaro Smart Implant (FGBS-222) which trigger a script.
I also use Indigo Touch (action) to arm/disarm.
Each time the alarm is armed/disarmed, I have a notification on my phone.
That's why I want to know if it has been fired from the keypad or by an iPhone.
You're right Joe, in fact it's so obvious, I just have to use a variable (ie: 'touch' or 'keypad') then I could customize the notification.

Thanks again Joe for putting me on the right track!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests

cron