Arghhh, I’ve just spent hours trying to figure out how to display forecast data in an ApexCharts !!!
I got forecast data in different entities. No API unfortunately for my local forecast web service, so I have to scrape everything from the HTML page.
Le’ts say for example I have 3 entities : temperature_in_1h, temperature_in_2h, temperature_in_3h.
I can have according timestamps if I need it, no problem.
I’m trying to define a template including all my data as attributes to be able to use data_generator: with mapping function but I can’t find a way to achieve it
Whatever I try I can’t find a way to define a template to get an attribute like this for instance :
@Cata - How long are you keeping the data - there is a default purge of data in home assistant, which I think is set to 7 days. It only retains data for 7 days. You can set it longer.
Where does the sensor get the data from for kWh usage and cost ?
Your indenting is wrong here. It needs to be one level up. You also need to give the yaxis an id and apply that yaxis in the all_series_config parameter.
I’ve noticed something about configuring the yaxis in templates. You cannot define a yaxis in a template then define additional yaxis in a chart config. The yaxis in the chart completely overrides the template yaxis declaration even if the id’s are different. Is this a bug or just a limitation of using yaxis in a template?
Use case: I have a series of graphs, each graph has a percent based series along with one or more additional series. I cannot define a percent yaxis in a template then add additional yaxis for the other series in each chart configuration. The percent yaxis in the template gets overridden and therefore does not exist. So I have to define the percent yaxis in each graph.
It would be handy if the yaxis could be templated in this manner.
Or have I missed something here and this is indeed possible?
It’s sunday (dom) and bar is not where it should be (or maybe is the lavel the one wrong). Another thing is why xaxis don’t take the whole available width.
Edit:
Also values not calculated correctly.
I’m displaying a utility meter in bar chart with group_by day and func max. Trying with last instead of max, but it gives worse results
Hi! I love this graph card, there is only one thing that I am not able to do:
I have a column chart with only one series. I’ve defined a color_threshold and also, defined the colorized_states: true option.
Is there any chance to show the state with the same color than the current value of the serie defined in color_threshold?
For example: if the curren column is red, show the title in red.
Or at least being able to define a javascript function to calculate the color of the title?
Hi Enrico,
im italian too.
I am struggling with apex chert, i would like to have a graph (not bargraph but curve) showing solar production, consumed and sold energy.
Do you have some suggestions or yaml to share?
Thanks!!!
So… I’ve figured out enough about data_generator to solve my problem. Thanks again to @RomRider for the card. For those other newbies interested, I found two ways to set the state of a sensor to test / build from the basic data_generator examples (the weather.home & tides)
Use the Developer Tools > States tab to manually set the state & attributes of a sensor
It is a hack, but by using the python script in an automation that runs on startup, I’m able to load my rolled up monthly history of a few key variables into HA, so I can chart it along with the live 7 day data in my HA database. Here is a picture of some of the graphs produced.
looking for some guidance, creating my 2nd effort today to plot 2 y-axis’s without success so far…
first I trired mini-graph-card, but because I couldn’t get the secondary y-axis to be set correctly, here’s my first go at it using the apexcharts:
- type: custom:apexcharts-card
apex_config:
yaxis:
- id: sun
show: true
title: Sun
min: 0
max: 6000
- id: cloud
show: false
title: Cloud
min: 0
max: 100
span:
start: day
header:
show: true
title: Sun - Cloud
series:
- yaxis_id: sun
entity: sensor.zp_actuele_opbrengst
type: area
fill_raw: last
extend_to_end: false
color: gold
name: Sun
- yaxis_id: cloud
entity: sensor.weatherbit_cloud_coverage
type: line
# fill_raw: last
# extend_to_end: false
color: grey
name: Cloud
won’t show me my clouds, or even the scale for that matter: