deviceUpdated - source of change?

Posted on
Tue Oct 16, 2018 8:31 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

deviceUpdated - source of change?

Is there anyway in the deviceUpdated method to determine the source of the update e.g. :
  • Z-Wave
  • Indigo UI
  • Indigo Touch
  • Plugin
  • etc
I presume Indigo must know where the change happened otherwise it wouldn't invoke the method?

An example: A thermostat setpoint can be altered via the Indigo UI or a user manually adjusting the physical thermostat

Thought I would check before I started adding some more complex logic to work it out. :wink:

Posted on
Wed Oct 17, 2018 3:23 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: deviceUpdated - source of change?

I think I’ve some logic on this somewhere.

I trigger on the incoming Zwave change to either mark a state or disable a trigger, can’t remember.

Then if deviceState also changes I know where from.

Something like that anyway. Can’t even think what I use it for or indeed if I still do!


Sent from my iPhone using Tapatalk Pro

Posted on
Wed Oct 17, 2018 3:50 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: deviceUpdated - source of change?

Indigo currently doesn't track through its information pipeline the origination of events/actions. This is definitely on the feature request list though, as it would be handy it lots of situations: plugins, scripts, smarter conditionals, etc.

Peter's technique (catching the earlier, originating message and tracking it manually yourself) could definitely work in specific or limited scenarios, so that might be something to explore depending on what you are trying to do.

Image

Posted on
Thu Oct 18, 2018 3:23 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: deviceUpdated - source of change?

Thanks for the answers :D

Looks like the more complex logic route then; I will monitor the Z-Wave as suggest by Peter and I know when the plugin asks for something to be done or is asked to do something (via an action), so otherwise must be via the UI. :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 10 guests