There are 2 ways you can use the outbound, single device Valarm API:
- Latest – gives you however many of the most recent alerts you’d like or
- Query – allows you to specify begin and end dates for your sensor data as well as which sensors you would like the API feed to contain.
Format for the Latest API
https://tools.valarm.net/api/public/device/yourdeviceid/latest.json
Note: you can change the URL to end in .csv, .rss, or .kml to get those particular formats, e.g., http://tools.valarm.net/api/public/device/yourdeviceid/latest.rss . Also note that by default this returns the latest 10 Valarm alert events – same effect as setting the limit parameter equal to 10.
Optional parameters for Latest API
limit – this sets the maximum number of results returned by a query, if this parameter is not included in the URL then the default of 10 results will be returned. Also note that this limit is ignored if you specify a timestampSince. Example: https://tools.valarm.net/api/public/device/yourdeviceid/latest.json?limit=3
pretty – if set to true this will format your result so that it is more humanly readable with newlines and tabs. Example: https://tools.valarm.net/api/public/device/yourdeviceid/latest.json?pretty=true
timestampSince – will only return sensor data for this device since the date you specify. See example for date format: https://tools.valarm.net/api/public/device/yourdeviceid/latest.json?timestampSince=2015-01-14T08:00:00.000Z
callback – specifies a callback function name for use with JSONP. Example: https://tools.valarm.net/api/public/device/yourdeviceid/latest.json?callback=myCb
Note: use an & to separate multiple parameters in an API call. Example: https://tools.valarm.net/api/public/device/yourdeviceid/latest.json?pretty=true&tsSince=2015-01-06T08:00:00.000Z&callback=myCb&limit=5
Format for the Query API
https://tools.valarm.net/api/public/device/yourdeviceid/query.json
Note: you can change the URL to end in .csv, .rss, or .kml to get those particular formats, e.g., http://tools.valarm.net/api/public/device/yourdeviceid/query.rss . Also note that by default this returns the Valarm alert events since yesterday at midnight.
Optional parameters for Query API
limit – this sets the maximum number of results returned by a query, if this parameter is not included in the URL then the default of 10 results will be returned. Example: https://tools.valarm.net/api/public/device/yourdeviceid/latest.json?limit=3
pretty – if set to true this will format your result so that it is more humanly readable with newlines and tabs. Example: https://tools.valarm.net/api/public/device/yourdeviceid/latest.json?pretty=true
fromDate – returns sensor data for this device since the date you specify. Example for data since 22:45 (GMT/UTC) on January 1, 2015: https://tools.valarm.net/api/public/device/yourdeviceid/query.json?fromDate=2015-01-01%2022%3A45
toDate – return sensor data for this device up to the date you specify. Example for data up to 08:15 (GMT/UTC) on January 22, 2015: https://tools.valarm.net/api/public/device/yourdeviceid/query.json?&toDate=2015-01-22%2008%3A15
triggerType – returns only alerts for your specific Valarm trigger type, e.g., CLOCK for interval timer alerts. See full list further down this page. Example: http://tools.valarm.net/api/public/device/yourdeviceid/query.json?triggerType=CLOCK
trigger – returns only alerts for your specific Valarm sensor trigger, e.g., REL_HUM_MIN for a minimum humidity threshold alert. Example: http://tools.valarm.net/api/public/device/yourdeviceid/query.json?trigger=REL_HUM_MIN
callback – specifies a callback function name for use with JSONP. Example: https://tools.valarm.net/api/public/device/yourdeviceid/query.json?callback=myCb
Note: use an & to separate multiple parameters in an API call. Example: https://tools.valarm.net/api/public/device/yourdeviceid/query.json?pretty=true&fromDate=2015-01-08%2022%3A45&toDate=2015-01-22%2008%3A15&triggerType=ALERT_CLEAR&trigger=REL_HUM_MIN&callback=myCb&limit=7
Valarm Trigger Types
- ALERT_CLEAR
- SENSOR
- CLOCK
- LOCATION
- STREAM
- SYS_STAT
- OBD2
- MAN_LOCAL
- MAN_REMOTE
- API – API device alert like those from Yoctopuce Ethernet hubs or WiFi hubs
Valarm Sensor Triggers
- API_PUSH – Sensor data from API device like those from Yoctopuce Ethernet hubs or WiFi hubs
- ARMED
- DISARMED
- MOTION
- ACCEL
- MAX_VELO
- MIN_VELO
- DIST_FRM_ORIGN
- DIST_TO_TRGT
- AMB_LIGHT_MIN
- AMB_LIGHT_MAX
- AUDIO_PEAK
- AUDIO_AVG
- BATTERY
- INTERVAL
- SCHEDULER
- TMP_AMB_MIN
- TMP_AMB_MAX
- REL_HUM_MIN
- REL_HUM_MAX
- BAR_PRES_MIN
- BAR_PRES_MAX
- RPM_MAX
- SPEED_MAX
- TMP_COOLANT_MAX
- THROTTLE_MAX
- VOC_MAX
- VOC_MIN
- CO2_MAX
- CO2_MIN
- DRES01_MIN
- DRES02_MIN
- DRES03_MIN
- DRES04_MIN
- DRES05_MIN
- DRES01_MAX
- DRES02_MAX
- DRES03_MAX
- DRES04_MAX
- DRES05_MAX
- TMP01_MIN
- TMP02_MIN
- TMP03_MIN
- TMP04_MIN
- TMP05_MIN
- TMP06_MIN
- TMP07_MIN
- TMP08_MIN
- TMP01_MAX
- TMP02_MAX
- TMP03_MAX
- TMP04_MAX
- TMP05_MAX
- TMP06_MAX
- TMP07_MAX
- TMP08_MAX
- VOLT01_MIN
- VOLT02_MIN
- VOLT03_MIN
- VOLT04_MIN
- VOLT05_MIN
- VOLT06_MIN
- VOLT07_MIN
- VOLT08_MIN
- VOLT01_MAX
- VOLT02_MAX
- VOLT03_MAX
- VOLT04_MAX
- VOLT05_MAX
- VOLT06_MAX
- VOLT07_MAX
- VOLT08_MAX
- RX420MA01_MIN
- RX420MA02_MIN
- RX420MA03_MIN
- RX420MA04_MIN
- RX420MA01_MAX
- RX420MA02_MAX
- RX420MA03_MAX
- RX420MA04_MAX
- RX420MA01_ERRLOW
- RX420MA02_ERRLOW
- RX420MA03_ERRLOW
- RX420MA04_ERRLOW
- RX420MA01_ERRHIGH
- RX420MA02_ERRHIGH
- RX420MA03_ERRHIGH
- RX420MA04_ERRHIGH
- RAD01_MIN
- RAD01_MAX
- PMSM_MIN
- PMSM_MAX
- PMLG_MIN
- PMLG_MAX