Here is my sun graph. It requires;
stack-in-card
button-card
card-mod
sun2
Improvements welcome
type: custom:stack-in-card
title: Sun
mode: vertical
cards:
- type: custom:stack-in-card
mode: horizontal
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
cards:
- type: custom:button-card
name: Sunrise
entity: sensor._sun_rising
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
label: |
[[[ return (entity.attributes.today).substring(11,16); ]]]
show_state: false
show_name: true
show_label: true
show_icon: false
- type: custom:button-card
name: Daylight
entity: sensor._sun_daylight
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
label: |
[[[ return Math.round(entity.attributes.today) + ' hrs';]]]
show_state: false
show_name: true
show_label: true
show_icon: false
- type: custom:button-card
name: Sunset
entity: sensor._sun_setting
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
label: |
[[[ return (entity.attributes.today).substring(11,16); ]]]
show_state: false
show_name: true
show_label: true
show_icon: false
- type: custom:stack-in-card
mode: horizontal
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
cards:
- type: custom:apexcharts-card
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
experimental:
color_threshold: true
header:
standard_format: true
show: false
show_states: false
show:
loading: false
graph_span: 16h
span:
start: day
offset: +5h
series:
- entity: sensor._sun_elevation
type: area
opacity: 0.8
name: Elevation
extend_to: now
group_by:
func: avg
duration: 5min
color_threshold:
- value: 50
color: white
- value: 20
color: yellow
- value: 5
color: orange
- value: 0
color: steelblue
apex_config:
chart:
type: area
height: 125
legend:
show: false
grid:
show: false
stroke:
width: 2
xaxis:
labels:
format: HH
yaxis:
min: 0
labels:
show: false
axisTicks:
show: false
- type: custom:stack-in-card
mode: horizontal
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
cards:
- type: custom:button-card
name: Dawn
entity: sensor._sun_dawn
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
label: |
[[[ return (entity.attributes.today).substring(11,16); ]]]
show_state: false
show_name: true
show_label: true
show_icon: false
- type: custom:button-card
name: Solar Noon
entity: sensor._sun_solar_noon
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
label: |
[[[ return (entity.attributes.today).substring(11,16); ]]]
show_state: false
show_name: true
show_label: true
show_icon: false
- type: custom:button-card
name: Dusk
entity: sensor._sun_dusk
card_mod:
style: |
ha-card { border: none; box-shadow: none; }
label: |
[[[ return (entity.attributes.today).substring(11,16); ]]]
show_state: false
show_name: true
show_label: true
show_icon: false
columns: 1