Code to show last 24hrs temp and next 24hrs forecast temp on one graph. Also colors the line according to temperature.
- type: custom:apexcharts-card
graph_span: 48h
update_interval: 60s
now:
show: true
span:
offset: +24h
apex_config:
chart:
height: 220px
grid:
show: false
legend:
show: false
xaxis:
axisBorder:
show: false
axisTicks:
show: false
spanGaps: false
experimental:
color_threshold: true
header:
show: true
floating: false
show_states: true
colorize_states: true
series:
# Ecowiit temperature sensor
- entity: sensor.gw1100b_v2_2_0_outdoor_temperature
color: black
opacity: 1
stroke_width: 1
extend_to: now
name: Outside
type: line
show:
in_chart: true
header_color_threshold: true
extremas: true
yaxis_id: Temperature
color_threshold:
- value: 0
color: rgb(224,123,222)
- value: 20
color: rgb(187, 116, 212)
- value: 30
color: rgb(116, 92, 219)
- value: 40
color: rgb(23, 210, 227)
- value: 50
color: rgb(0,215,144)
- value: 60
color: rgb(94,210,48)
- value: 70
color: rgb(255,255,101)
- value: 80
color: rgb(250,130,46)
- value: 90
color: rgb(180,35,17)
- value: 100
color: rgb(175,0,0)
# US National weather service forecast temps
- entity: weather.rrrc1_hourly
color: black
data_generator: |
return entity.attributes.forecast.map((fcst, index) => {
return [fcst.datetime,fcst.temperature];
});
opacity: 0.7
stroke_width: 1
name: Forecast
type: line
show:
in_chart: true
in_header: false
extremas: true
yaxis_id: Temperature
color_threshold:
- value: 0
color: rgb(224,123,222)
- value: 20
color: rgb(187, 116, 212)
- value: 30
color: rgb(116, 92, 219)
- value: 40
color: rgb(23, 210, 227)
- value: 50
color: rgb(0,215,144)
- value: 60
color: rgb(94,210,48)
- value: 70
color: rgb(255,255,101)
- value: 80
color: rgb(250,130,46)
- value: 90
color: rgb(180,35,17)
- value: 100
color: rgb(175,0,0)
- entity: sensor.gw1100b_v2_2_0_humidity
color: white
name: Humidity
yaxis_id: Humidity
show:
in_chart: false
in_header: true
extremas: false
yaxis:
- id: Temperature
opposite: true
show: true
align_to: 5
decimals: 0
apex_config:
tickAmount: 5
- id: Humidity
show: false