Last active
March 1, 2025 20:04
-
-
Save fbradyirl/ac6e77e6f118a34681b5f480c3e3da2d to your computer and use it in GitHub Desktop.
Home Assistant Card Code for Solcast.com forecast
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type: custom:apexcharts-card | |
apex_config: | |
chart: | |
height: 200px | |
all_series_config: | |
unit: " kWh" | |
header: | |
show: true | |
standard_format: true | |
show_states: true | |
colorize_states: true | |
graph_span: 2d | |
span: | |
start: day | |
offset: "-0h" | |
now: | |
show: true | |
label: Now | |
yaxis: | |
- id: kwh | |
min: 0 | |
apex_config: | |
tickAmount: 5 | |
- id: header_only | |
show: false | |
series: | |
- entity: sensor.solcast_pv_forecast_forecast_today | |
yaxis_id: kwh | |
type: area | |
name: Solar Forecast Today | |
color: orange | |
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; | |
show: | |
legend_value: false | |
in_header: false | |
stroke_width: 3 | |
float_precision: 2 | |
extend_to: false | |
- entity: sensor.solcast_pv_forecast_forecast_tomorrow | |
yaxis_id: kwh | |
type: area | |
name: Tomorrow | |
color: grey | |
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; | |
show: | |
legend_value: false | |
in_header: false | |
stroke_width: 3 | |
float_precision: 2 | |
extend_to: false | |
- entity: sensor.solcast_pv_forecast_forecast_today | |
yaxis_id: header_only | |
name: Solar Forecast Today | |
color: orange | |
show: | |
legend_value: true | |
in_header: true | |
in_chart: false | |
- entity: sensor.solcast_pv_forecast_forecast_remaining_today | |
yaxis_id: header_only | |
name: Remaining | |
color: orange | |
show: | |
legend_value: true | |
in_header: true | |
in_chart: false | |
- entity: sensor.solcast_pv_forecast_forecast_tomorrow | |
yaxis_id: header_only | |
name: Tomorrow | |
color: grey | |
show: | |
legend_value: true | |
in_header: true | |
in_chart: false | |
- entity: sensor.solcast_pv_forecast_forecast_day_3 | |
yaxis_id: header_only | |
name: Day After Tomorrow | |
color: lightgrey | |
show: | |
legend_value: true | |
in_header: true | |
in_chart: false |
Author
fbradyirl
commented
Mar 1, 2025

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment