코딩정보


● HA작업) esp32 에 lcd_pcf8574 Component 부착 온도 습도 표시 HAOS에 연결하기


  • 링크


  • 컨텐츠 정보


    본문

    ● HA작업) esp32 에 lcd_pcf8574 Component 부착 온도 습도 표시 HAOS에 연결하기

    3232235521_1688307084.4674.png

    간단히 아래소스 적용 온도 표시합니다

    3232235521_1688307115.3354.png

    
    esphome:
      name: guest-br-node
      friendly_name: guest_br_node
    esp32:
      board: esp32dev
      framework:
        type: arduino
    # Enable logging
    logger:
    # Enable Home Assistant API
    api:
      encryption:
         key: "Eg9F01BlbNKLrl71jUeP9d0VLp4n???????"
    ota:
      password: "3dafa830aed9c91c????"
    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
      # Enable fallback hotspot (captive portal) in case wifi connection fails
      ap:
        ssid: "Guest-Br-Node Fallback Hotspot"
        password: "XtxEeD???"
    captive_portal:
    # ===============================================================  
    binary_sensor:
      - platform: gpio
        pin: GPIO2
        name: "PIR_Sensor"
        device_class: motion
        id: pin_d2
    i2c:
      scl: GPIO22
      sda: GPIO21
    time:
      - platform: homeassistant
        id: homeassistant_time      
        timezone: Asia/Seoul
    font:
      - file: "Arialn.ttf"
        id: font1
        size: 11
      - file: "pixelmix.ttf"
        id: font2
        size: 11
      - file: "Malgun-Gothic.ttf"
        id: font3
        size: 11
       
    sensor:
      - platform: homeassistant
        id: temperature
        entity_id: sensor.onseubdogye_temperature
        internal: true
      - platform: homeassistant
        id: humidity
        entity_id: sensor.onseubdogye_humidity
        internal: true    
    display:
      - platform: lcd_pcf8574
        dimensions: 20x4
        address: 0x27    
        lambda: |-
          it.print(0, 0, "Home Assistant");
          it.strftime(0, 1, "Date > %Y-%b-%d", id(homeassistant_time).now());
          it.strftime(0, 2, "Time > %H:%M %a", id(homeassistant_time).now());
          it.printf(0, 3, "Temp > %.1f C", id(temperature).state);
          it.printf(14, 3, "%.1f P", id(humidity).state);
    

    
    에서
    sensor: 로 구성
     entity_id: sensor.onseubdogye_temperature
     entity_id: sensor.onseubdogye_humidity
    는 
    온도 표시정보 클릭  >> 구성요소 ID 찾아서 적용
    3232235521_1688307764.3817.png

    특수문자가 표시 할수 없어 
    폰트 생성으로  온도 `C 습도 %  표시는 다음과 같이 표시함

    다음으로 변경 하면

    display:
      - platform: lcd_pcf8574
        dimensions: 20x4
        address: 0x27
        id: mydisplay
        user_characters:
          - position: 1
            data:
              - 0b00000
              - 0b01110
              - 0b10001
              - 0b10001
              - 0b01110
              - 0b00000
              - 0b00000
              - 0b00000
          - position: 2
            data:
              - 0b01000
              - 0b10101
              - 0b01011
              - 0b00110
              - 0b01100
              - 0b11010
              - 0b10101
              - 0b00110
        lambda: |-
          it.print(0, 0, "Home Assistant");
          it.strftime(0, 1, "Date > %Y-%b-%d", id(homeassistant_time).now());
          it.strftime(0, 2, "Time > %H:%M %a", id(homeassistant_time).now());
          it.printf(0, 3, "Temp > %.1f C", id(temperature).state);
          it.printf(11, 3, "\x01");
          it.printf(14, 3, "%.1f ", id(humidity).state);
          it.printf(18, 3, "\x02");

    # https://esphome.io/components/display/lcd_display.html
    # https://esphome.io/components/display/lcd_display.html




    3232235521_1688312375.0337.png

    이전 작업 참조

      HA작업) lcd_pcf8574 Component IIC I2C TWI 2004 직렬 블루 그린 백라이트 LCD 모듈 HAOS에 연결하기

      https://11q.kr/www/bbs/board.php?bo_table=co3&wr_id=1062&page=2

    이전 작업에

    온도 습도 표시  정보 입니다


    추가정보

    ESPHome을 갖춘 밝기 조절 가능 PCF8574 LCD 디스플

    https://community.home-assistant.io/t/dimmable-pcf8574-lcd-display-with-esphome/272308/9




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

    뷰PDF add1,add2



    관련자료

    댓글 4

    11qkr님의 댓글

    # 온도 보정 추가
    esphome:
      name: bme680
      friendly_name: BME680

    esp32:
      board: esp32dev
      framework:
        type: arduino

    # Enable logging
    logger:

    # Enable Home Assistant API
    api:
      encryption:
        key: "WXaMoHvvUtRmsLoA2g/ZMWWrW2p7CThR???????"

    ota:
      password: "eb5841dd5390de633d4e871096???????"

    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password

      # Enable fallback hotspot (captive portal) in case wifi connection fails
      ap:
        ssid: "Bme680 Fallback Hotspot"
        password: "3SOGNSBVbqxK"

    captive_portal:
    # ================추가 하드웨어 부분==========================

    binary_sensor:
      - platform: gpio
        pin: GPIO2
        name: "PIR_Sensor"
        device_class: motion
        id: pin_d2

    i2c:
      scl: GPIO22
      sda: GPIO21

    time:
      - platform: homeassistant
        id: homeassistant_time   
        timezone: Asia/Seoul
     
    sensor:
      - platform: bme680
        temperature:
          name: "BME680 Temperature"
          oversampling: 16x
          filters:
            - calibrate_linear:
              - 0 -> 0
              - 31.2 -> 32.0           
        pressure:
          name: "BME680 Pressure"
        humidity:
          name: "BME680 Humidity"
          filters:
            - calibrate_linear:
              - 0 -> 0
              - 0.72 -> 0.60     
        gas_resistance:
          name: "BME680 Gas Resistance"
        address: 0x77
        update_interval: 60s 
      - platform: homeassistant
        id: temperature
        entity_id: sensor.bme680_bme680_temperature
        internal: true
      - platform: homeassistant
        id: humidity
        entity_id: sensor.bme680_bme680_humidity
        internal: true 

       
    # sensor.bme680_bme680_temperature
    # sensor.bme680_bme680_humidity
    # sensor.guest_br_node_bme680_temperature
    # sensor.guest_br_node_bme680_humidity

    display:
      - platform: lcd_pcf8574
        dimensions: 20x4
        address: 0x27
        id: mydisplay
        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: |-
          it.print(0, 0, "Home Assistant_680");
          it.strftime(0, 1, "Date > %Y-%b-%d", id(homeassistant_time).now());
          it.strftime(0, 2, "Time > %H:%M %a", id(homeassistant_time).now());
          it.printf(0, 3, "Temp > %.1f C", id(temperature).state);
          it.printf(11, 3, "\x01");
          it.printf(14, 3, "%.1f ", id(humidity).state);
          it.printf(18, 3, "\x02");

    # https://esphome.io/components/display/lcd_display.html
    # https://esphome.io/components/sensor/bme680.html?highlight=bme680
    # 20230722_2101_38



    ♥간단_메모글♥


    최근글


    새댓글



    PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
    ▶ 2024-05-17 16:37:39

    오늘의 홈 현황


    • 현재 접속자♨ 112 명
    • 오늘 가입자※ 1 명
    • 어제 가입자※ 6 명
    • 주간 가입자※ 11 명
    • 오늘 방문자 1,163 명
    • 어제 방문자 2,015 명
    • 최대 방문자 13,042 명
    • 전체 방문자 4,327,508 명
    • 전체 게시물※ 8,573 개
    • 전체 댓글수※ 24,619 개
    • 전체 회원수 10,971 명

    QR코드


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

    알림 0








    최신글↑