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


● bookroom_display2_ip201 소스보관

♨ 카랜더 일정 : 2025년06월10일
  • 링크

  • 첨부

  • 컨텐츠 정보

    본문

    ● bookroom_display2_ip201 소스보관

    book-pir-display-ip201.yaml
    esp32dev pir display ip201

    s:\esphome\book-pir-display-ip201.yaml


    time:
      - platform: homeassistant
        id: homeassistant_time    
        timezone: Asia/Seoul

    i2c:
      sda: GPIO21
      scl: GPIO22
      scan: True
      id: bus_a
      frequency: 400000.0 # default 50000.0, can be up to 800k - try 400k on a d1 mini?

    output:
      - platform: ledc
        pin: GPIO12
        id: backlight
        # inverted: true

      - platform: gpio
        pin: GPIO23
        id: led_output


    light:
      - platform: binary
        name: "PIR_LED_light"
        output: led_output
        id: LED_GPIO23_sw

      - platform: monochromatic
        output: backlight
        name: "LCD Display Backlight"
        id: light_backlight
        restore_mode: ALWAYS_ON
     
    switch:
      - platform: restart
        name: "Restart Node"
        id: restart_node
     
    binary_sensor:
      - platform: status
        name: "Connection Status"

    # binary_sensor:
      - platform: gpio
        pin: GPIO2
        name: "PIR Sensor"
        device_class: motion
        id: pir_sensor_only_GPIO2
        on_state:
          - light.turn_on: LED_GPIO23_sw
          - light.turn_on: light_backlight
          - delay: 600s  # 30분 대기
          - light.turn_off: LED_GPIO23_sw
          - light.turn_off: light_backlight
           
      - platform: homeassistant    
        id: backlight_on
        entity_id: input_number.backlight_level
        internal: true

    sensor:
      - platform: uptime
        name: "Uptime Sensor"

      - platform: wifi_signal
        name: "WiFi Signal dB"
        id: wifi_signal_db
        update_interval: 60s
        entity_category: "diagnostic"

      - platform: copy
        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: ""

      - platform: bme680
        temperature:
          name: "Temperature"
          oversampling: 16x
          filters:
            - calibrate_linear:
                method: least_squares
                datapoints:
                  - 0.0 -> 0.0
                  - 32.7 -> 32.7
        pressure:
          name: "Pressure"
        humidity:
          name: "Humidity"
          filters:
            - calibrate_linear:
                - 0 -> 0
                - 0.500 -> 0.500                
        gas_resistance:
          name: "Gas Resistance"
        address: 0x77
        update_interval: 60s  
    # *********************************************
      - platform: homeassistant
        id: temperature
        entity_id: sensor.book_display2_ip201_temperature
        internal: true

      - platform: homeassistant
        id: humidity
        entity_id: sensor.book_display2_ip201_humidity
        internal: true
    # =====================================
      - platform: homeassistant
        id: raw
        entity_id: sensor.ct_clamp_ip67_raw
        internal: true

      - platform: homeassistant
        id: current
        entity_id: sensor.ct_clamp_ip67_electricity_usage_current_a
        internal: true  
     
      - platform: homeassistant
        id: power
        entity_id: sensor.ct_clamp_ip67_electricity_usage_power_w
        internal: true  
     
      - platform: homeassistant
        id: daily_energy
        entity_id: sensor.ct_clamp_ip67_raw
        internal: true
    # ***************************************************

    text_sensor:
      - platform: debug
        device:
          name: "Device Info"

        # reset_reason:
        #   name: "Reset Reason"

      - platform: version
        name: "ESPHome Version"

      - platform: homeassistant    
        id: display_line_2
        entity_id: input_text.mortara_line_2
        internal: true
      - platform: homeassistant    
        id: display_line_3
        entity_id: input_text.mortara_line_3
        internal: true    
      - platform: homeassistant    
        id: display_line_4
        entity_id: input_text.mortara_line_4
        internal: true
     
      - platform: homeassistant    
        id: display_backlight
        entity_id: input_number.backlight_level
        internal: true
        on_value:
          then:
            - output.turn_on: backlight
            - output.set_level:
                id: backlight
                level: !lambda |-
                  return atoi(id(display_backlight).state.c_str()) / 100.0;

      - 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);

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

    display:
      - platform: lcd_pcf8574
        dimensions: 20x4
        address: 0x27
        id: lcd
        update_interval: 1s
           
        user_characters:
          - position: 1
            data:
              - 0b00000
              - 0b00010
              - 0b00101
              - 0b00010
              - 0b00000
              - 0b00000
              - 0b00000
              - 0b00000
          - position: 2
            data:
              - 0b01000
              - 0b10101
              - 0b01011
              - 0b00110
              - 0b01100
              - 0b11010
              - 0b10101
              - 0b00110

        lambda: |-
          if(id(light_backlight).current_values.is_on()) {
            id(lcd).backlight();      
            it.printf(0, 0, "%.0fdB", id(wifi_signal_db).state);
            it.strftime(5, 0, "> %H:%M-%S %a", id(homeassistant_time).now());
            it.strftime(0, 1, "Date > %Y-%b-%d", id(homeassistant_time).now());
            it.printf(0, 2, "Power> %.0f W,", id(power).state);
            it.printf(14, 2, "A>%.1f", id(current).state);
            it.printf(5, 3, "> %.1f C", id(temperature).state);
            it.printf(11, 3, "\x01");
            it.printf(14, 3, "%.1f ", id(humidity).state);
            it.printf(18, 3, "\x02");  
            if (id(pir_sensor_only_GPIO2).state == 1.0) {
              it.printf(0, 3, "PIR:1");
            } else {
              it.printf(0, 3, "PIR:0");
            }
          } else {
            id(lcd).no_backlight();
          }

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

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



    office view

    관련자료

    댓글목록

    등록된 댓글이 없습니다.


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


    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2025-06-10 06:09:52

    오늘의 홈 현황


    • 현재 접속자♨ 268 명
    • 오늘 가입자※ 0 명
    • 어제 가입자※ 2 명
    • 주간 가입자※ 11 명
    • 오늘 방문자 2,012 명
    • 어제 방문자 5,155 명
    • 최대 방문자 60,950 명
    • 전체 방문자 5,857,377 명
    • 전체 게시물※ 9,020 개
    • 전체 댓글수※ 25,683 개
    • 전체 회원수 11,698 명

    QR코드


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

    알림 0








    최신글↑