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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Data change on isConnected property

byutz
1-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!

1 ACCEPTED SOLUTION

Accepted Solutions
paic
1-Newbie
(To:byutz)

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
paic
1-Newbie
(To:byutz)

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.

byutz
1-Newbie
(To:paic)

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. 

paic
1-Newbie
(To:byutz)

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.

byutz
1-Newbie
(To:paic)

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

byutz
1-Newbie
(To:paic)

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

Top Tags