I’m still strugling with YAML for cards configuration sometime, but it works very fine
That solves the first part of the daily consumption over a month,
Now i need to figure out the 1 bar over 9th to 9th, and be able to display 1 bar for each “month” over a year
Which leads to another question, which maybe does not belong here
Why apex-charts or History for my sensor does not display values past a couple of days ? maybe I did something wrong, because the data is here !!
If I am not mistaken you have to explicitly tell apexcharts-card to use statistics.
So, if you purge, then the only source of data is statistics, which apexcharts-card does not read by default.
I don’t understand what you mean with one bar per month. Sounds like you want the sum of all data or a mean value or something. Or is it one value or month that is being stored?
Check out the statistics part on the apexcharts-card github. Maybe the mean of month is what you are looking for?
Can anybody think of a way to make the source of data statistics in an apexcharts-card when the charted time is more than 2 weeks without breaking the card when it is less than two weeks?
statistics:
type: mean
period: hour
align: middle
I have not found a way to disable it by setting them to [] or nullwithout breaking the card.
I dug a bit yesterday, my knowledge on this subject was none.
And I don’t inderstand something.
Thanks to you I understand that apexchart do not use statistic that’s why I can’t see the daa befor 10 days, but as I understand by reading the dev page for the long term statistics, the history graph from HA should show the data, as my sensor have a state_class compatible with long term stat (total_increasing)
And I check in the database, data is present
Or am i missing something ?
Regarding the other question.
I have a sensor that gather ma gaz consumption in rea time
I have a daily utility meter to aggregate the dily consumption based on the real time sensor
I have a monthly utility meter based on the real time sensor, with 8 days offset
I want to be able to compare monthly gaz comsumption in a graph based on my billing period (the 9th of every month)
So I want a graph that shows 1 bar per billing period, from the 9th to the 8th of the next month, using my monthly utility meter
Is that clearer ?
Would be much easier if we could set a start date for the energy dashboard.
I will have a look at the statistic option, in fact I don’t think I would need short and long term at the same time.
In that example one line is the data from the “normal” database and one line is plotted from the statistics data.
I am working on a way to have the chart select which to use. The code itself is simple, but I have not yet found out how to “disable” statistics because it does not accept [] or null.
Anyway, no need to switch cards, you just need to specify the use of statistics (I recommend to plot both lines like I did and then play with the values for type, period and align to see which gives the most accurate representation.
I think the problem with your monthly value is that the monthly value is written to the database with a given date. So for HA this value is one single value in time.
But if you plot that value and e.g. plot 3 months, you should see 3 bars, each one month wide.
Problem, however, could be the date that value is stored.
So if your system writes the monthly value every month on the 9th, then you are golden. If it writes that value every month on e.g. the 15th, then your chart will need to be plotted 15 to 15, other wise you will have a value change/step/bar in between.
Are you plotting a chart_type: line or bar or what? I would think that a line/area with curve: stepline and might look more like what you are looking for.
I hope you understand what I mean.
curve: stepline
type: area #or line
chart_type: line
Careful, those are not the same indentation when you use them. I am just listing them.
That would be a plot of the daily (plotted as a stepline area), not monthly. Monthly is a single value, is it not?
P.s.: Looking at that graph I am surprised there are gaps in between the bars. Is there a 0 value in between?
If not, plot as area stepline. Then there will be no gap.
Is there a way to make the bar widths larger in this graph? It seems like they are quite skinny and there is quite a bit of white space between each day (there are 2 possible bars per day).
The values comment from a sensor that read real time gaz comsumption.
The daily value is a utility meter that adds up and reset everday so i can see the daily comsumption
The monthly is the same but reseted on the 9th.
Because my gaz provider bills me on the 9th each month
I’ll try the curve line to see how it goes.
But a daily plot will show me the daily value not the monthly.
The gap seems to be correct, I have one bar for october and one for november.
Edit:
I don’t see anyother option that take my monthly utility meter, which value is OK, and store it somewhere.
Or wait for the energy dashboard to include the start data feature long awaited
I got lots of cool ApexCharts included, many thanks for the card.
Most recently I am struggling with the y-axis in multi y-axis charts.
Concretely, it seems that the scaling does not adopt correctly nor the min max values are correct.
Maybe someone can spot the mistake that I have not been able to find?
In this example I use 3 y-axis, the green line shows a %-ratio (in the chart max point about +44%, lowest point about -77%, endpoint is -27%. It is assigned to the third axis, which is in the chart the axis to the very left.
The problem is that this y-axis shows value between 0 and 5!
(The areas show solar power production for a solar setup with west and east panels; the green line shows the ratio between both of them. I am hoping to use this ratio also for determining if there were a problem with little creatures nibbling on the solar cables, which should change the ratio between both solar panel strings…)
I got an apex card runing with a zigbee rainsensor. My issue is that the apexcard only get a new value when i rains. I would like to get a new value e.g. every 30 min if nothing has happened so the graph will get filed out. Any idea how I can do this?
so, I think I read through all of the thread again, searched for data_generator and divide entity.state, but am still in the dark… Please help me with what would probably be the silliest question…
trying to have the apex charts plot an entity with unit W(att)
- entity: sensor.netto_verbruik
yaxis_id: power
unit: W
Cosmetic question. Is there a way to get the dotted line and potentially the font a bit less pronounced? I like them there and font size etc is ok, but it’s very present and would especially the line be a bit more opaque.
Next to that. I’m struggling with the gradient. I would love that the green area was a gradient but if I add it the the card apex_config the bar does not show and if I add it to the series (as per code below), it does not do anything.