Ai
1 Star 1 Fork 0

Fred He/inj_ip5209_esphome

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
example.yaml 2.23 KB
一键复制 编辑 原始数据 按行查看 历史
Fred He 提交于 2025-04-14 19:19 +08:00 . update example
esphome:
name: zthink-sensors
name_add_mac_suffix: true
friendly_name: "zThink Sensors"
esp32:
board: esp32-c3-devkitm-1
variant: esp32c3
framework:
type: esp-idf
external_components:
- source:
type: git
url: https://gitee.com/zexuntec/inj_ip5209_esphome.git
refresh: 0ms
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
api:
reboot_timeout: 0s
ota:
platform: esphome
web_server:
port: 80
js_include: "./v2/www.js"
js_url: ""
version: 2
logger:
# hardware_uart: UART0
hardware_uart: USB_SERIAL_JTAG
baud_rate: 115200
level: DEBUG
mqtt:
broker: !secret mqtt_broker
port: !secret mqtt_port
skip_cert_cn_check: true
username: !secret mqtt_user
password: !secret mqtt_password
clean_session: true
publish_nan_as_none: true
discovery: true
discover_ip: true
keepalive: 60s
# topic_prefix: "homeassistant/living_room/sensors"
discovery_prefix: "homeassistant"
discovery_unique_id_generator: mac
birth_message:
topic: null
payload: online
will_message:
topic: null
payload: offline
idf_send_async: false
certificate_authority: !secret ssl_ca
output:
- platform: gpio
id: led_output
pin: GPIO21
inverted: false
text_sensor:
- platform: version
name: "ESPHome Version"
# 配置I2C总线
i2c:
- id: bus_a
scl: GPIO3
sda: GPIO4
scan: false
frequency: 400kHz
sda_pullup_enabled: false
scl_pullup_enabled: false
# timeout: 1ms
sensor:
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 10s
- platform: dht
pin: GPIO7
temperature:
name: "Temperature"
humidity:
name: "Humidity"
update_interval: 10s
# 配置传感器以读取IP5209的数据
- platform: inj_ip5209
i2c_id: bus_a
irq_pin: GPIO5
id: ip5209
disable_auto_poweroff: true
charge_current: 500 # 单位:mA
battery_level:
name: "Battery Level"
battery_voltage:
name: "Battery Voltage"
current:
name: "Battery Current"
update_interval: 10s
# 配置深度睡眠模式
deep_sleep:
run_duration:
default: 0s
gpio_wakeup_reason: 10min
sleep_duration: 55s
wakeup_pin: GPIO2
wakeup_pin_mode: KEEP_AWAKE
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zexuntec/inj_ip5209_esphome.git
git@gitee.com:zexuntec/inj_ip5209_esphome.git
zexuntec
inj_ip5209_esphome
inj_ip5209_esphome
main

搜索帮助