cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Data change on isConnected property

SOLVED
Highlighted
Newbie

Data change on isConnected property

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!

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Data change on isConnected property

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.

View solution in original post

5 REPLIES 5

Re: Data change on isConnected property

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.

Re: Data change on isConnected property

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. 

Re: Data change on isConnected property

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.

View solution in original post

Re: Data change on isConnected property

Thank you for the suggestion!  I will give it a try and see if it works for me.

Re: Data change on isConnected property

It works now. I guess I just needed to close out of everything.  Thanks again for the help!