#How to feed gas data from api into the energy dashboard

1 messages · Page 1 of 1 (latest)

upbeat prawn
#

Hi, I've made a script that fetches my hourly gas consumption of the day before from my gas distributor website.
I now want to make that data available to the energy dashboard but I'm a bit lost.
I tried using the /api/states endpoint to insert the data in a custom sensor but I'm unable to set each datapoint to a specific timestamp, everything gets inserted at the current timestamp.

Does anyone could give me directions to achieve that please?
Thanks a lot in advance!

jovial anchor
#

Yeah you have to edit one .yaml to make it available at the dropdown menue

upbeat prawn
#

Hey @jovial anchor, could you please be more specific? I have no idea what you are referring to.

jovial anchor
#

You have to edit one file in /homeassistant/configuration.yaml there you have to add the sensor to make it available to select it in the Energy dropdown menue

#

here is an example from my electric meter

Loads default set of integrations. Do not remove.

default_config:

Load frontend themes from the themes folder

frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

template:

  • sensor:

    electric meter

    • name: "Stromzähler TR Verbrauch"
      unique_id: "TR_verbrauch"
      unit_of_measurement: 'kWh'
      device_class: "energy"
      state_class: "total_increasing"
      state: >-
      {{ float(states('sensor.tasmota_sml_total_in')) | round(3) }}
upbeat prawn
#

Yeah, I did that, that's not my issue.
The issue I have is that all data points are inserted at the current timestamp, I'm unable to insert them at the timestamp that would make sense.

For instance, the gas consumption from yesterday 11 AM should be inserted at that timestamp, not at the current timestamp.

jovial anchor
upbeat prawn
#

Thanks, I'll try that, however I will be unable to feed the cumulative sum since I don't have it

jovial anchor
#

What do you have? The difference?

upbeat prawn
#

Oh yeah, now I get it, I'll have that data for the whole day indeed

#

Thanks a lot, that should work!

#

I've been asking chatgpt for hours and you just copy / pasted our convo to get the perfect answer xD

#

Amazing

jovial anchor
#

Hahahahahah, no problem 🙂