Hello.
I would like to have a graphical history of my gas consumption, for now, I will manually add the entries in a JSON file, maybe in the future I’ll create some external service to get that data.
You can’t use .value. In a template, that is a reserved word that means “return all the raw value” (like value_json returns json encoded values). Use ['value'] instead, so:
I’ve changed the .value to [‘value’], then I restarted HA, stills without any data in the history chart.
I tried to change the field name “value” to “cubicMeters”, but same result…
Before it was unknown and now (with value_template: "{{ value }}") it’s 0, so… I think there’s something wrong reading the JSON ? maybe the date format ?
That’s not the template editor (Developer Tools → Templates) that’s your sensor. That will do but it’s a long way of testing it
I think the problem may be that your date is not enclosed in quotes in the square brackets. You can’t just add quotes or it will return that bit of the template literally ('now()…etc).