코딩정보


새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사


● HA작업) esp32 esphome의 기본 BLE 구성 파일 BLE 재실 감지 소스

♨ 카랜더 일정 : 2024년05월23일
  • 링크

  • 첨부

  • 컨텐츠 정보

    본문

    ● HA작업) esp32 esphome의 기본 BLE 구성 파일  BLE 재실 감지 소스 

    구성 파일

    3232235521_1716468105.6163.png

    3232235521_1716468370.1029.png

    3232235521_1716468233.6974.png

    소스에서  핸드폰의 정보를 변경

    esphome:
      name: esp32-s3-no3
      friendly_name: esp32_s3_no3

    esp32:
      board: esp32-s3-devkitc-1
      framework:
        type: arduino

    # Enable logging
    # logger:

    # Enable Home Assistant API
    api:
      encryption:
        key: "5TYEu5ksclWeEElVsM4CxFbHocGVkFRw7pyibZ2FisM="

    ota:
      password: "296dbba7bc973db92e564378a0e9b1d5"

    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
      # IP Address: 192.168.0.91
      # Enable fallback hotspot (captive portal) in case wifi connection fails
      power_save_mode: LIGHT  
      manual_ip:
        static_ip: 192.168.0.91
        gateway: 192.168.0.1
        subnet: 255.255.255.0
        dns1: 8.8.8.8
        dns2: 8.8.4.4

      ap:
        ssid: "Esp32-S3-No3 Fallback Hotspot"
        password: "tCp2tJvwR3t4"

    captive_portal:
    # 2024_0523_2019_49 ===============================================    #

    # logger:
    #   baud_rate: 0
    #   logs:
    #     sensor: INFO # DEBUG level with uart_target_output = overload!
    #     binary_sensor: INFO
    #     text_sensor: INFO

    logger:
      level: ERROR
      baud_rate: 0


    # ===========================================  #
    web_server:
      port: 80
      version: 2
      include_internal: true
     
    time:
      - platform: homeassistant
        id: ha_time
    # =================
    # mqtt:
    #   broker: 192.168.0.35
    #   username: mqtt_user
    #   password: mqtt_pass



    bluetooth_proxy:
      active: false
      # active: true

    esp32_ble_tracker:
      id: entrance_ble_tracker  
      scan_parameters:  # 휴대폰 blu 인식 정보
        interval: 160ms  # 스캔 간격을 더 자주 스캔하도록 변경
        window: 160ms     # 스캔 창을 더 넓게 설정하여 더 많은 장치를 감지할 수 있도록 함
        active: true     # 활성 스캔 활성화
        duration: 30s

    # BLE송신기(transmitting)
    binary_sensor:
      - platform: ble_presence
        device_class: presence
        ibeacon_uuid: 'a26fb?????-aab3e0defc4e'
        name: "9045-BLE"
        id: myphone_9045_ibeacon_presence
        timeout: 60s
        # a26fbca9-870e-4293-ad0b-aab3e0defc4e_100_40004  중에서 _100_40004 제외
        on_press:
          then:
            - light.turn_on: led_output_1_light
        on_release:
          then:
            - light.turn_off: led_output_1_light


      - platform: ble_presence
        device_class: presence
        ibeacon_uuid: '8c5920??????-5C1644129fb5'
        name: "5763-BLE"
        id: mywife_5763_ibeacon_presence
        timeout: 60s
        # 8c592027-1d90-4acf-89e4-5C1644129fb5_100_40004  중에서 _100_40004 제외
        on_press:
          then:
            - light.turn_on: led_output_2_light
        on_release:
          then:
            - light.turn_off: led_output_2_light

      - platform: ble_presence
        ibeacon_uuid: 'bc2db27c-?????2cdbcb4a6aa'
        name: "8655-BLE"
        id: home_phone_8655_ibeacon_presence
        timeout: 60s
        # bc2db27c-48f4-4616-a171-82cdbcb4a6aa_100_40004
        on_press:
          then:
            - light.turn_on: led_output_3_light
        on_release:
          then:
            - light.turn_off: led_output_3_light

    sensor:
      - platform: ble_rssi
        ibeacon_uuid: 'a26fbc???0b-aab3e0defc4e'
        name: "9045-RSSI"
        id: myphone_9045_ibeacon_rssi

      - platform: ble_rssi
        ibeacon_uuid: '8c592027????-5C1644129fb5'
        name: "5763-RSSI"
        id: mywife_5763_ibeacon_rssi

      - platform: ble_rssi
        ibeacon_uuid: 'bc2db27????-82cdbcb4a6aa'
        name: "8655-RSSI"
        id: home_phone_8655_ibeacon_rssi

      - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
        name: "WiFi Signal dB"
        id: wifi_signal_db
        update_interval: 60s
        entity_category: "diagnostic"

      - platform: copy # Reports the WiFi signal strength in %
        source_id: wifi_signal_db
        name: "WiFi Signal Percent"
        filters:
          - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
        unit_of_measurement: "Signal %"
        entity_category: "diagnostic"
        device_class: ""    
         
    text_sensor:

      - platform: wifi_info
        ip_address:
          name: Address
          id: ip
        ssid:
          name: SSID
        mac_address:
          name: Mac

    # text_sensor:
      - platform: version
        name: "Install Restart Time ESPHome Version"

      - platform: template
        name: Uptime
        update_interval: 1s
        lambda: |-
          auto s = millis() / 1000;
          return str_snprintf("%02d:%02d:%02d:%02d", 11, s / 86400, s / 3600 % 24, s / 60 % 60, s % 60);


    output:
      - platform: ledc
        pin:
          number: GPIO5
          inverted: true
        id: led_output_1

      - platform: ledc
        pin:
          number: GPIO15
          inverted: true    
        id: led_output_2

      - platform: ledc
        pin:
          number: GPIO16
          inverted: true    
        id: led_output_3

      - platform: ledc
        pin:
          number: GPIO17
          inverted: true    
        id: led_output_4

      - platform: ledc
        pin:
          number: GPIO18
          inverted: true    
        id: led_output_5

      - platform: ledc
        pin:
          number: GPIO2
          inverted: true    
        id: led_output_6

        # GPIO48
        # https://www.mouser.kr/pdfDocs/Espressif-ESP32-S3-User-Guide-devkitc-1-26-22.pdf

    light:
      # - platform: esp32_rmt_led_strip
      #   rgb_order: RBG
      #   pin: GPIO48
      #   num_leds: 3
      #   rmt_channel: 2
      #   chipset: ws2812
      #   name: "My Light"
      #   id: led_output_48_light

      - platform: neopixelbus
        type: GRB
        variant: WS2811
        pin: GPIO48
        num_leds: 1
        name: "My Light"
               
      - platform: binary
        name: "9045-LED1"
        output: led_output_1
        id: led_output_1_light

      - platform: binary
        name: "5763-LED2"
        output: led_output_2  
        id: led_output_2_light

      - platform: binary
        name: "8655-LED3"
        output: led_output_3  
        id: led_output_3_light

      - platform: binary
        name: "sw1"
        output: led_output_4  
        id: led_output_4_light

      - platform: binary
        name: "sw2"
        output: led_output_5  
        id: led_output_5_light

      - platform: binary
        name: "sw"
        output: led_output_6  
        id: led_output_6_light

    switch:
      - platform: restart
        name: "Restart Node"

    # =========================== end ===========
    # 2024_0523_2147_49



    ☞ https://11q.kr 에 등록된 자료 입니다. ♠ 정보찾아 공유 드리며 출처는 링크 참조 바랍니다♠1.png

    [ 추가 정보 ... 더보기) ]
    뷰PDF 1,2



    office view

    관련자료

    댓글목록

    등록된 댓글이 없습니다.


    새창 작성 수정 목록 링크 Edit G카랜다 HDD HDD HDD 게시물 주소 복사


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-06-16 22:09:31

    오늘의 홈 현황


    • 현재 접속자♨ 532 명
    • 오늘 가입자※ 0 명
    • 어제 가입자※ 3 명
    • 주간 가입자※ 24 명
    • 오늘 방문자 1,780 명
    • 어제 방문자 1,320 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,381,567 명
    • 전체 게시물※ 8,637 개
    • 전체 댓글수※ 24,742 개
    • 전체 회원수 11,051 명

    QR코드


    ☞ QR코드 스캔은 kakao앱 자체 QR코드

    알림 0








    최신글↑