Device attributes

Device attributes

You will need a {deviceId} from the Get devices request

Get device attributes

Gets a list of device attributes for the selected device. This is used to view the device's current configuration.

Request

GET
https://api.edenic.io/api/v1/device-attribute/{deviceId}

Query parameters

keys string optional

A comma-separated list of attribute keys e.g. setting.ph_low_alarm,setting.ph_high_alarm.

Response

200 OK - Example
[
  {
    "lastUpdateTs": 1689398954522,
    "key": "alarm.ph_low_alarm",
    "value": false
  },
  {
    "lastUpdateTs": 1681544811367,
    "key": "setting.device_name",
    "value": {
        "conflicts": [],
        "correlationId": "12345678-1234-1234-1234-123456789012",
        "originator": "APP",
        "status": "SUCCESS",
        "userId": "12345678-1234-1234-1234-123456789012",
        "value": "My Controller"
    }
  },
  ...
]

Response values

lastUpdateTs bigint

The time (in milliseconds since epoch) when the value was last updated.


key string

The key of the attribute.


value any

For alarms this is either true or false, but for settings it is a JSON object with a nested value.


value.conflicts Array<string>

Used for when the device has changes that conflict with server changes and will include the correlationId of the conflicting change.


value.correlationId string

A random UUID generated for the change. Used when conflicts occur.


value.originator string

Where the change originated.

Values: DEVICE or APP.


value.status string

Whether the change was completed successfully.

Values: SUCCESS, PENDING, FAILURE or CONFLICT.


value.userId string

The UUID of the user that made the change when the originator is APP.


value.value any

The value of the setting. See Available attributes for the expected type.

Update device attributes

Updates a list of device attributes for the selected device. This is used to request an update to the device's configuration.

⚠️

Attribute changes will not be seen straight away in the GET request as the change has to be lined up with the device

Request

PATCH
https://api.edenic.io/api/v1/device-attribute/{deviceId}

Body

Attributes have strict validation for their values and some may need to be sent with other attributes. Multiple attributes can be updated at once, but all need to be valid before any are applied.

The body expects JSON format. The request will have to include the Content-Type: application/json header.

JSON body
{
  "setting.required_ph": 6.0,
  "setting.ph_low_alarm": 5.0,
  "setting.ph_high_alarm": 7.0
}

Available attributes

Available attributes for each device and the validation for each one is listed below. Only setting attributes can be updated but all these attributes can be read.

To understand more about these attribute, see Definitions.

⚠️

Mutually validated attributes must always be updated together, e.g. setting.x_low_alarm, setting.x_high_alarm and setting.required_x

Pro Controller

Attribute nameTypeValidationExample
alarm.ineffective_control_lockoutbooleanNot editable-
alarm.pod_change_lockoutbooleanNot editable-
alarm.normally_closed_lockoutbooleanNot editable-
alarm.normally_open_lockoutbooleanNot editable-
alarm.low_ec_lockoutbooleanNot editable-
alarm.other_lockoutbooleanNot editable-
alarm.calibration_requiredbooleanNot editable-
alarm.ph_high_alarmbooleanNot editable-
alarm.ph_low_alarmbooleanNot editable-
alarm.ec_high_alarmbooleanNot editable-
alarm.ec_low_alarmbooleanNot editable-
alarm.temp_high_alarmbooleanNot editable-
alarm.temp_low_alarmbooleanNot editable-
setting.device_namestring20 character limit"My Controller"
setting.alarmsbooleanOn = true
Off = false
false
setting.control_mode (edit)
setting.device_mode (read)
string"MONITOR" or "CONTROL""MONITOR"
setting.ineffective_control_lockoutbooleanOn = true
Off = false
true
setting.low_conductivity_lockoutbooleanOn = true
Off = false
true
setting.required_phnumberResolution: 1 dp
Range: 0.1 - 13.9
6.0
setting.ph_low_alarmnumberResolution: 1 dp
Range: 0.0 - 13.8
Must be 0.1 below "setting.required_ph"
5.0
setting.ph_high_alarmnumberResolution: 1 dp
Range 0.2 - 14.0
Must be 0.1 above "setting.required_ph"
7.0
setting.ph_on_timenumberContinuous = 0
Resolution: 1000 (ms)
Range: 1000 - 600000 (ms)
10000
setting.ph_off_timenumberResolution: 10000
Range: 10000 - 3600000 (ms)
100000
setting.required_ecnumberResolution: 1 dp
Range: 0.1 - 4.9
2.0
setting.ec_low_alarmnumberResolution: 1 dp
Range: 0.0 - 4.8
Must be 0.1 below "setting.required_ec"
1.0
setting.ec_high_alarmnumberResolution: 1 dp
Range: 0.2 - 5.0
Must be 0.1 above "setting.required_ec"
3.0
setting.ec_on_timenumberContinuous = 0
Resolution: 1000 (ms)
Range: 1000 - 600000 (ms)
10000
setting.ec_off_timenumberResolution: 10000
Range: 10000 - 3600000 (ms)
100000
setting.minimum_tempnumberResolution: 0 dp
Range: 1 - 48 (Celsius)
Must be below "setting.maximum_temp"
18
setting.maximum_tempnumberResolution: 0 dp
Range: 2 - 49 (Celsius)
Must be above "setting.minimum_temp"
22
setting.temp_low_alarmnumberResolution: 0 dp
Range: 0 - 47 (Celsius)
Must be below "setting.minimum_temp"
16
setting.temp_high_alarmnumberResolution: 0 dp
Range: 3 - 50 (Celsius)
Must be above "setting.maximum_temp"
24
setting.temp_on_timenumberContinuous = 0
Resolution: 1000 (ms)
Range: 1000 - 600000 (ms)
10000
setting.temp_off_timenumberResolution: 10000
Range 10000 - 3600000 (ms)
100000

pH Controller

Attribute nameTypeValidationExample
alarm.ineffective_control_lockoutbooleanNot editable-
alarm.calibration_requiredbooleanNot editable-
alarm.ph_high_alarmbooleanNot editable-
alarm.ph_low_alarmbooleanNot editable-
alarm.temp_high_alarmbooleanNot editable-
alarm.temp_low_alarmbooleanNot editable-
setting.device_namestring20 character limit"My Controller"
setting.alarmsbooleanOn = true
Off = false
false
setting.control_mode (edit)
setting.device_mode (read)
string"MONITOR" or "CONTROL""MONITOR"
setting.required_phnumberResolution: 1 dp
Range: 0.1 - 13.9
6.0
setting.ph_low_alarmnumberResolution: 1 dp
Range: 0.0 - 13.8
Must be 0.1 below "setting.required_ph"
5.0
setting.ph_high_alarmnumberResolution: 1 dp
Range: 0.2 - 14.0
Must be 0.1 above "setting.required_ph"
7.0
setting.ph_on_timenumberResolution: 1000
Range: 1000 - 60000 (ms)
10000
setting.ph_off_timenumberResolution: 60000
Range: 60000 - 3600000 (ms)
240000

Guardian (Connect)

Attribute nameTypeValidationExample
alarm.calibration_requiredbooleanNot editable-
alarm.ph_high_alarmbooleanNot editable-
alarm.ph_low_alarmbooleanNot editable-
alarm.ec_high_alarmbooleanNot editable-
alarm.ec_low_alarmbooleanNot editable-
alarm.temp_high_alarmbooleanNot editable-
alarm.temp_low_alarmbooleanNot editable-
setting.device_namestring20 character limit"My Monitor"

Guardian Wi-Fi

Attribute nameTypeValidationExample
alarm.calibration_requiredbooleanNot editable-
alarm.ph_high_alarmbooleanNot editable-
alarm.ph_low_alarmbooleanNot editable-
alarm.ec_high_alarmbooleanNot editable-
alarm.ec_low_alarmbooleanNot editable-
alarm.temp_high_alarmbooleanNot editable-
alarm.temp_low_alarmbooleanNot editable-
setting.device_namestring20 character limit"My Monitor"
setting.alarmsbooleanOn = true
Off = false
true
setting.ph_low_alarmnumberResolution: 1 dp
Range: 0.0 - 13.8
Must be 0.2 below "setting.ph_high_alarm"
5.0
setting.ph_high_alarmnumberResolution: 1 dp
Range: 0.2 - 14.0
Must be 0.2 above "setting.ph_low_alarm"
7.0
setting.ec_low_alarmnumberResolution: 1 dp
Range: 0.0 - 4.8
Must be 0.2 below "setting.ec_high_alarm"
1.0
setting.ec_high_alarmnumberResolution: 1 dp
Range: 0.2 - 5.0
Must be 0.2 above "setting.ec_low_alarm"
3.0
setting.temp_low_alarmnumberResolution: 0 dp
Range: 0 - 47
Must be below "setting.temp_high_alarm"
15
setting.temp_high_alarmNumberResolution: 0 dp
Range: 3 - 50
Must be above "setting.temp_low_alarm"
25

Response

You will get a 200 OK response if the attribute updates successfully.

The request will return an error if it fails to update the attributes:

400 Bad Request - Example
{
  "error": "Validation error",
  "issues": {
      "setting.ph_low_alarm": [
        "Value must be a number",
        ...
      ],
      ...
    },
  }
}

Example

Here is an example request to update the pH alarms of a Pro Controller using cURL.

cURL example
curl --include --request PATCH https://api.edenic.io/api/v1/device-attribute/12345678-1234-1234-1234-123456789012 \
  --header 'Authorization: ed_1234567890123456789012345789012345678901234567890123456789012345' \
  --header 'Content-Type: application/json' \
  --data '{
    "setting.required_ph": 6.0,
    "setting.ph_low_alarm": 5.0,
    "setting.ph_high_alarm": 7.0
  }'

Response should give a 200 OK result if successful.