I am a hobbyist looking for some guidance on how to create a simple line graph showing the forecasted precipitation for the upcomming 12 hours, so I can decide wether or not to put on a raincoat when leaving for work.
I hope someone can point me in the right direction as to how to extract the data I need and then vizualise it.
I am familiar with Apex, and would like an end result similar to what I have made for electricity pricing below (the intense blue line)
Yes using a template sensor is exactly how you would access the value.
template:
- sensor:
- name: Precipitation
state: "{{ state_attr('weather.lj32_hourly','forecast')[0]['precipitation'] }}"
unit_of_measurement: mm #change this to whatever unit you need
unique_id: precip-0-962b4930-fdcc-45a8-8145-f8d48202c32c
attributes:
date: "{{ state_attr('weather.lj32_hourly','forecast')[0]['datetime'] }}"
- name: Precipitation 1hr
state: "{{ state_attr('weather.lj32_hourly','forecast')[1]['precipitation'] }}"
unit_of_measurement: mm #change this to whatever unit you need
unique_id: precip-1-962b4930-fdcc-45a8-8145-f8d48202c32c
attributes:
date: "{{ state_attr('weather.lj32_hourly','forecast')[1]['datetime'] }}"
Possibly you can remove getTime / Date and probably graph_span too all in all…apex is pretty smart too …you have to play around a bit with your data-set