Graph Display component to display data from HA

I would like to use the Graph component in order to display sensor data from HA.
For example to plot the temperature data from a weather.sensor for the coming days (or hours). Something like this:

I really have no idea if this can be done with the default graph component, as this is based on history data within esphome. In my use case I want to convert a number of datapoint into a graph.

Any ideas or suggestions?

Use a homeassistant component to get the data into esphome

sensor:
  - platform: homeassistant
    id: current_temperature
    entity_id: weather.sensor
    attribute: temperature
2 Likes

Should be fine I think once you’ve imported the sensors. Pretty sure ESPHOME will store the history required for the graph for you (in memory I guess).

Give it a go. Don’t expect the graphing experience to be slick. It’s pretty minimal.

1 Like

@nickrout & @Mahko_Mahko
Thanks for you suggestions. I know how to get HA data into esphome.
Your example will give me the current temperature and will plot (it’s history) into the graph.

I am looking to plot a custom set of data.
The weather.sensor has also some forecasting attributes

temperature: 21.4
temperature_unit: °C
forecast: 
- datetime: '2023-05-13T05:00:00+00:00'
  temperature: 23.1
- datetime: '2023-05-14T05:00:00+00:00'
  temperature: 22
- datetime: '2023-05-15T05:00:00+00:00'
  temperature: 19.3
- datetime: '2023-05-16T05:00:00+00:00'
  temperature: 14.1
- datetime: '2023-05-17T05:00:00+00:00'
  temperature: 13.6

This is basically the data I want to plot:
23.1 / 22 / 19.3 / 14.1 / 13.6

Which aspect of this are you seeking help for? Importing the data? Or configuring a graph?

Configuring a graph based on data imported via HA. Importing data from HA is not an issue .
Basically I want to be able to define my own x and y values. I don’t want to project history data from a specific sensor, but want to project custom data (like weather forecast temperatures)

1 Like

Not sure that what you want to do is possible without some c++ coding.

1 Like

You could probably “fake a bar chart or line chart” by drawing basic shapes.

1 Like

Thanks guys for your feedback. I guess I have to create something myself (custom C++ or work with basic shapes etc.)

1 Like

Would you be so kind as to share your C++ code, since this bargraph is something I personally also want to implement

Sorry, did not make it (yet)