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

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

网络继电器--Modbus

  [复制链接]

0

主题

5

帖子

49

积分

新手上路

Rank: 1

积分
49
金钱
44
HASS币
0
发表于 2024-4-8 09:30:51 | 显示全部楼层

学习学习~~~
回复

使用道具 举报

0

主题

80

帖子

387

积分

中级会员

Rank: 3Rank: 3

积分
387
金钱
307
HASS币
0
发表于 2024-4-8 22:11:07 | 显示全部楼层
nice, thanks!!
回复

使用道具 举报

0

主题

80

帖子

387

积分

中级会员

Rank: 3Rank: 3

积分
387
金钱
307
HASS币
0
发表于 2024-4-8 22:23:04 | 显示全部楼层
剛好最近在研究 HA -> 485
提供 Progs Pont 寫的流程 https://www.youtube.com/watch?v=hw3m3GAoCeM
Modbus RTU to Home Assistant with TTL to RS485 electronic card and ESP01 Relay (Soft and Hard)

簡要內容, 準備 ESP01_單Relay , TTL->RS485 轉換板.... 連接 TTL -> ESP01
ESPHOME 建立 MODBUS by 8266
儲存下面code 並安裝
(logger:
  baud_rate: 0
及MODBUS 固定IP位址)


# Configure static ip
  manual_ip:
    static_ip: 192.168.1.xxx # Replace xxx with the chosen static ip
    gateway: 192.168.1.1
    subnet: 255.255.255.0

captive_portal:

# ++++++++++ Output relay +++++++++++
switch:
  - platform: gpio
    pin:
      number: GPIO00  
      inverted: True
    name: "Relay Modbus"
    id: relay_modbus   


# ++++++++++Conf MODBUS  RS485 ++++++++++++
uart:
  id: mod_bus
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 4800
  parity: NONE
  stop_bits: 2

modbus:  
  id: modbus1

modbus_controller:
  - id: SmartMetter
    ## the Modbus device addr
    address: 0x1
    modbus_id: modbus1
    setup_priority: -10


sensor:

#  Sensors SmartMetter
- platform: modbus_controller
  modbus_controller_id: SmartMetter
  id: pv_input_voltage
  name: "PV array input voltage"
  address: 0x003E
  unit_of_measurement: "V"
  register_type: read
  value_type: U_DWORD
  accuracy_decimals: 3
  filters:
    - multiply: 0.001

- platform: modbus_controller
  modbus_controller_id: SmartMetter
  id: pv_input_current
  name: "PV array input current"
  address: 0x003C
  unit_of_measurement: "A"
  register_type: read
  value_type: S_DWORD
  accuracy_decimals: 2
  filters:
    - multiply: 0.001

- platform: modbus_controller
  modbus_controller_id: SmartMetter
  id: wifi_smart_meter_total_energy
  name: "Smart meter total energy"
  address: 0x0200
  state_class: total_increasing
  unit_of_measurement: "kWh"
  register_type: read
  value_type: U_QWORD
  accuracy_decimals: 2
  filters:
    - multiply: 0.0001

- platform: modbus_controller
  modbus_controller_id: SmartMetter
  id: comptador_consum
  name: "Comptador consum"
  address: 0x0200
  state_class: "total_increasing"
  unit_of_measurement: "kWh"
  register_type: read
  value_type: U_QWORD
  accuracy_decimals: 2
  filters:
    - multiply: 0.0001

- platform: modbus_controller
  modbus_controller_id: SmartMetter
  id: comptador_injeccio
  name: "Comptador injecció"
  address: 0x0204
  state_class: total_increasing
  unit_of_measurement: "kWh"
  register_type: read
  value_type: U_QWORD
  accuracy_decimals: 2
  filters:
    - multiply: 0.0001

- platform: modbus_controller
  modbus_controller_id: SmartMetter
  id: consum_intantani
  name: "Consum intantaní"
  address: 0x0000
  unit_of_measurement: "W"
  register_type: read
  value_type: U_DWORD
  accuracy_decimals: 1
  filters:
    - multiply: 0.1

- platform: modbus_controller
  modbus_controller_id: SmartMetter
  id: injeccio_intantani
  name: "Injecció intantaní"
  address: 0x0002
  unit_of_measurement: "W"
  register_type: read
  value_type: U_DWORD
  accuracy_decimals: 1
  filters:
    - multiply: 0.1




回复

使用道具 举报

0

主题

4

帖子

24

积分

新手上路

Rank: 1

积分
24
金钱
20
HASS币
0
发表于 2024-5-5 19:31:31 | 显示全部楼层
ed系列教程之二 使用Node Red建立第一个Flow [修改]
回复

使用道具 举报

0

主题

14

帖子

155

积分

注册会员

Rank: 2

积分
155
金钱
141
HASS币
0
发表于 2024-5-8 22:32:05 | 显示全部楼层
好用不
进来学习一下
回复

使用道具 举报

0

主题

13

帖子

129

积分

注册会员

Rank: 2

积分
129
金钱
116
HASS币
0
发表于 2024-5-20 15:24:42 | 显示全部楼层
研究下,看看能不能弄得来
回复

使用道具 举报

0

主题

15

帖子

68

积分

注册会员

Rank: 2

积分
68
金钱
53
HASS币
0
发表于 2024-5-20 23:06:52 | 显示全部楼层
let me see see
回复

使用道具 举报

0

主题

20

帖子

482

积分

中级会员

Rank: 3Rank: 3

积分
482
金钱
462
HASS币
0
发表于 2024-5-21 08:42:01 | 显示全部楼层
進來學習
回复

使用道具 举报

0

主题

33

帖子

232

积分

中级会员

Rank: 3Rank: 3

积分
232
金钱
199
HASS币
0
发表于 2024-5-28 20:24:00 | 显示全部楼层
谢谢谢谢
回复

使用道具 举报

0

主题

5

帖子

50

积分

注册会员

Rank: 2

积分
50
金钱
45
HASS币
0
发表于 2024-5-28 21:06:09 | 显示全部楼层

进来学习一下
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-2-2 15:04 , Processed in 0.088588 second(s), 29 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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