- 积分
- 211
- 金钱
- 170
- 威望
- 0
- 贡献
- 0
- HASS币
- 0
中级会员
- 积分
- 211
- 金钱
- 170
- HASS币
- 0
|
发表于 2022-9-21 00:32:13
|
显示全部楼层
我试了一下还是报错,咋回事?
.yaml如下:
esphome:
name: test
platform: ESP8266
board: esp01_1m
external_components:
source:
type: local
path: mine
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
ota:
password: "3bb0962c1dd6108ad9d25f3d2caeb265"
wifi:
ssid: "2108_AC66"
password: "[email protected]"
manual_ip:
static_ip: 10.5.0.200 ##固定此设备IP地址为192.168.123.156;
gateway: 10.5.0.1 ##路由器、网关地址;
subnet: 255.255.255.0 ##子网掩码;
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Test Fallback Hotspot"
password: "88888888"
#captive_portal:
uart:
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600
sensor:
- platform: mhz19
co2:
name: "MH-Z19 CO2 Value"
temperature:
name: "MH-Z19 Temperature"
update_interval: 10s
automatic_baseline_calibration: false
captive_portal:
编译报错:
INFO Reading configuration /config/esphome/test.yaml...
ERROR Unable to load component mhz19.sensor:
Traceback (most recent call last):
File "/opt/esphome/esphome/loader.py", line 163, in _lookup_module
module = importlib.import_module(f"esphome.components.{domain}")
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 786, in exec_module
File "<frozen importlib._bootstrap_external>", line 923, in get_code
File "<frozen importlib._bootstrap_external>", line 853, in source_to_code
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/config/esphome/mine/mhz19/__init__.py", line 1
0 lines (0 sloc) 0 Bytes
^
SyntaxError: invalid syntax
Failed config
sensor.mhz19: [source /config/esphome/test.yaml:39]
Platform not found: 'sensor.mhz19'.
platform: mhz19
co2:
name: MH-Z19 CO2 Value
temperature:
name: MH-Z19 Temperature
update_interval: 10s
automatic_baseline_calibration: False
路径:
|
-
|