向社区问候。

我打开了这个主题,要求您提供配置继电器板R421A08的帮助
图片
我的配置:
覆盆子PI2,


这是RS485适配器的USB
图片
(该适配器与Raspberry + Hassio配合得很好,因为我使用它来读取Eastron SDM220-modbus的能源消耗数据。图片

我做了一些测试,无法进行R421A08继电器卡工作。
我使用了“ modbus Switch”,但我没有成功。

在网络上,我发现可以帮助我们:

https://forum.logicmachine.net/showthread.php?tid=1403

你们中有些人比我能为我提供更多的专家,并用编写代码来帮助我?
非常感谢你。

  1. 安装GitHub代码

  2. 通过命令行组件控制。

感谢您的答复,但我仍然不明白我要做什么。你可以帮帮我吗?

我跟随…

我试图做很多测试。
我更改了登记册,但我从未成功。

对于登记册,我遵循以下链接:




https://forum.logicmachine.net/showthread.php?tid=1403

评论中有些寄存器。

我究竟做错了什么?
我看到沟通有时会闪烁。
这是加载的最后一个代码:

modbus:类型:串行方法:rtu port: /dev /ttyusb0 baudrate:9600 stopbits:1 bytesize:8偶然性:n switch:n switch:platform:modbus slave:1 coils:1 coils: -  name:r1 slave:r1 slave:1 coil:1 40101-名称:r2:r2:r2:r2:r2从:1线圈:40002寄存器: - 名称:R3从:1寄存器:40002 command_on:1 Command_off:0-名称:R4 Slave:1寄存器:1寄存器:40003 Command_on:1280 Command_off:0-名称:R5 Slave:1寄存器:1寄存器:401044寄存器:401044Command_on:01 Command_off:00-名称:R6从:1寄存器:01 Command_on:1 Command_off:0

请有人可以帮我吗?
非常感谢你。

我也有同样的问题。
有人有解决方案吗?
此设备接管功能预设多个寄存器(FC = 16),但是HA写入寄存器预设单寄存器(FC = 06)
有人知道在HA中实现此功能吗?

我找到了一个有效的解决方案,但我没有从继电器模块中获得反馈。

我在Python中写了一个脚本,该脚本使用了Mobuspy,并通过命令行中的HomeasSistantt中的按钮调用。
我的文件调用8o.py,ID RS485为7。

我在Python中的scripy:
#!/usr/bin/python

#-----------------------------------------------------------------------------------------------------------------##导入各种服务器实现#-------------------------------------------------------------------------------------------------------------------------------------# from pymodbus.client.sync import ModbusTcpClient as ModbusClient # from pymodbus.client.sync import ModbusSerialClient as ModbusClient from pymodbus.transaction import ModbusRtuFramer as ModbusFramer #----------------------------------------------------------------------------------------------------------------##配置客户端记录#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#导入记录导入sys#parametros de entrada pray = int(sys.argv [1])value = int(sys.argv [2])loggging.basicconfig()log = logging.getLogger()logselevel(logging.debug)#define #define #define #definemodbus target设备client = modBusClient(host ='192.168.1.10',port = 502)connection = client.connect()print(Connection(connection)#将写入命令发送到modbus Server#600 = off 300 = off 300 = on Register_value = client.write.write.register.write.register(继电器,价值E,单位= 7)客户端()#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------#

在configuration.yaml中:

  • 平台:command_line
    开关:
    switch_1:
    command_on:‘python3 /config/8o.py 1 300'
    command_off:‘python3 /config/8o.py 1 600'

请遵循页面顶部的说明,并正确格式化您的代码。

Windows应用STM8S103和R421A085模块

使用此实用程序切换继电器设置。Windows 7的理想选择。

用MS Visual Studio Win32 C ++编写。

https://sourceforge.net/projects/rs485modbus/

这与家庭助理有什么关系?19463331伟德国际

对于4频道4CH Modbus RTU继电器模块4 CH继电器模块RS485
在configuration.yaml中:

modbus: - 类型:串行名称:Hubrelay方法:RTU端口: /dev /ttyusb1 baudrate:9600 stopbits:1 bytesize:8 Parity:n Parity:n超时:1个switch: - 平台: -  modbus regemisters: -  modbus registers: -  name:relay1 Hub:relay1 Hub:Hubrelay Slave:HubReLay Slave:Hubrelay Slave:Hubrelay Slave:hubrelay从:1寄存器:1 Command_on:256 Command_off:512 State_on:1 State_off:0-名称:Relay2 Hub:Hubrelay Slave:1寄存器:2 command_on:256 command_off:512 state_onf:1 state_off:1 state_off:1 state_off:0-名称:relay3 Hub 3 Hub:Hubrelay Slave:Hubrelay Slave:Hubrelay Slave::Hubrelay Slave::Hubrelay Slave::1寄存器:3 Command_on:256 Command_off:512 State_on:1 State_off:0-名称:Relay4 Hub:Hubrelay Slave:1寄存器:4 Command_on:256 command_off:512 state_on:1 state_off:1 state_off:0 state_off:0

感谢Alleonname与我们分享您的配置,它立即为我使用R4D3B16:

modbus: - 类型:串行名称:Hubrelay方法:RTU端口: /dev /ttyusb0 baudrate:9600 stopbits:1 bytesize:8 Parity:n Parity:n超时:1个switch: - 平台: -  modbus regemisters: -  modbus registers: -  name:relay1 Hub:relay1 Hub:Hubrelay Slave:HubReLay Slave:HubReLay Slave:Hubrelay Slave:hubrelay Slave:hubrelay Slave:hubreay slave:hubrelay slave:hubrelay从:1寄存器:1 Command_on:256 Command_off:512 State_on:1 State_off:0-名称:Relay2 Hub:Hubrelay Slave:1寄存器:2 command_on:256 command_off:512 state_onf:1 state_off:1 state_off:1 state_off:0-名称:relay3 Hub 3 Hub:Hubrelay Slave:Hubrelay Slave:Hubrelay Slave::Hubrelay Slave::Hubrelay Slave::1寄存器:3 Command_on:256 Command_off:512 State_on:1 State_off:0-名称:Relay4 Hub:Hubrelay Slave:1寄存器:4 Command_on:256 Command_off:512 State_Off:512 state_off:1 state_off:1 state_off:1 state_off:0-名称:relay5 Hub 5 Hub:Hubrelay Slave:Hubrelay Slave:Hubrelay Slave::Hubrelay Slave::Hubrelay Slave::1寄存器:5 Command_on:256 Command_off:512 State_on:1 State_off:0-名称:Relay6 Hub:Hubrelay Slave:1寄存器:1命令:6 command_on:256 command_off:512 state_off:512 state_off:1 state_off:1 state_off:0-名称:relay7 Hub:relay7 Hub:Hubrelay Slave:Hubrelay Slave::Hubrelay Slave::Hubrelay Slave::Hubrelay Slave::1寄存器:7 Command_on:256 Command_off:512 State_on:1 State_off:0-名称:Relay8 Hub:Hubrelay Slave:1寄存器:8 Command_on:256 Command_off:512 state_on:1 state_off:0- name: Relay9 hub: hubrelay slave: 1 register: 9 command_on: 256 command_off: 512 state_on: 1 state_off: 0 - name: Relay10 hub: hubrelay slave: 1 register: 10 command_on: 256 command_off: 512 state_on: 1 state_off: 0 - name: Relay11 hub: hubrelay slave: 1 register: 11 command_on: 256 command_off: 512 state_on: 1 state_off: 0 - name: Relay12 hub: hubrelay slave: 1 register: 12 command_on: 256 command_off: 512 state_on: 1 state_off: 0 - name: Relay13 hub: hubrelay slave: 1 register: 13 command_on: 256 command_off: 512 state_on: 1 state_off: 0 - name: Relay14 hub: hubrelay slave: 1 register: 14 command_on: 256 command_off: 512 state_on: 1 state_off: 0 - name: Relay15 hub: hubrelay slave: 1 register: 15 command_on: 256 command_off: 512 state_on: 1 state_off: 0 - name: Relay16 hub: hubrelay slave: 1 register: 16 command_on: 256 command_off: 512 state_on: 1 state_off: 0

嗨,我买了一个Modbus RTU继电器(WaveShare)。
我在RASPB中安装了USB适配器(应该直接识别它在帖子中。
要激活Realay 1,我必须发送十六进制:01 05 00 06 FF 00 6C 3B。
我能怎么做?
谢谢

我试图阅读。
但是我如何发送十六进制01 05 00 06 ff 00 6c 3b激活继电器?

您确定这是Modbus吗?

是的。
我使用“注册”和“命令”,但不使用01 05 00 ECC。

:kissing_smiling_eyes:我设法使用-CALL Service-功能激活继电器:
modbus.write_coil
单元1
集线器:Hubrelay
地址2
状态:1

但就我而言,-switch-和-Binary传感器 - modbus-不起作用
所以我无法阅读继电器的状态

你的...是binary_sensor:yaml?

在configuratio.yalm中

binary_sensor:

  • 平台:modbus
    输入:
    • 名称:Sensor1
      集线器:Hubrelay
      奴隶:1
      地址:3

:思维:功能和读取线圈?