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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Datachange event in the subscription doesnt work when the value is zero in the value stream.

sbt
13-Aquamarine
13-Aquamarine

Datachange event in the subscription doesnt work when the value is zero in the value stream.

Hello Team,

I have a subscription for a datachange of the property, and whenever there is a data change i am performing certain function and when the value is zero i have to perform certain function.

The data is getting updated by the remote thing and i have a value stream assigned to the thing.

I dont have an issue when the data changes, but when the data for the property is flowing 0 always. the data change event is not getting triggered and i am not able to perform the required action when the value is 0.

 

Can someone help me and let me know how can i write an event for which every time the data comes to the value stream weather it is changed or not, i have to rise an event and use the same event for subscription.

 

Thanks,

Sunay 

12 REPLIES 12
PaiChung
22-Sapphire I
(To:sbt)

So the event fires based on the DataChange Setting

Value - Whenever the value changes

Always - Whenever the value is written (regardless if it is the same value)

Never - Never

On - Goes to True

Off - Goes to False

sbt
13-Aquamarine
13-Aquamarine
(To:PaiChung)

Hello PaiChung,

I have set the property datachange setting to "always" because of which i am able to log data to the value stream even though it is same.

But my problem lies in the subscription, where i have the option to set the event as Datachange for a property. But i don't have the option as always. Here if the data change happens, the subscription functionality is getting executed. If the value streaming is same then the subscription is not getting executed.

 

Thanks

Sunay

sbt
13-Aquamarine
13-Aquamarine
(To:sbt)

Hello PaiChung,

Do you have any thoughts on the this??? what could be the reason and how can we achieve it.

 

Thanks,

Sunay

PaiChung
22-Sapphire I
(To:sbt)

Logged and DataChange use the same DataChange aspect so they will always go hand in hand.

If you must have DataChange subscription to an Always then your logging will be always as well, if you don't want that then use your datachange subscription to detect if the VTQ is different (since it has old and new value it is easy to detect) and manually add the values to the stream vs. using the logged check box.

sbt
13-Aquamarine
13-Aquamarine
(To:PaiChung)

Hello PaiChung

I have the below configuration for remote thing

attachment: "Remote_Config.png"

 

and below is the configuration for local thing which is bound to remote thing.

attachment: "Local_Config.png"

 

and finally this was the configuration done for the subscription.

attachment: "subscription_config.png"

 

Is my configuration right ??

 

Thanks,

Sunay

sbt
13-Aquamarine
13-Aquamarine
(To:sbt)

Hello PaiChung,

Is my configuration right to the purpose what i have asked for. Request your thoughts on the same.

 

Thanks,

Sunay

PaiChung
22-Sapphire I
(To:sbt)

In what you are describing that you want I don't think there is a way to get

logged - on value change

event - on always

with the automated logging at least.

you can get always/always and accept redundant entries

or do all of it through the datachange event.

 

sbt
13-Aquamarine
13-Aquamarine
(To:PaiChung)

Hello PaiChung,

Sorry I didnt get your point.

I have set the local thing logged aspect to true and datachange type always.

For remote thing that is pushing value to local thing, I did not set the logged to true, is that i need to set it to true?? and the push type to always pushed?

Where will i find "event - on always" in the subscription. we only have Alert,AlertAck,AlertReset,AnomalyMonitorStatus etc but not always.

Can you please elaborate little more on what should be my configuration so that when the value is streaming on to the platform to a remotething irrespective of the value is changed or not changed i want to run the subscription whenever it logs.

 

Thanks 

Sunay

 

sbt
13-Aquamarine
13-Aquamarine
(To:sbt)

Hello Paichung,

I tried with the configuration but i didnt get the subscription firing up if the value streaming are same.

Thanks,

Sunay 

gespagne
5-Regular Member
(To:sbt)

Hello,

 

On your subscription, look if you didn't forget to check the box "Enabled". By default it's set to false, so even if your subscription is correctly made, nothing will happen.

 

Your property DataChange settings should be set on Always, and as far as i know i never had any issues with subscriptions on property changes.

 

Then in your subscription, as suggested before you can use the old value and new value to determine in which case you are (regarding case when your property equals 0).

 

Regards,

sbt
13-Aquamarine
13-Aquamarine
(To:gespagne)

Hello @gespagne

Is it possible to send a small snippet where you have a thing and every time i update a property with the same value i should be able to run the subscription and the same value has to be logged to a value stream.

I tried so many ways but could not achieve it, it would be of great help if you could help me on solving this issue.

 

Thanks,

Sunay 

gespagne
5-Regular Member
(To:sbt)

Hello @sbt,

 

I made a quick test again. I created a Thing and assigned it a ValueStream. I created a simple integer property on the Thing, and i set it to persistent and logged, with value changed set on Always.

I then created a subscription on the Thing, trigger by the DataChange of the property.

 

I attached the screenshots of the configuration, the result in the value stream and the log result of the subscription.

 

Hope it will help.

Top Tags