Skip to main content
1-Visitor
December 15, 2015
Solved

Data change on isConnected property

  • December 15, 2015
  • 5 replies
  • 2710 views

Hello All,

I have a remote thing where I would like to trigger a subscription every time my isConnected property changes.  However, when I subscribe to the data change of that property nothing happens because that property doesn't have any option selected for datachange.  I am unable to add the datachange because it is a system data shape.  Does anyone know of a way around this?  Could I make some sort of timer that just does a check every 15 minutes?  Thank you!

Best answer by paic

I just tested this and I see it firing when an EMS connects or disconnects.

Try a logger.warn(source + me.isConnected);

And check the script log to see if it is indeed firing upon connect or disconnect of the EMS.

I guess should also work for Federated Things.

5 replies

1-Visitor
December 15, 2015

Put the subscription on the Template. Any inheriting Templates will be able to carry a Subscription on DataChange for any of the inherited and/or defined properties.

byutz1-VisitorAuthor
1-Visitor
December 15, 2015

The issue is that it wont trigger on the property. The isConnected property is inherited from the remote thing template and I can not change when the event for a datachange is fired on it. I have it on the thing template, I just cant drive any events with it changing. 

paic1-VisitorAnswer
1-Visitor
December 15, 2015

I just tested this and I see it firing when an EMS connects or disconnects.

Try a logger.warn(source + me.isConnected);

And check the script log to see if it is indeed firing upon connect or disconnect of the EMS.

I guess should also work for Federated Things.