Relay control - id operation

Hi everyone,

I am currently using Cumulocity Free Trial and I want to generate and obtain the state of the RELAY CONTROL widget.

Although the operation is generated (as can be seen in the image), it is also observed that the ID changes with each new action on the Relay.
How could I know the current status of the operation if the ID is always changing?

I am doing the query under the following code:

GET https://env311076.us.cumulocity.com/devicecontrol/operations/(ID OPERATION)

Thank you all for your support in advance!

@Reiser_Anthony_Flores_Roca

You should query like , Get all the operations of a devices which have status as PENDING
Operation Query - {{url}}/devicecontrol/operations?status=PENDING&pageSize=20&source={{deviceId}}

Refer to this REST API for more details - https://www.cumulocity.com/api/core/#operation/getOperationCollectionResource

Hi Anthony,

operations just tell the device to execute something. In your case it would be to set the relay to a certain status (Hardware). Also the device has to set the fragment in the ManagedObject to persist to the current status.

You might also take a look at:

Kind Regards,

Marco

1 Like

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