Feeds handling

An authenticated Realino-compliant control device can execute authorized requests to send feed data to the Realer platform. This feed data is used to inform users on Realer and for further processing.

Note: The feed data that a control device can send depends on the sensors and actuators attached to that device as registered on Realer.

Sending control feeds to Realer

cURL

              curl "https://www.therealer.com/control_devices/12345/feeds.realino" \
                -X PUT \
                -H 'Content-Type: application/json' \
                -H 'Authorization: Token b11db7f6c816568eb3b156df3aeaa5' \
                -d '{"sensors":[{"sensor_id":"1","value":"18.49"},{"sensor_id":"2","value":"5.59"}],"commands":[{"command_id":"1","value":"0"},{"command_id":"2","value":"1"}]}'
            
PUT /control_devices/{control_device_id}/feeds.realino

Send control feed and command data to Realer.

Request headers
Authorization
(required)

The authorization token to access resources on behalf of the control device. You get this at the time of authentication.

Type: String

Example: Token b11db7f6c816568eb3b156df3aeaa5

Request parameters
control_device_id
(required)

ID of control device that needs to feed data. You get this at the time of authentication.

Type: Integer

Example: 12345

sensors

The sensors feed data.

Type: JSON

Example: [{"sensor_id":"1", "value":"18.49"}, {"sensor_id":"2", "value":"5.59"}]

commands

The commands feed data.

Type: JSON

Example: [{"command_id":"1", "value":"0"}, {"command_id":"2", "value":"1"}]

Request body

Example value (application/json)


              {
                "sensors": [
                  {"sensor_id":"1", "value":"18.49"},
                  {"sensor_id":"2", "value":"5.59"}
                ],
                "commands": [
                  {"command_id":"1", "value":"0"},
                  {"command_id":"2", "value":"1"}
                ]
              }
            
If the control device does not transmit the command feed data (actuator status acknowledgments), indicating successful local execution of commands, the command will appear as "unconfirmed" in control panels on Realer.
Responses
Code Description
200

OK (Success)

Example value (application/json)


                        {
                          "success": "Data have been successfully updated."
                        }
                      
400

Bad Request (Client Error)

Example value (application/json)


                        {
                          "error": "Param is missing or the value is empty: control_devices_feeds"
                        }
                      
403

Forbidden (Client Error)

Example value (application/json)


                        {
                          "error": "You can not view the control device for the following reasons: the control device access token does not match."
                        }
                      

Example value (application/json)


                        {
                          "error": "You can not view the control device for the following reasons: the control device access token has expired."
                        }
                      

Example value (application/json)


                        {
                          "error": "You can not view the control device for the following reasons: the maximum number of accesses to the entity in a period has been reached (one access every 5 seconds is the maximum amount allowed)."
                        }
                      
Per utilizzare Realer dovresti abilitare i JavaScript nel tuo browser.