Skip to main content
1-Visitor
January 28, 2021
Solved

DataChange Problem with Subscription

  • January 28, 2021
  • 2 replies
  • 1928 views

Hi everyone,

 

I am sending Data (json) from an MQTT-Broker to a Property (Type: json) called "Sensor".

This is the Data I send:

{
"Temperatur": 20,
"Helligkeit": 75
}

Then I made a Subscription to store the two values of my Data into seperate properties called: "Temperatur" and "Helligkeit". (Type: Integer)

With the parameters:

Event: DataChange

Property: Sensor

and the Code:

me.Temperatur= me.Sensor.Temperatur;
me.Helligkeit= me.Sensor.Helligkeit;

 

Now to my problem:

Whenever I change the Data in the Property "Sensor" by hand in the Property itself, it works and the properties "Temperatur" and "Helligkeit" are updated.

 

But when the MQTT-Broker changes the Data in the "Sensor" property, the two other properties doesn't change. 

 

Why do my properties not change when the data change is done by the broker?

 

Thanks for any kind of help!

Best answer by smainente

This can be a permission issue (the MQTT entities are "running" as System user).

See https://www.ptc.com/en/support/article/CS270968

and https://www.ptc.com/en/support/article/CS275831

 

2 replies

16-Pearl
January 28, 2021

Try the steps provided in below article,

https://www.ptc.com/en/support/article/CS253296

smainente16-PearlAnswer
16-Pearl
January 29, 2021

This can be a permission issue (the MQTT entities are "running" as System user).

See https://www.ptc.com/en/support/article/CS270968

and https://www.ptc.com/en/support/article/CS275831

 

1-Visitor
January 29, 2021

Thanks, that helped!

 

Changing the  permission --> visibility to Everyone. was enough to make it work!

 

I also changed the runtime permission as mentioned in the article, but it wasn't necessary at my case. Maybe because I am logged in as Administrator?