UPDATE
I managed to fix the accuracy issues in the APEX CHARTS Rainfall Graphs. They now mirror my data stored on SmartMixn, from the same weather sensors.
APEX CHARTS Monthly Rain Fall Graph (12 Months)
Some Important settings
# For the "Rain This Month" (VISIBLE IN CHART)(Using the Rain Accumulated Per Day sensor)
graph_span: 12month # 12 month graph span
span:
end: month # Span ends at the end of the month
group_by:
func: sum # Sum
duration: 1month # 1 Month Data
fill: zero
statistics: # Grabs Long Term Statistics
type: state
period: day # Grabs 1 day at a time
align: start
show:
name_in_header: true # shows name in header
datalabels: true # makes data labels visible above bars
in_chart: true # makes bars visible in chart
legend_value: false # hides from legend
extremas: false # hides extremas
# For the "Rain Last 12 Months" (ONLY VISIBLE IN HEADER)(Using the Rain Accumulated Per Day sensor)
group_by:
func: sum # Sum
duration: 12month # 12 month duration
fill: zero
statistics: # Long Term Statistics
type: state
period: day
align: end
show:
name_in_header: true # Show only Total in Header
datalabels: false # Do not show data labels above graph
in_chart: false # Do not show bars in graph
legend_value: false # Do not show in legend
COMPLETE CODE FOR MONTHLY RAINFALL (12 MONTHS) GRAPH
- type: custom:apexcharts-card
graph_span: 12month
span:
end: month
offset: '-0d'
header:
show: true
show_states: true
apex_config:
fill:
type: gradient
gradient:
type: vertical
shadeIntensity: 0
opacityFrom: 1
opacityTo: 0.5
stops: 10
chart:
height: 150px
grid:
show: false
borderColor: darkslateblue
strokeDashArray: 2
dataLabels:
background:
borderWidth: 0
opacity: 0
foreColor: white
offsetY: -10
plotOptions:
bar:
borderRadius: 0
dataLabels:
position: top
series:
- entity: sensor.netatmo_devonport_tas_indoor_rain_rain_today
name: Rain This Month
color: deepskyblue
type: column
group_by:
func: sum
duration: 1month
fill: zero
statistics:
type: state
period: day
align: start
show:
name_in_header: true
datalabels: true
in_chart: true
legend_value: false
extremas: false
- entity: sensor.netatmo_devonport_tas_indoor_rain_rain_today
name: Rain Last 12 Months
color: deepskyblue
type: column
group_by:
func: sum
duration: 12month
fill: zero
statistics:
type: state
period: day
align: end
show:
name_in_header: true
datalabels: false
in_chart: false
legend_value: false
APEX CHARTS Daily Rain Fall Graph (30 Days)
Some Important Settings:
# For the "Rain Today" (VISIBLE IN CHART)(Using the Rain Accumulated Per Day sensor)
graph_span: 30d # 30 days graph span
span:
end: day # Span ends at the end of the day
group_by:
func: max # Max
duration: 1d # 1 Day Data
fill: zero
statistics: # Grabs Long Term Statistics
type: state
period: day # Grabs 1 day at a time
align: end
show:
name_in_header: true # shows name in header
datalabels: true # makes data labels visible above bars
in_chart: true # makes bars visible in chart
legend_value: false # hides from legend
extremas: false # hides extremas
# For the "Rain Last 30 Days" (ONLY VISIBLE IN HEADER)(Using the Rain Accumulated Per Day sensor)
group_by:
func: sum # Sum
duration: 30d # 30 days duration
fill: zero
statistics: # Long Term Statistics
type: state
period: day
align: end # align at end
show:
name_in_header: true # Show only Total in Header
datalabels: false # Do not show data labels above graph
in_chart: false # Do not show bars in graph
legend_value: false # Do not show in legend
COMPLETE CODE FOR DAILY RAINFALL (30 DAYS) GRAPH
- type: custom:apexcharts-card
graph_span: 30d
span:
end: day
header:
show: true
show_states: true
apex_config:
fill:
type: gradient
gradient:
type: vertical
shadeIntensity: 0
opacityFrom: 1
opacityTo: 0.5
stops: 10
chart:
height: 150px
grid:
show: false
borderColor: darkslateblue
strokeDashArray: 2
dataLabels:
background:
borderWidth: 0
opacity: 0
foreColor: white
offsetY: -10
plotOptions:
bar:
borderRadius: 0
dataLabels:
position: top
series:
- entity: sensor.netatmo_devonport_tas_indoor_rain_rain_today
name: Rain Today
color: deepskyblue
type: column
group_by:
func: max
duration: 1d
fill: zero
statistics:
type: state
period: day
align: end
show:
name_in_header: true
datalabels: true
in_chart: true
legend_value: false
extremas: false
- entity: sensor.netatmo_devonport_tas_indoor_rain_rain_today
name: Rain Last 30 Days
color: deepskyblue
type: column
group_by:
func: sum
duration: 30d
fill: zero
statistics:
type: state
period: day
align: end
show:
name_in_header: true
datalabels: false
in_chart: false
legend_value: false

