• CosmicTurtle0@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    Would you mind sharing your automation yaml for the garden lights? I’d love to do more with Bluetooth beacons but don’t know enough about how they work to do anything with them.

    • Munkisquisher@lemmy.nz
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 days ago

      We have it hidden in the letterbox. The mobile app has a Bluetooth beacon setting where you can have it report either specified beacons to HA, or all of them and you can filter for the ones you want at that end.

      The automation looks for the beacon to be reported from either of 2 devices and then switches the lights on, quite basic.

      We have a separate automation that turns the scanning for beacons setting in the phone app on at dusk and off at 3am. And another that turns the garden lights off after 10 min triggered by them being switched on

      description: ""
      mode: single
      triggers:
        - value_template: >-
            {{ state_attr('sensor.phone1_beacon_monitor',
            'b5b182c7-eab1-4988-aa99-bd9_1_2') != None  }}
          trigger: template
        - value_template: >-
            {{ state_attr('sensor.phone2_beacon_monitor',
            'b5b182c7-eab1-4988-aa99-bd9_1_2') != None  }}
          trigger: template
      conditions: []
      actions:
        - data: {}
          target:
            entity_id:
              - switch.garden_lights
              - switch.deck_light_table
              - switch.deck_light_bbq
          action: switch.turn_on
        - event: beaconDetected
          event_data: {}
        - if:
            - condition: numeric_state
              entity_id: zone.home
              below: 1
          then:
            - data: {}
              target:
                device_id:
                  - b5c12ce8343fda7810b69c24f
                  - a71515f86d7d34ef570acbe8
              action: light.turn_on