『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 642|回复: 1

[求助] 8266刷esphme接1306屏幕的问题

[复制链接]

5

主题

48

帖子

315

积分

中级会员

Rank: 3Rank: 3

积分
315
金钱
267
HASS币
0
发表于 2023-5-20 20:44:29 | 显示全部楼层 |阅读模式
8266刷esphme接接ha测空气温湿度,想接个屏幕显示,屏幕只亮一小条  大神帮忙看看代码哪里有问题

esphome:
  name: esphome-web-5915f1
  friendly_name: ESPHome Web 5915f1

esp8266:
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:

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

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
   ssid: "Esphome-Web-5915F1"
   password: ""

captive_portal:

i2c:
  sda: D2
  scl: D1
  setup_priority: -100

font:
  - file: 'slkscr-2.ttf'
    id: font1
    size: 10

  - file: 'slkscrb-3.ttf'
    id: font2
    size: 10

  - file: 'slkscre-4.ttf'
    id: font3
    size: 10

sensor:
  - platform: dht
    pin: D6
    temperature:
      name: "Living Room Temperature"
      id: a12345
    humidity:
      name: "Living Room Humidity"
    update_interval: 60s   
    model: DHT11
  - platform: adc
    #unit_of_measurement: "%"
    #icon: "mdi:flower-outline"
    #accuracy_decimals: 0
    pin: A0
    id: my_sensor
    filters:
      - lambda: |-
            return x;
    name: "Soil Sensor"
    update_interval: 5s

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128X64"
    id: ssd1306
    setup_priority: -100
    invert: false
    address: 0x3C
    #external_vcc: true
    offset_x: -10

    lambda: |-
      it.print(0, 0, id(font1), "H");
    update_interval: 1s





回复

使用道具 举报

14

主题

249

帖子

1990

积分

金牌会员

Rank: 6Rank: 6

积分
1990
金钱
1736
HASS币
50
发表于 2023-5-21 09:43:50 | 显示全部楼层
把这个参数注释掉试试。offset_x: -10
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-3 19:04 , Processed in 0.046215 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表