Carte relais HHC-N8I80P

Bonjour,
J’ai acheté une carte relais IO que je voudrais intégrer dans jeedom mais je ne trouve pas de plugin la faisan fonctionner. Est-ce que quelqu’un a déjà réussi à l’intégrer ?
Si quelqu’un pouvait m’aider, je vous remercies.

Fabien

WanRomJun Module De Relais De Qualité Industrielle 1 Pièces HHC-N8I8OP, Module De Relais Réseau DC7~24V 8 Canaux, Dispositif De Relais De Télécommande Ethernet vers RS485

HHC-N8I8OP Instructions

Electrical parameters

1.Power supply DC 7-24 volts, can choose DC seat or terminal input power supply, DC connector specifications 5.5-2.1MM (external diameter-internal diameter) with 5.5-2.5MM input will lead to poor contact. There will be no lights on and off, communication can not be connected.

2.The working temperature range of the board is - 40 to 85 degrees Celsius.

3.8 independent relay output, output without voltage. The DC rating of a single relay is 10A, the AC rating is 10A, the maximum AC rating is 250V, and the maximum DC rating is 30V. Do not exceed the rated value in the use process, and leave a margin in use. The relay has three contacts, which are normally open (NO on product screen printing) contacts, normally closed contacts (NC) and common contacts (COM) followed by the digital channel of the relay. (Relay wiring refers to the appendix at the end of this manual)

4.10 channels input independently. IN9 means full switching, IN9 has switching input, all relays are suction, IN10 means full switching, when IN10 has transmission, all relays are closed. IN1-IN8 is an eight-way input tool that users can configure to work in three different ways by configuring parameter tools. They can choose under the « input mode » of configuring tools. In order to acquire the input state, a command to read the input state should be sent to the device. « Trigger relay » mode, this mode has input, the corresponding relay state flips, IN1-IN8 control corresponding to 1-8 relay. « Active Upload » mode, which actively sends input status to the network connected to the device when the input changes.

5.The device has an RS485 interface. It can be controlled by RS485 equipment from other manufacturers. It is possible to achieve clear transmission of network data to RS485 data, and the baud rate 300-115200 can be configured. When parity checking is used, data bits must be allocated to 9 bits, and serial port parameters are configured through configuration tools.

6.The device has power-down saving function, which can save the status of the relay and can be configured by configuration tools.

7.Reset configuration. The position of RESET is the key to restore the factory settings. Restore the factory settings steps: first power off, then hold down the reset button, and then power the product, 10 seconds later release the button, and then re-power. The default IP is 192.168.0.105.

Parameter configuration

Open the configuration software, select the network card, and click the « Search » button. After searching for the device, the interface is as follows.

The image above searches for a device with an IP of 192.168.0.105, and double-clicks the IP to read device parameters. Then you can modify the device parameters.

Modify the parameters of the device and click the « SAVE » button. If the settings are successful, the device success dialog box will pop up. As shown in the following figure.

Configuration interface description

A complete configuration interface is shown in the following figure.

Network Card:The drop-down menu lists all the network cards of the computer.

Equipment list:It consists of device name and device IP. Searched devices are displayed here. Click the « CLEAR » button to clear the list of devices.

Mode**:**Devices can work in TCP server, TCP client, UDP server, UDP client and DNS. In DNS mode, the device interprets the domain name in the « domain name » box and gets the IP address. After the device connects the remote TCP server with the TCP client, the remote port is the port of the remote TCP server.

Local IP:Device IP.

Destination IP**:**The device works on the TCP client or UDP client and connects to the IP of the remote host. In other ways, this parameter is invalid.

Local Port**:**Port of device switching quantity (control relay output and read switching quantity input). The device is equipped with RS485 port (realizing transparent transmission from network to RS485). In order to facilitate data transmission, the network port of RS485 adds 1 to the device port value. For example, this port value is 5000. Then 5001 is the network port of RS485. The data sent to the 5001 port will come from RS485.

Destination Port**:**The device works on the port of the remote host connected to the TCP client or UDP client or DNS domain name mode. In other ways, this parameter is invalid. This port is the remote port of the switching quantity, and this value plus 1 is the remote port of the RS485 network.

Subnet Mask**:**The subnet mask of the device.

Gateway**:**Gateway of equipment.

Implementor name**:**The device name can be customized. It can be digitally or alphabetically or in Chinese.

Physical address**:**Default value 485300575500,The use of multiple devices is modified to be different, the first 48 should not be changed, other locations can be changed at will.

Input Mode**:**There are three input modes: Ordinary mode,trigger mode and Automatic mode. Ordinary mode is the input of IN1-IN8, which is a common acquisition input. In the Trigger mode, the IN1-IN8 input triggers the corresponding 8-way relay. In the Automatic mode, when the input state of IN1-IN8 changes, it will actively send the state to the connected network.

Domain name:In the case of interconnection, if the remote host IP binds the domain name, the domain name can be used to connect, and the « DNS » mode of operation is selected.

Automatic acquisition of IP**:**If this option is checked, the router should turn on the automatic IP allocation function, otherwise it will not be able to use because the device can not automatically get the correct IP.

Power-off Preservation**:**If this option is checked, the status of the relay will be saved after power failure. Power on will restore the state of the relay.

Serial port parameters **:**The baud rate range is 300-115200. There are three ways of checking: odd check, parity check and no check. When using checking, data bits should be added one bit, for example, the original 8-bit communication mode without checking is used. If using odd or even checking, the data bits should be set to 9 bits. Otherwise, it will lead to incorrect communication.

MODBUS TCP**:**When this option is checked, the transparent transmission from Ethernet to RS485 becomes the conversion from MODBUS TCP to MODBUS RTU.

Time Interval:The interval between circulating heartbeat packets in seconds.

Content**:**The content of the heartbeat package can be customized. The content can be a combination of numbers, letters, numbers and letters. The heartbeat packet is sent to all connected networks at the same time.

Detection time**:**Communication detection time, in seconds, (if set too small, will lead to cycle restart) If no data is received during the set heartbeat time, the device will be forced to restart. This function can cooperate with heartbeat packet to realize network detection. For example, set the heartbeat packet to 5 seconds and the communication detection to 1 minute. When the connected network receives the heartbeat packet, it responds to a valid command (such as read) to realize online detection. If this value is 0, this function is turned off.

Command interpretation

The above commands are sent and received in character form. No carriage return, no space after command. To send the hexadecimal system, the ASCII code table should be converted by itself.

Get device name

Send:name

Return: name = « HHC-N8I8OP »

HHC-N8I8OP is the device name and can be configured by configuration tools.

Turn o****n channel 1 relay

Send:on1

Return:on1

Turn o****ff channel 1 relay

Send:off1

Return:off1

The command format is on and off followed relay channel, 2-8 control is the same as above.

Control all relays at the same time

Send: all00000011

Return: relay 00000011

1 means turn on, 0 means turn off, the above instructions indicate that the channel l relay turn on with the channel 2 relay, and channel third-eighth relay is turn off. This instruction returns to the state of the relay after execution. The state return information of the relay is the same as that of the read instruction.

Time delay control

Send: on1:02

Return: on1

In the above instructions, the relay will be turn off after 2 seconds, on1: the relay to be controlled, followed by a delay time of 99 seconds. For example, on2:12 means that the channel 2 relay will be turn off after 12 seconds. The other 2-8 control is the same as above.

Read relay status

Send:read

Return: relay 00000001 (state of 8-channe relay, channel 1 relay turn on, Other channels turn off)

Read Switch Input

Send:input

Return: input00000001

Input followed by 00000001, 1 means switching input, 0 means no switching input, 8-way switching input state, the above instructions indicate that the first way has switching input, 2-8 channels have no switching input. The switching quantities of the 9th and 10th routes are used to control the full switching and full switching of the relay, which can not be read. The input is configured as Automatic mode. When the switch changes the input, the return information will be sent automatically.

MODE description

Test environment: computer system WINDOWS 10, 64 bit system, computer IP, 192.168.0.100, gateway 192.168.0.1, subnet mask 255.255.255.0

TCP Service

Connect the Port of device switching quantity and send on1 to turn on channel 1 relay.

Connect RS485 network port, because RS485 network port is the Port of device switching quantity plus 1, so from the figure above you can get RS485 network port is 5001.

Send ABCD to port 5001, and data ABCD comes out from port RS485.

TCP Client

The configuration parameters above show that the IP of the remote server is 192.168.0.100 and the remote port is 5000. Then we have to create two ports on IP’s 192.168.0.100 computer. 5000 and 5001.(the Port of device switching quantity and RS485 network port)

UDP Service

The device configuration parameters are shown in the following figure.

the Port of device switching quantity connection is shown in the following figure.

The connection mode of RS485 network port is shown in the following figure.

UDP Client

The device configuration parameters are shown in the following figure.

the Port of device switching quantity connection is shown in the following figure.

The connection mode of RS485 network port is shown in the following figure.

DNS

Fill in the domain name in the domain name input box, the device will interpret the actual IP of the domain name, and then the device works in the way of TCP client to connect the TCP server where the domain name is located. Refer to page 8 for how TCP works.

Wiring instructions

1.Keystroke input

2**.**5V input

3.1****2V input

**4.**Relay wiring

Bonjour,

Comment pilotez vous les relais aujourd’hui ?

À+
Michel

Bonjour,

Voici une capture du programme pour le paramétrer et l’autre pour le commander.

Merci

Bonjour

Cela ce gère avec un plugin pour le modbus. Il y a en plusieurs, plus ou moins bon.

Il aurait fallu ce poser cette question avant achat.

Antoine

1 « J'aime »

Bonjour,
J’avais vu qu’il prenait le Modbus donc je pensais que j’arriverais a m’en sortir mais j’ai essayé le plugin MyModbus et je n’y arrive pas.

Voici ce que j’ai paramétré.


A mon avis je ne rentre pas les bonnes infos dans mon action.

Citation
File « /usr/lib/python3.10/threading.py », line 953, in run
self._target(*self._args, **self._kwargs)
File « /var/www/html/plugins/mymodbus/ressources/mymodbus_demond.py », line 161, in polling_thread
rr = client.read_holding_registers(int(hreg_first),i,unit=args.unid)
File « /usr/local/lib/python3.10/dist-packages/pymodbus/client/common.py », line 114, in read_holding_registers
return self.execute(request)
File « /usr/local/lib/python3.10/dist-packages/pymodbus/client/sync.py », line 109, in execute
return self.transaction.execute(request)
File « /usr/local/lib/python3.10/dist-packages/pymodbus/transaction.py », line 174, in execute
response, last_exception = self._transact(
File « /usr/local/lib/python3.10/dist-packages/pymodbus/transaction.py », line 271, in _transact
packet = self.client.framer.buildPacket(packet)
File « /usr/local/lib/python3.10/dist-packages/pymodbus/framer/socket_framer.py », line 207, in buildPacket
packet = struct.pack(SOCKET_FRAME_HEADER,
struct.error: ubyte format requires 0 <= number <= 255
[2024-12-24 00:05:17] ERROR : Connection to (192.168.1.246, 5000) failed: timed out
[2024-12-24 00:05:27] ERROR : Connection to (192.168.1.246, 5000) failed: timed out
Exception in thread Thread-12 (polling_thread):
Traceback (most recent call last):
File « /usr/lib/python3.10/threading.py », line 1016, in _bootstrap_inner
self.run()
File « /usr/lib/python3.10/threading.py », line 953, in run
self._target(*self._args, **self._kwargs)
File « /var/www/html/plugins/mymodbus/ressources/mymodbus_demond.py », line 161, in polling_thread
rr = client.read_holding_registers(int(hreg_first),i,unit=args.unid)
File « /usr/local/lib/python3.10/dist-packages/pymodbus/client/common.py », line 114, in read_holding_registers
return self.execute(request)
File « /usr/local/lib/python3.10/dist-packages/pymodbus/client/sync.py », line 108, in execute
raise ConnectionException(« Failed to connect[%s] » % (self.str()))
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Failed to connect[ModbusTcpClient(192.168.1.246:5000)]
[2024-12-24 00:05:44] ERROR : Connection to (192.168.1.246, 5000) failed: timed out
[2024-12-24 07:02:13] INFO : Debut de l action /usr/bin/python3 /var/www/html/plugins/mymodbus/ressources/mymodbus_write.py --host=192.168.1.246 --protocol=tcpip --port=5000 --baudrate=0 --unid=485300575500 --wsc=20 --value=hhc_r4 2>&1
[2024-12-24 07:05:52] INFO : Debut de l action /usr/bin/python3 /var/www/html/plugins/mymodbus/ressources/mymodbus_write.py --host=192.168.1.246 --protocol=tcpip --port=5000 --baudrate=0 --unid=485300575500 --wsc=20 --value=hhc_r4 2>&1
[2024-12-24 07:06:01] INFO : Debut de l action /usr/bin/python3 /var/www/html/plugins/mymodbus/ressources/mymodbus_write.py --host=192.168.1.246 --protocol=tcpip --port=5000 --baudrate=0 --unid=485300575500 --wsc=20 --value=hhc_r4 2>&1
[2024-12-24 07:38:41] INFO : Debut de l action /usr/bin/python3 /var/www/html/plugins/mymodbus/ressources/mymodbus_write.py --host=192.168.1.246 --protocol=tcpip --port=5000 --baudrate=0 --unid=485300575500 --wsc=20 --value=hhc_r4 2>&

Mais pourquoi ne pas l’écrire dans le premier message?

2 « J'aime »

Je vous conseille la version bêta de MyModbus, pour la compatibilité c’est mieux. Cette version remplacera la version stable prochainement (il faut que je m’y colle).
Avez-vous un lien vers une documentation pour cette carte relais ?

Bonjour,

J’ai pas trouvé plus d’info que ce qui est marqué dans les précédents messages mais je viens de m’apercevoir qu’il est pris en charge par Home Assistant, je sais pas si ce que je met ci-dessous veut dire quelque chose.

Home assistant - modbus - HHC-N8I8OP



It is important to have verify delay big to not break logic.

 modbus:
  - type: tcp
    host: 192.168.222.222
    port: 5000
    name: "modbus1"
    switches:
      - name: "hhc_r8"
        address: 16
        write_type: coil
        verify:
          delay: 36
      - name: "hhc_r7"
        address: 17
        write_type: coil
        verify:
          delay: 37
      - name: "hhc_r6"
        address: 18
        write_type: coil
        verify:
          delay: 39
      - name: "hhc_r5"
        address: 19
        write_type: coil
        verify:
          delay: 48
      - name: "hhc_r4"
        address: 20
        write_type: coil
        verify:
          delay: 28
      - name: "hhc_r3"
        address: 21
        write_type: coil
        verify:
          delay: 33
      - name: "hhc_r2"
        address: 22
        write_type: coil
        unique_id: "inwater_2"
        verify:
          address: 22
          input_type: coil
          delay: 18
      - name: "hhc_r1"
        address: 23
        write_type: coil
        unique_id: "inwater_1"
        verify:
          address: 23
          input_type: coil
          delay: 18
    binary_sensors:
      - name: "hhc_i1"
        address: 32
        # scan_interval: 1
        input_type: discrete_input
      - name: "hhc_i2"
        address: 33
        # scan_interval: 1
        input_type: discrete_input
      - name: "hhc_i3"
        address: 34
        scan_interval: 1
        input_type: discrete_input
        unique_id: "water_alarm_service_room"
      - name: "hhc_i4"
        address: 35
        # scan_interval: 1
        input_type: discrete_input
      - name: "hhc_i5"
        address: 36
        # scan_interval: 1
        input_type: discrete_input
      - name: "hhc_i6"
        address: 37
        # scan_interval: 1
        input_type: discrete_input
      - name: "hhc_i7"
        address: 38
        # scan_interval: 1
        input_type: discrete_input
      - name: "hhc_i8"
        address: 39
        # scan_interval: 1
        input_type: discrete_input

Effectivement c’est du modbus.
Vous avez utilisé l’étiquette du plugin Modbus officiel et vous parlez de MyModbus.
Décidez vous sur le plugin que vous voulez utiliser, si c’est MyModbus, installez la version bêta je pourrai vous aider à configurer ça, mais plus ce soir.

Par ailleurs je crois me souvenir qu’un utilisateur avait une carte relais équivalente et s’est décidé à utiliser un plugin mQTT. Je ne me souviens plus qui ni quand…

Vous vous servez des entrées aussi ?

C’est le plugin mymodbus, je l’ai passé en Beta comme vous me l’avez conseillé. Je voudrait utiliser aussi les entrées.

Mais effectivement je vais arrêter aussi pour ce soir. Bonne Fête de Noel.

Merci

Dans ce cas, il faudrait utiliser la bonne étiquette dans le premier message.

Ça a l’air facile à configurer a première vue.
Il faut activer une option pour que le modbus soit utilisable ? Ça peut être bloquant si jamais.

Selon la config HA, les relais ont les adresses 16 à 23, mais 23 correspondrait au relais n°1. Ce point est à vérifier/tester. Si c’est effectivement le cas, voilà la configuration pour un relais que je vous propose pour le relais 1 :

Pour les entrées, les adresses vont de 32 à 39 mais sans inversion, donc pour l’entrée 1 :

Ces configurations sont à copier/adapter en fonction de vos besoins.

La configuration de l’équipement peut rester celle par défaut avec la bonne adresse IP et le bon n° de port :

Veuillez me dire si tout est OK avec ça.

Bonsoir,

Merci beaucoup pour votre aide, ça fonctionne exactement comme vous l’avez dit.
Pour info je complète que l’entrée 9 active tous les relais et l’entrée 10 désactive tous les relais (c’est d’origine et non modifiable).


Merci et bonne soirée.

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.