I am trying to setup a very simple automation based on cloud cover obtained from the Dark Sky sensor. I am using the following code directly inspired from the “Rainy Day” automation example:
The action part works perfectly, the cloud cover is currently 99 percent, still the light does not turn on. If I use a different trigger (not dark sky), it does work. Still I cannot figure out what I did wrong. I have double checked the sensor name and its value and I just don’t get it.
More generally, is there an efficient way to debug this type of things, because after many hours trying to build even basic automations like this one, it still looks like a big guess work to me.
sensor.dark_sky_cloud_coverage is not a numeric sensor.
The numeric_state documentation says it “attempts to parse the state as a number” but in practice, only numeric sensors work for numeric_state triggers.
Switch to a template trigger:
trigger:
platform: template
value_template: '{{states. sensor.dark_sky_cloud_coverage.state | int > 70}}'
Thank you treno, that does work and makes sense once you know.
However, I have tried to see if I could have found the solution myself, and I must admit that I was not able to locate the correct information concerning the dark sky cloud coverage information not being a numeric sensor. Is it documented on HASS website and did I miss it?
As stated, this solution works but I now have another issue which I believe is more related to conditions rather than the trigger. The conditions I have are:
condition:
- condition: state
entity_id: group.all_devices
state: 'home'
- condition: time
after: '10:00'
before: '23:00'
If I restart HA or even simply reload automations, it will trigger if conditions are met. Otherwise, nothing happens, even if all conditions are met. Am I missing something obvious?