Hi all, I just created a few graphs to compare local measured temp with forecasted figures
When I put them both in one graph it shows inconsistent state values.
This because the state value of a datagenerator is linked to the last value of the series
With the graph below I would like to see
the last value of the local sensor …i.e. this is as-is
the first value of the forecast sensors… you can clearly see they are incorrect, as the forecasted last values are in 5 days from now.
Is there any way to improve on this without needing two new template sensors?
Sure, here is the full card that I’m using now, which combines the data from buienradar and buienalarm, bundled together with the 3 hour forecast using openweathermap.
Additional cards are vertical-stack-in-card and card-mod to tie it all together.
I have two sensors:
sensor.hvac_cooling_daily = total time HVAC is cooling per day
sensor.hvac_fan_on_daily = total time HVAC Fan is on per day
I want to plot a graph that show both measurements in a stacked bar graph.
Problem is that sensor.hvac_fan_on_daily stores the total time the fan is on (cooling + fan only).
So, I need: sensor.hvac_fan_on_daily - sensor.hvac_cooling_daily but I don’t want to create another sensor.
For the Fan on series I tried:
transform: return parseFloat(x) - parseFloat(hass.states['sensor.hvac_cooling_daily'].state);
group_by:
func: last
duration: 1d
But it is seems to be working correctly just for the current day. What am I doing wrong here?
As I am using longterm statistics, it would be very interesting for me to dynamically define an offset. So I am able to show this graph for a specific date in history.
Date selector: maybe using a date picker helper to define the specific date and then calculate the offset.
< & > button to higher or lower the offset.
Toolbar configuration: is there something available in the toolbar?
Well it seems I totally missed that one . This is exactly what I had in mind . I see you also use the Tabbed Card for Daily / Weekly / Monthly / Actual. This was also something I was thinking of. This gives you endless possibilities to see your Energy statistics
Mind sharing your total config (inl the tabbed card)?
Thx!
@RomRider, loving the card! Just got started with some charts but the features are almost endless.
I have run into a weird problem though and will try to explain it as clear as possible.
First off I used the raw data, but this didn’t let me few all datapoint into the same tooltip which made the tooltip jump around while scrolling through the chart:
Then it works how I wanted BUT for just a bit. When I refresh the page once it’s all bugged and doesn’t fix itself anymore. You can also see the lines being cut off on the left side.
And even weirder, when I enter ‘edit mode’ again it’s all working but just in edit mode. Refreshing the page doesn’t break the chart within edit mode. When I leave edit mode again it’s all bugged like before:
Edit mode disables the internal data caching of apexcharts-card. So maybe there’s a bug with that. I’d need to check the code (that part is quite a mess ).
Try forcing disabling cache on this card with cache: false. It might be a bit slower, though…
I’m trying to add an attribute from a portable midea duo heatpump ac unit - it can read the outdoor temp, so im trying to add it to a card with a bunch of temps, but I’m not sure how to add an entities attribute, and conver that to farenheit. has anybody tried that yet?
I am trying to get past and present data from Octopus Agile electricity pricing entity integration
At the moment I can either get historic data up to ‘now’ or future data (which strangely includes from midnight i.e. a little but of history) using data_generator
What I want is the previous days, current days and next days data (when available) to be shown.
The current data_generator I have only does data from midnight today and future:
Hoping someone can help me out here. I’m fairly new to HA and the apexcharts-card.
Doing a line chart and for some reason I am getting an extra line connecting from the start of the data to “today” see screenshot:
Here is my YAML:
type: custom:apexcharts-card
header:
title: King County COVID Wastewater
show: true
colorize_states: true
chart_type: line
graph_span: 1.2y
span:
end: day
offset: '-2d'
series:
- entity: sensor.covid_wastewater_1142
name: shed 1142
data_generator: |
var filtered_data = entity.attributes.data.filter(function(record) {
return 'pcr_conc_smoothed' in record;
});
var filtered_map = filtered_data.map(record => {
return [new Date(record.date).getTime(), record.pcr_conc_smoothed/1000000];
});
return filtered_map;
unit: vvp
color: red
group_by:
fill: last
duration: 5d
- entity: sensor.covid_wastewater_1139
name: shed 1139
data_generator: |
var filtered_data = entity.attributes.data.filter(function(record) {
return 'pcr_conc_smoothed' in record;
});
var filtered_map = filtered_data.map(record => {
return [new Date(record.date).getTime(), record.pcr_conc_smoothed/1000000];
});
return filtered_map;
unit: vpp
color: yellow
group_by:
fill: last
duration: 5d
- entity: sensor.covid_wastewater_676
name: shed 676
data_generator: |
var filtered_data = entity.attributes.data.filter(function(record) {
return 'pcr_conc_smoothed' in record;
});
var filtered_map = filtered_data.map(record => {
return [new Date(record.date).getTime(), record.pcr_conc_smoothed/1000000];
});
return filtered_map;
unit: vvp
color: blue
group_by:
fill: last
duration: 5d
I took a little code from @Mattias_Persson and created this. It shows the current solar input correctly. But seems that a full radial would be 100W. What do I need to change to have the value of a full circle be e.g. 250W?
I see the docs say the hass object is available in the transform and data generator sections, but I’m looking to use it in the formatter for my data labels.
I’m referring to this where I’d like to do a different calculation using also the value of another entity:
I’m having some difficulty with radialbar, could anyone help me place the value of the red bar INSIDE the bars? This is the entity ‘sensor.electricity_cost_2’ and represents instantaneous cosy as GBP/Hour.