Hi
I maintain a spreadsheet on google drive where I record honey harvested from my beehives.
What I want is to simply display the value of one cell (cumulative weight) in my Home Assistant (alongside graphs of temp data etc which Ive got working OK).
So I set up the Google Sheets API to allow access to the data and added a sensor to my config file:
sensor:
- platform: rest
resource: https://sheets.googleapis.com/v4/spreadsheets/spreadsheetID/values/B4?key=APIkey'
method: GET
name: "Cumulative Weight"
value_template: '{{value_json["values"] [0] | int }}'
scan_interval: 86400
All good, Cumulative Weight shows up as an entity, but the value is always returned as ‘Unknown’.
When I check the output of the API Monitor in the template editor I get the following:
Result type:List
[
“1”
]
I suspect this is the problem: the results are being returned as a list for some reason.
I’m not sure if this is a problem with HA, or with the way the API is returning results, but any and all help gratefully received
(If I can this working, I’d also like to plot the time-series data for honey collection, but thats another problem!)
Lee