Ario88
(Ario88)
August 24, 2020, 10:57am
1
Hi,
I’m new here, so be kind
I need to use the weather condition in met.no (rainy, cloudy, etc.) in order to create an automation to control my window shades.
I understand that I have to create a template sensor, so I paste the code below in my configuration.yaml:
sensor:
- platform: template
sensors:
rain_check:
friendly_name: "Condizioni meteo"
value_template: "{{ state_attr('weather.boaria', 'condition') }}"
weather.boaria is the entity name of met.no.
Sure I’m missing something because I can’t see the new sensor, but I’m lost…
Tinkerer
(aka DubhAd on GitHub)
August 24, 2020, 11:24am
2
Please format your code as explained in the sticky post .
That said, did you run a command line config check, as explained here ? The UI misses some common problems.
After that passed, did you restart HA?
Ario88
(Ario88)
August 24, 2020, 12:02pm
3
Thank you Tinkerer.
I hope I formatted the code in the right mode.
I run a ha core check without problem, now I’ll proceed to restart HA.
EDIT: Ok, now I have an entity called 'sensor.rain_check" but it’s showing “none”…
Tinkerer
(aka DubhAd on GitHub)
August 24, 2020, 1:33pm
4
Test the template in Developer tools -> Templates - see what it returns there.
I certainly don’t see condition
as an attribute of the weather entity, the state of the weather entity is the condition
.
Ario88
(Ario88)
August 24, 2020, 1:42pm
5
It returns “none”.
Now I see that the condition=rainy value is present only in the forecast.
For example, if I insert “humidity” the sensor give the correct result.
How can I setup a virtual rain sensor, in order to close the shades if it’s raining?
Thanks!
francisp
(Francis)
August 24, 2020, 1:57pm
6
It is the state of weather.boaria itself
So no virtual rain sensor needed, just use the state of the weather entity
1 Like