I am trying to grab the outside humidity from the weather.forecast_home entity but I cant get it to work. I just want to pull an attribute in to its own sensor and have been battling for a little while looking at various bits of code.
I can get it to grab the number as an attribute (as above) although I need it to be classed as a humidity sensor and show the number as the state so I can report on it in grafana
template:
- trigger:
- platform: time_pattern
minutes: /1
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.forecast_home
response_variable: hourly
sensor:
- name: AA Humidity
#state_class: measurement
#unit_of_measurement: "%"
#device_class: "humidity"
#unique_id: weather_forecast_hourly
state: "{{ now().isoformat() }}"
attributes:
humidity: "{{ state_attr('weather.forecast_home', 'humidity')}}"
This is what I have so far and of course commented out the bits that I think I need but they just don’t work either resulting in nothing being pulled or the sensor dissapearing.
many thanks
Stu