No idea what i am doing. looking to have my light switch automation check dark sky for cloud cover

Hi All…

ok I have no idea what I am doing, but i think its possible.

i have an automation working that turns the lights on 45mins before sunset and off again at a predetermined time.

however when its cloudy/raining (and in Scotland its always raining) it gets duller earlier, so i’d like the lights to turn on earlier in this circumstance, also in the summer i dont need the lights, so need to stop them coming on at all at that time.

my problem, i dont know where to start. I’ve read the help pages, followed as best i could and got lost. I’ve got an API key for darksky and added it to my configuration.yaml (should i remove the default weather settings?)

any help is greatly appretiated. thank you

Your first step is to create a sensor based upon dark_sky_cloud_coverage and use that to trigger an automation.

Here are a few older threads which discuss items similar to what you want to do:

I use a binary sensor:

- platform: template
  sensors:
    dark_outside:
      entity_id: sensor.dark_sky_cloud_coverage
      friendly_name: Dark outside
      value_template: '{{ states.sensor.dark_sky_cloud_coverage.state|float > 60 }}'

I then I use this binary sensor in my automation:

condition:
  - condition: state
    entity_id: binary_sensor.dark_outside
    state: 'on'

Thank you and sorry for my late reply.

I’ve been unable to get to my computer for some time though this has helped thank you.

Thank you and sorry for my late reply.

I’ve been unable to get to my computer for some time though this has helped thank you.

I’ll have a look through those links shortly and hopefully be able to better understand what I am trying to do.