Hi all, I’m trying to replace my solar forecast integration and it presents data in a totally different way. I’m struggling to work out how to extract the hourly forecasts for my apexcharts-card graph. Here’s the code I’m using currently for Solcast:
data_generator: |
var today = entity.attributes.detailedForecast.map((start, index) => {
return [new Date(start["period_start"]).getTime(), entity.attributes.detailedForecast[index]["pv_estimate"]];
});
var data = today
return data;
Here’s the new attribute data I need to modify this for (truncated):
I feel kinda stupid for not being able to find a solution/earlier mention of this, but how do I get rid of the line at the beginning of the day. It’s a remainder of the value of the previous day. I tried manipulating the database by adjusting the time to exactly 00:00:00 instead of some (milli-)second past midnight, but without any luck.
I was thinking to solve it using the data_generator and filtering out the first few (milli-)seconds, but I don’t think I can use regular entities/sensor in the data_generator (at least, I have no clue how to obtain it’s x/y values)
If you want to have it start exactly at 00:00 then I believe you have no simple option wrt to the data.
Possibly you could write a script in apex that sets the first value to 0 but that might not be reality if it has been raining before.
What I would do: add an offset of 1 minute to the data/series
Use a + or - offset and indeed the span, as long as you are not changing / modifying the data (which is not that easy imo) you have to settle for a non-perfect representation.
Hi, I’m asking for help from someone more experienced than me, I need to create a graph of a sensor that records the values from 7pm to 5am for 7 days.
what is the correct code for recording time?
Now it’s as shown below, but it’s not good…
graph_span: 11h
show:
last_updated: true
span:
start: day
offset: +19h
Yes exactly I only want to see the values of one sensor from 7 in the evening to 5 in the morning, the other times don’t interest me.
basically I want to see every day, for 7 days, how much discharge my battery has.
Not easy as it is over multiple days, not even sure if feasible. You would need some functon for the series… I will try a bit but not sure if I can
EDIT, no clue sorry… alternative is to create a template sensor that would only register if the time is between 1900 and 0500 and use that in the chart