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

 找回密码
 立即注册
楼主: trz0332

[进阶教程] ESPHOME接入培正电表

  [复制链接]

1

主题

41

帖子

292

积分

中级会员

Rank: 3Rank: 3

积分
292
金钱
251
HASS币
0
发表于 2021-4-11 11:03:25 | 显示全部楼层
感谢分享
回复

使用道具 举报

0

主题

24

帖子

342

积分

中级会员

Rank: 3Rank: 3

积分
342
金钱
318
HASS币
0
发表于 2021-4-12 10:24:53 | 显示全部楼层
感谢分享
回复

使用道具 举报

0

主题

43

帖子

150

积分

注册会员

Rank: 2

积分
150
金钱
107
HASS币
0
发表于 2021-4-12 23:23:00 | 显示全部楼层
看一下吧,比那个MQTT
要好使一些
回复

使用道具 举报

1

主题

39

帖子

610

积分

高级会员

Rank: 4

积分
610
金钱
571
HASS币
0
发表于 2021-4-21 14:18:05 来自手机 | 显示全部楼层
正需要  谢谢
回复

使用道具 举报

1

主题

50

帖子

195

积分

注册会员

Rank: 2

积分
195
金钱
144
HASS币
0
发表于 2021-4-22 00:26:53 | 显示全部楼层
我要学习学习,这个便宜呀
回复

使用道具 举报

1

主题

13

帖子

154

积分

注册会员

Rank: 2

积分
154
金钱
141
HASS币
0
发表于 2021-4-22 10:13:28 | 显示全部楼层
找了很久,真是需要的,谢谢
回复

使用道具 举报

0

主题

41

帖子

248

积分

中级会员

Rank: 3Rank: 3

积分
248
金钱
207
HASS币
0
发表于 2021-4-22 10:22:29 | 显示全部楼层
感谢大佬分享!
回复

使用道具 举报

1

主题

50

帖子

195

积分

注册会员

Rank: 2

积分
195
金钱
144
HASS币
0
发表于 2021-4-29 20:41:55 | 显示全部楼层
BI8BRD 发表于 2020-6-13 18:10
我的配置文件没有const.py>这个文件

请问解决了吗?我是群晖docker装的esphome,也没有找到这个const.py
回复

使用道具 举报

1

主题

50

帖子

195

积分

注册会员

Rank: 2

积分
195
金钱
144
HASS币
0
发表于 2021-4-30 22:19:29 | 显示全部楼层
用树莓派装了一遍esphome ,/usr/local/lib/python3.7/dist-packages/esphome  在这里。
回复

使用道具 举报

1

主题

50

帖子

195

积分

注册会员

Rank: 2

积分
195
金钱
144
HASS币
0
发表于 2021-5-2 18:37:10 | 显示全部楼层
本帖最后由 kingmos 于 2021-5-2 19:07 编辑

本人属于小白,属于照着前辈脚印画瓢的


esp01s这么写的:
substitutions:
  device_name: masterpower  #设备名称
  wifi_ssid: "Ki6666te"    #WiFi_SSID名称
  wifi_password: "k6666g"    #WiFi密码
  wifi_ssid_AP: "ESPHOME"  
  wifi_password_AP: "ki6666g"  #ap_WiFi密码
  wifi_fast_connect: "true"   #如果SSID是隐藏的,设置为true
  wifi_reboot_timeout: 180s  #WiFi离线多久后重启设备,秒s/分钟min/小时h,不需要此功能设置为0s
  ota_password: "k6666g"    #OTA密码
  api_reboot_timeout: 600s  #与客户端(如Home Assistant)失去连接多久后重启设备,秒s/分钟min/小时h,不需要此功能设置为0s


esphome:
  name: $device_name
  platform: ESP8266
  board: esp01_1m

api:
  reboot_timeout: $api_reboot_timeout
ota:
captive_portal:

logger:
web_server:
wifi:
  ssid: $wifi_ssid
  password: $wifi_password
  manual_ip:
    static_ip: 192.168.111.216 ###根据你路由器地址,设置一个固定IP
    gateway: 192.168.110.1 ###根据你路由器网段填写
    subnet: 255.255.254.0  
  reboot_timeout: $wifi_reboot_timeout
  power_save_mode: none
  fast_connect: $wifi_fast_connect
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: $wifi_ssid_AP
    password: $wifi_password_AP



uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600
  stop_bits: 1

sensor:
  - platform: pzemac
    current:
      name: "${device_name}_Current"
    voltage:
      name: "${device_name}_Voltage"
    power:
      name: "${device_name}_Power"
    energy:
      name: "${device_name}_Energy"
    frequency:
      name: "${device_name}_Frequency"
    power_factor:
      name: "${device_name}_PowerFactor"
    update_interval: 60s


log是这样的:
INFO Reading configuration config/masterpower.yaml...
INFO Starting log output from 192.168.111.216 using esphome API
INFO Connecting to 192.168.111.216:6053 (192.168.111.216)
INFO Successfully connected to 192.168.111.216
[18:19:46][I][app:105]: ESPHome version 1.16.2 compiled on May  1 2021, 00:08:20
[18:19:46][C][wifi:443]: WiFi:
[18:19:46][C][wifi:303]:   SSID: [redacted]
[18:19:46][C][wifi:304]:   IP Address: 192.168.111.216
[18:19:46][C][wifi:306]:   BSSID: [redacted]
[18:19:46][C][wifi:307]:   Hostname: 'masterpower'
[18:19:46][C][wifi:311]:   Signal strength: -32 dB ▂▄▆█
[18:19:46][C][wifi:315]:   Channel: 1
[18:19:46][C][wifi:316]:   Subnet: 255.255.254.0
[18:19:46][C][wifi:317]:   Gateway: 192.168.110.1
[18:19:46][C][wifi:318]:   DNS1: (IP unset)
[18:19:46][C][wifi:319]:   DNS2: (IP unset)
[18:19:46][C][uart_esp8266:075]: UART Bus:
[18:19:46][C][uart_esp8266:077]:   TX Pin: GPIO1
[18:19:46][C][uart_esp8266:080]:   RX Pin: GPIO3
[18:19:46][C][uart_esp8266:081]:   RX Buffer Size: 256
[18:19:46][C][uart_esp8266:083]:   Baud Rate: 9600 baud
[18:19:46][C][uart_esp8266:084]:   Data Bits: 8
[18:19:46][C][uart_esp8266:085]:   Parity: NONE
[18:19:46][C][uart_esp8266:086]:   Stop bits: 1
[18:19:46][C][uart_esp8266:088]:   Using hardware serial interface.
[18:19:46][W][uart:041]:   You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0.
[18:19:46][C][modbus:096]: Modbus:
[18:19:46][E][uart:054]:   Invalid stop bits: Integration requested stop_bits 2 but you have 1!
[18:19:46][C][logger:185]: Logger:
[18:19:46][C][logger:186]:   Level: DEBUG
[18:19:46][C][logger:187]:   Log Baud Rate: 115200
[18:19:46][C][logger:188]:   Hardware UART: UART0
[18:19:46][C][pzemac:068]: PZEMAC:
[18:19:46][C][pzemac:069]:   Address: 0x01
[18:19:46][C][pzemac:070]: Voltage 'masterpower_Voltage'
[18:19:46][C][pzemac:070]:   Unit of Measurement: 'V'
[18:19:46][C][pzemac:070]:   Accuracy Decimals: 1
[18:19:46][C][pzemac:070]:   Icon: 'mdi:flash'
[18:19:46][C][pzemac:071]: Current 'masterpower_Current'
[18:19:46][C][pzemac:071]:   Unit of Measurement: 'A'
[18:19:46][C][pzemac:071]:   Accuracy Decimals: 3
[18:19:46][C][pzemac:071]:   Icon: 'mdi:current-ac'
[18:19:46][C][pzemac:072]: Power 'masterpower_Power'
[18:19:46][C][pzemac:072]:   Unit of Measurement: 'W'
[18:19:46][C][pzemac:072]:   Accuracy Decimals: 1
[18:19:46][C][pzemac:072]:   Icon: 'mdi:power'
[18:19:46][C][pzemac:073]: Energy 'masterpower_Energy'
[18:19:46][C][pzemac:073]:   Unit of Measurement: 'KwH'
[18:19:46][C][pzemac:073]:   Accuracy Decimals: 1
[18:19:46][C][pzemac:073]:   Icon: 'mdi:power'
[18:19:46][C][pzemac:074]: Frequency 'masterpower_Frequency'
[18:19:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[18:19:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[18:19:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[18:19:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[18:19:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[18:19:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[18:19:46][C][pzemac:075]:   Icon: 'mdi:flash'
[18:19:46][C][captive_portal:169]: Captive Portal:
[18:19:46][C][web_server:132]: Web Server:
[18:19:46][C][web_server:133]:   Address: 192.168.111.216:80
[18:19:47][C][ota:029]: Over-The-Air Updates:
[18:19:47][C][ota:030]:   Address: 192.168.111.216:8266
[18:19:47][C][api:095]: API Server:
[18:19:47][C][api:096]:   Address: 192.168.111.216:6053

1.现在还读不到数据,看来是esp有问题,应该怎么写呢?
2.[W][uart:041]:   You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0.
串口很忙吗,日志数据都读串口是不是没啥问题
3.[18:32:04][E][uart:054]:   Invalid stop bits: Integration requested stop_bits 2 but you have 1!
停止位是啥意思?
4.Message skipped because it was too big to fit in TCP buffer - This is only cosmetic
这是啥意思?
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-1-10 23:35 , Processed in 0.114293 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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