Hi, here’s how to get all sensors data with just one API call.
Please also check the notes below.
rest:
- resource: https://api.pulsegrow.com/devices/{{YOUR-DEVICE-ID}}/recent-data
headers:
x-api-key: {{YOUR-API-KEY}}
sensor:
- unique_id: pulsepro_vpd
name: "PulsePro VPD"
icon: mdi:cloud-refresh
unit_of_measurement: 'kPa'
value_template: '{{ value_json["vpd"] | round(2) }}'
- unique_id: pulsepro_temperature
name: "PulsePro Temperature"
device_class: temperature
unit_of_measurement: '°C'
value_template: '{{ value_json["temperatureC"] | round(2) }}'
- unique_id: pulsepro_humidity
name: "PulsePro Humidity"
device_class: humidity
unit_of_measurement: '%'
value_template: '{{ value_json["humidityRh"] | round(2) }}'
- unique_id: pulsepro_light
name: "PulsePro Light"
icon: mdi:wall-sconce-flat
unit_of_measurement: '%'
value_template: '{{ value_json["lightLux"] | round(2) }}'
- unique_id: pulsepro_pressure
name: "PulsePro Pressure"
device_class: pressure
unit_of_measurement: 'hPa'
value_template: '{{ (value_json["airPressure"] / 100) | round(1) }}'
- unique_id: pulsepro_co2
name: "PulsePro CO2"
device_class: carbon_dioxide
unit_of_measurement: 'ppm'
value_template: '{{ value_json["co2"] }}'
- unique_id: pulsepro_dew_point
name: "PulsePro Dew Point"
icon: mdi:thermometer-water
unit_of_measurement: '°C'
value_template: '{{ value_json["dpC"] }}'
- unique_id: pulsepro_signal_strength
name: "PulsePro Signal Strength"
device_class: signal_strength
unit_of_measurement: 'dB'
value_template: '{{ value_json["signalStrength"] }}'
binary_sensor:
- unique_id: pulsepro_pluggedin
name: "PulsePro Plugged In"
icon: mdi:power-plug
value_template: '{{ value_json["pluggedIn"] }}'
Don’t forget to replace {{YOUR-DEVICE-ID}} and {{YOUR-API-KEY}} with actual values.
A few notes:
- i’m using celsius for temperature values, if you’re in the US you may want to switch from temperatureC (celsius) to temperatureF (fahrenheit) and from dpC (dew point) to dpF
- there are a few more values you can retrieve, please check the Device Recent Data API documentation for a complete list
- you can rename unique_id and name values as you wish, same for icon. I’ld recommend to leave the device_class as is. Check the Home Assistant RESTful Sensor and RESTful Binary Sensor docs for more info
- i’ve converted the airPressure value in hPa, because it’s common for other devices and weather integrations. Edit the formula if needed
- by default the Home Assistant RESTful integration pulls new data every 30 seconds. You can refresh more (or less) often by setting the scan_interval option. But be careful if you’re using a free tier API or you’ve multiple devices:
Hobbyist users can use up to 4800 datapoints daily, Enthusiasts and Professionals 24000 and 120000, respectively
20 seconds scan interval = 4320 API calls per day (ok with Hobbyist tier)
10 seconds scan interval (or 20 seconds scan interval for 2 devices) = 8640 calls per day (Enthusiasts needed)
…and so on. Just keep in mind that 1 day = 86400 seconds, and the API datapoints limits.