Hi all -
I just wanted to chime in here. I just received my Hydroponics Kit from ThingSpeak and had configured it all to their specifications and calibrated everything then looked to see about implementing it into Home Assistant. I saw the MQTT topic but since I had already calibrated I didn’t want to re-wipe the chip and waste all of that so I was determined to get the API working and that led me here.
I usually don’t post questions and will dig around tirelessly until I find an answer so this topic had everything I needed except a lot of the answers seemed to have a lot of assumptions and I couldn’t put two and two together until I came to @Segdop’s post and saw the full context of the yaml needed. I was able to use what he put with some slight modifications as there was a couple of issues with it.
This is what I was able to put into my configuration.yaml where it worked beautifully for me. All you need to do is put your channel id and api key in the right spots:
sensor:
- platform: rest
name: Hydroponic Kit
json_attributes:
- field1
- field2
- field3
resource: https://api.thingspeak.com/channels/[CHANNEL ID]/feeds/last.json?api_key=[API KEY]
value_template: '{{ value_json.created_at }}'
- platform: template
sensors:
hydroponic_kit_temperature:
friendly_name: 'Temp'
value_template: '{{ state_attr("sensor.hydroponic_kit", "field3") }}'
unit_of_measurement: '°C'
hydroponic_kit_ph:
friendly_name: 'pH'
value_template: '{{ state_attr("sensor.hydroponic_kit", "field1") }}'
unit_of_measurement: 'pH'
hydroponic_kit_ec:
friendly_name: 'EC'
value_template: '{{ state_attr("sensor.hydroponic_kit", "field2") }}'
unit_of_measurement: 'µS/cm'
My tap water readings which yield the expected results:
Hopefully this helps someone.