Acknowledge via MQTT issue

Acknowledgement issue via MQTT

Product/components used and version/fix level:

Raspberry pi with thin-edge, java code for interacting Raspberry with Cumulocity.

Detailed explanation of the problem:

I am using java to process request sent or received between raspberry pi and cumulocity.
I am using “relay control” widget to control my raspberry pi. When I am sending acknowledgement in “persistent” mode, the status is only changing in real-time not in “cumulocity database”. But according to persistent mode, status should be updated in both real-time and cumulocity databse.

Acknowledgement code is shown below:

client.publish(“c8y/s/us”, “503,c8y_Relay,relayState:OPEN”.getBytes(), 2, false);

Please let me know if I am making some mistake in sending acknowledgement in persistent mode.

Error messages / full error message screenshot / log file:

Question related to a free trial, or to a production (customer) instance?

The 503 static template does not support implicit status for the single relay operation (see: #503 template + Updating operations). It only supports implicit status setting for the c8y_RelayArray operation.

If you want to continue with the single relay widget and operation the you’ll have to set the status of your relay in the device managed object yourself. We have a preview of future documentation about how to do this available here: Single relay - preview

Instead you could also use the relay array widget and operation. Then you could communicate this status implicitly in the message with the 503 template. The same preview documentation also contains a section about relay array: Relay array - preview

1 Like

Can 518 static template work to update the status in “cumulocity database” in case of single relay? Actually I have tried using 518 template but that too did not worked. Any idea why 518 did not worked?

[518,serial,relayStatusToBeSet [OPEN/CLOSED]]

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.