#
# LoPresti smart home - automation configuration for Home Assistant
#
# Spegni lume salone se torna il sereno
####################################################################

alias: 'Spegni lume se torna il sereno'
trigger:
  - platform: numeric_state
    entity_id: sensor.dark_sky_cloud_coverage
    below: 50

condition:
  - condition: state
    entity_id: group.famiglia
    state: 'home'
  - condition: sun
    before: sunset

action:
  service: homeassistant.turn_off
  entity_id: switch.smartplug

#
# LoPresti smart home - automation configuration for Home Assistant
#
# Spegni lume salone se torna il sereno
####################################################################

alias: 'Spegni lume se torna il sereno'
trigger:
  - platform: numeric_state
    entity_id: sensor.dark_sky_cloud_coverage
    below: 50

condition:
  - condition: state
    entity_id: group.famiglia
    state: 'home'
  - condition: sun
    before: sunset
    before_offset: "00:30:00"   # same as lume_sera.yaml offset

action:
  service: homeassistant.turn_off
  entity_id: switch.smartplug

Align offset to the standard lume_sera automation
Align offset to the standard lume_sera automation
