API and Home Assistant config?

Thanks for that, I edited to reflect my config. The api docs also add the “” but works without on my end.

Are you able to get a call a response if you put this in terminal or command prompt?

curl --request GET https://api.pulsegrow.com/devices/insertdeviceid/recent-data --header x-api-key:insertapikey

1 Like

Yes, the system response with the pulse grow current environment information.

No worries, lets keep exlporing the way to make it works. Thanks.

just so it’s clear, the correct header is x-api-key

and here’s a sample CURL request

curl --request GET "https://api.pulsegrow.com/devices/ids" --header "x-api-key: ****************************"

some systems might use no quotes, some might use single quotes ', some might use double quotes "

I’m also working to integrate Pulse into HASS. Although I’m able to get curl responses with my api key and device id, the code for HASS is still giving “Unknown” status for sensors.

Would you post the entire YAML code you are using?

@puckett
in your config.yaml put this line in-

sensor: !include sensor.yaml

if you dont already have a sensor.yaml file, create one and then add-

- platform: rest
  resource: https://api.pulsegrow.com/devices/yourdeviceID/recent-data
  method: GET
  value_template: '{{ value_json["vpd"] }}'
  name: "Pulse Grow"
  scan_interval: 20
  headers: 
    x-api-key: yourAPIkey

Developer tools>check config>restart

Screenshot from 2022-09-21 15-59-06

That worked! I think my issue was somehow formatting related since I was using a sensor directory for my sensors.

1 Like

Hi, is the API service working? Since 12 hours ago I’m having a hard time getting data through the API, the server replies “{ Message = Unable to resolve service for type ‘PulseCore.CommonOptions.ElectricImpOptions’ while trying to activate ‘PulseCore.Business.Services.DeviceService’., StatusCode = 500 }%”.

1 Like

@Toma_Chan Hi there! Sorry for the belated reply.

Just incase - the public api has been working since Monday. We experienced some downtime during the weekend.

1 Like

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:

  1. 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
  2. there are a few more values you can retrieve, please check the Device Recent Data API documentation for a complete list
  3. 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
  4. i’ve converted the airPressure value in hPa, because it’s common for other devices and weather integrations. Edit the formula if needed
  5. 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.

1 Like

I copied this exactly into my configuration.yaml

I added my api key and device ID but when I add a sensor card on my dashboard it doesn’t display any values it just says “Unkown” . I created a sensor.yaml file and added this to test if it worked

  • platform: rest
    resource: https://api.pulsegrow.com/devices/yourdeviceID/recent-data
    method: GET
    value_template: ‘{{ value_json[“vpd”] }}’
    name: “Pulse Grow”
    scan_interval: 20
    headers:
    x-api-key: yourAPIkey
    I am able to create a card and VPD is displayed fine. I’m new to all of this so I’m sure it’s something I am doing wrong I’m just at a loss right now. Thanks

Mmh can you try creating a rest.yaml file, copy-paste my code starting from the 2nd line (- resource:).
Then add this line to configuration.yaml:
rest: !include rest.yaml

1 Like

Ok, I did that and the same thing happens. The card doesn’t display any values just “Unkown”

Ok, sorry, i don’t know what could be wrong. Do you see any error message in your logs?
Also, do you have a Pulse Pro or a Pulse One?

I got it working. Thanks

My API access quit working this morning without any changes to configuration. The Pulse device still shows data but even logging into the API area of the website gives:

" :frowning: Application Error
If you are the application administrator, you can access the diagnostic resources."

Anyone know what’s going on?

Hey! This might be an issue with some of our recent updates related to the API. I’ve given the engineering team a heads up and they’ll be looking into and getting this resolved ASAP!

Appreciate the heads up. Apologies for any inconvenience!

Thank you for the update!

Hello, the public API is back online now. The main app was not affected.

I’m sorry for the troubles and unexpected downtime.