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

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

[插件集成] 支持HA2021.8.X能源功能的培正用电信息采集方案

  [复制链接]

0

主题

49

帖子

252

积分

中级会员

Rank: 3Rank: 3

积分
252
金钱
203
HASS币
0
发表于 2021-10-10 19:38:48 | 显示全部楼层
花落花空 发表于 2021-8-31 00:18
感谢大神的集成,之前用esphome读的培正,得自己搞月用电数据啥的。看到帖子试了下改成透传,很容易就成功 ...

这个可以多组吗?
回复

使用道具 举报

0

主题

49

帖子

252

积分

中级会员

Rank: 3Rank: 3

积分
252
金钱
203
HASS币
0
发表于 2021-10-10 20:10:39 | 显示全部楼层
esphome:
  name: pzem
  platform: ESP8266
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "qwq"

wifi:
  ssid: "Forfun"
  password: "12345679"

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

captive_portal:

#在这里添加UART的进一步配置
uart:
  - id: pzem004t1
    tx_pin: D3
    rx_pin: D1
    baud_rate: 9600
  - id: pzem004t2
    tx_pin: D4
    rx_pin: D2
    baud_rate: 9600  
    
external_components:
  - source: github://oxan/esphome-stream-server

stream_server:
  - uart_id: pzem004t1
    port: 1234
  - uart_id: pzem004t2
    port: 1235
回复

使用道具 举报

0

主题

49

帖子

252

积分

中级会员

Rank: 3Rank: 3

积分
252
金钱
203
HASS币
0
发表于 2021-10-10 20:18:37 | 显示全部楼层
本帖最后由 梅子青时 于 2021-10-10 20:37 编辑

好吧,插件不支持复用,添加俩透传端口也用不了,希望楼主能增加一下这个功能?多模块接入(复用)
回复

使用道具 举报

0

主题

49

帖子

252

积分

中级会员

Rank: 3Rank: 3

积分
252
金钱
203
HASS币
0
发表于 2021-10-12 11:13:08 | 显示全部楼层
BH4WHN 发表于 2021-9-6 20:43
经过一个星期的不断测试,发现硬件连接上存在DT-06电流倒灌到pzem-00t的可能,问题出现在DT-06 TX口->>>pze ...

俺也发现了,请问这个你解决了吗?
回复

使用道具 举报

4

主题

260

帖子

2669

积分

论坛积极会员

积分
2669
金钱
2409
HASS币
0
发表于 2021-10-13 07:54:49 | 显示全部楼层
梅子青时 发表于 2021-10-12 11:13
俺也发现了,请问这个你解决了吗?

已经解决了,在pzem 004t的rx到dt-06的tx之间串接10K-15K的电阻。
回复

使用道具 举报

0

主题

49

帖子

252

积分

中级会员

Rank: 3Rank: 3

积分
252
金钱
203
HASS币
0
发表于 2021-10-13 12:15:40 | 显示全部楼层
BH4WHN 发表于 2021-10-13 07:54
已经解决了,在pzem 004t的rx到dt-06的tx之间串接10K-15K的电阻。

nodemcu加个330Ω的电阻就差不多了,手头没有多余的电阻没有过多测试,对于noedmcu而言,10—15KΩ过大了
回复

使用道具 举报

0

主题

66

帖子

252

积分

中级会员

Rank: 3Rank: 3

积分
252
金钱
186
HASS币
0
发表于 2021-10-28 11:38:08 | 显示全部楼层
谢谢分享,学习一下
回复

使用道具 举报

15

主题

247

帖子

2065

积分

金牌会员

Rank: 6Rank: 6

积分
2065
金钱
1818
HASS币
0
发表于 2021-10-29 14:13:28 | 显示全部楼层
你好,江苏无锡,请问下电价实体怎么搞?
回复

使用道具 举报

0

主题

53

帖子

711

积分

高级会员

Rank: 4

积分
711
金钱
658
HASS币
0
发表于 2021-10-29 16:42:12 | 显示全部楼层
花落花空 发表于 2021-8-31 00:18
感谢大神的集成,之前用esphome读的培正,得自己搞月用电数据啥的。看到帖子试了下改成透传,很容易就成功 ...

我按照这个编译咋就报错了啊
In file included from src/esphome/components/stream_server/stream_server.cpp:17:0:
src/esphome/components/stream_server/stream_server.h: In member function 'void StreamServerComponent::set_uart_parent(esphome::uart::UARTComponent*)':
src/esphome/components/stream_server/stream_server.h:37:80: error: cannot convert 'esphome::uart::UARTComponent*' to 'Stream*' in assignment
     void set_uart_parent(esphome::uart::UARTComponent *parent) { this->stream_ = parent; }
                                                                                ^
src/esphome/components/stream_server/stream_server.cpp: In member function 'void StreamServerComponent::read()':
src/esphome/components/stream_server/stream_server.cpp:59:65: error: 'min' was not declared in this scope
         size_t read = this->stream_->readBytes(buf, min(len, 128));
                                                                 ^
src/esphome/components/stream_server/stream_server.cpp:59:65: note: suggested alternative:
In file included from /config/.esphome/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/4.8.2/algorithm:62:0,
                 from src/esphome/core/optional.h:19,
                 from src/esphome/core/component.h:7,
                 from src/esphome/components/stream_server/stream_server.h:19,
                 from src/esphome/components/stream_server/stream_server.cpp:17:
/config/.esphome/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/4.8.2/bits/stl_algo.h:4226:5: note:   'std::min'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^
In file included from src/esphome/components/uart/uart.h:6:0,
                 from src/esphome/components/stream_server/stream_server.h:20,
                 from src/esphome/components/stream_server/stream_server.cpp:17:
src/esphome/components/stream_server/stream_server.cpp: In member function 'virtual void StreamServerComponent::dump_config()':
src/esphome/components/stream_server/stream_server.cpp:75:64: error: 'network_get_address' was not declared in this scope
     ESP_LOGCONFIG(TAG, "  Address: %s:%u", network_get_address().c_str(), this->port_);
                                                                ^
src/esphome/core/log.h:97:90: note: in definition of macro 'esph_log_config'
   esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                          ^
src/esphome/components/stream_server/stream_server.cpp:75:5: note: in expansion of macro 'ESP_LOGCONFIG'
     ESP_LOGCONFIG(TAG, "  Address: %s:%u", network_get_address().c_str(), this->port_);
     ^
Compiling .pioenvs/pzem/src/esphome/core/entity_base.cpp.o
*** [.pioenvs/pzem/src/esphome/components/stream_server/stream_server.cpp.o] Error 1
========================== [FAILED] Took 7.08 seconds ==========================
回复

使用道具 举报

3

主题

52

帖子

472

积分

中级会员

Rank: 3Rank: 3

积分
472
金钱
420
HASS币
0
发表于 2021-11-26 16:53:07 | 显示全部楼层
zxyny1989 发表于 2021-8-23 03:38
没找到8266透传的资料,还是某宝直接入手DT 06模块了,省心。

好,最近准备弄下电量计量的,“还是某宝直接入手DT 06模块了”。这个你买的哪一家的?多谢
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-21 19:44 , Processed in 0.059668 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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