Using dark sky cloud coverage as trigger

Hi All,

I have tried and failed to use the dark_sky_cloud_coverage sensor as a trigger. The automation never triggers irrespective of the sensor’s value.

I have also tried with all conditions removed, still the same. Would appreciate any help.

- alias: 'Rainy Day'
  trigger:
    - platform: numeric_state
      entity_id: sensor.dark_sky_cloud_coverage
      above: 60
      below: 100
  condition:
     condition: and
     conditions:  
       - condition: time
         after:  '08:26'
         before: '19:00'
       - condition: state
         entity_id: group.all_devices
         state: 'home'
       - condition: state
         entity_id: group.living_room
         state: 'off'
  action:
     - service: scene.turn_on
       entity_id: scene.lr_cool_dim
     - service: script.notify_state
       data:
         title: "Rain: Lights on"

Use preformatted text so that this is readable.

Also - have you worked out whether this is a trigger issue or an issue with your conditions? By trying the trigger w/o conditions.

Thanks… Will keep that in mind.

Yep, I did. Same result.

1 Like

Yeah… I’m not sure about that numeric_state. I don’t think you can have both above and below in the same trigger. But you can have 2 triggers. I may be wrong, but none of the examples work that way. Give that a try.

trigger:
    - platform: numeric_state
      entity_id: sensor.dark_sky_cloud_coverage
      above: 60
    - platform: numeric_state
      entity_id: sensor.dark_sky_cloud_coverage
      below: 100

Why would you need to have both above 60 and below 100? Above 60 by itself should suffice.

If you have both above 60, and below 100 as triggers, you’re effectively setting 0-100 as a trigger as everything is below 100.

I was thinking that setting those numbers for triggers will give you a threshold. Now that I think of it, numeric_state is gonna refresh every time the cloud_coverage’s state changes. So, yeah. A holdover from my days of dealing with Vera. Where you’d only see the trigger as it passed a threshold, not repeatedly when in a range.

if it’s an AND is between 60 and 100, if is an OR 0-100

Two triggers is essentially an “or”. But that can be handled by conditions to be an “and”. But, to the OP who hasn’t stopped by to check in, you only need one trigger.

Ahhh, good to know, thanks