Home Assistant Modbus Slave
Articolo

Home Assistant Modbus Slave comes to HACS and opens entities to Modbus TCP devices

Home Assistant Modbus Slave enters the HACS repository: allows PLC and SCADA to read entities via Modbus TCP without gateway.

A custom integration allows you to makehomeAssistant accessible to devices that communicate via Modbus TCP, without adding an intermediate gateway. The Home-Assistant-Modbus-Slave project has been integrated into the official HACS repository, although the author warns that it may take a few days before it appears in the catalog. The goal is to allow PLCs, SCADA systems and energy managers to directly read the status of Home Assistant entities through Modbus registers, configured from the graphical interface.

Home Assistant Modbus Slave enters the HACS repository

The author announced on thecommunityof Home Assistant that the project has been accepted into the official HACS repository. The integration arises from a specific need: to make the values ​​of the Home Assistant entities available to other devices that already support Modbus TCP, avoiding a dedicated gateway.

Inclusion in the repository does not necessarily mean that the integration is already visible to everyone: the message indicates a possible interval of a few days before its appearance. A precise date for availability in the catalog has not been communicated.

How reading entities via Modbus TCP works

Once the integration has been added, the slave identifier and the listening port are set, which by default is 502. The entities to be exposed are then selected and a register address is assigned to each. Configuration takes place entirely via interface, without the project description requiring an external gateway.

The device acting as Modbus master can then read the values ​​of the mapped entities. According to the author, the registry immediately reflects state changes: an internal polling mechanism is not needed to update the mapping. This makes the integration interesting for supervision and energy management systems that already use the protocol.

Registers, data types and writing values

The data type is automatically recognized based on the entity. On/off states are represented as bits, fixed-range numbers as int16 or uint16, and sensors as float32. Those who configure the mapping can also choose alternative types, including uint32, int32, and scaled16.

To broaden compatibility with masters, holding register and input register return the same values; the same principle is applied to coil and discrete inputs. The choice takes into account devices that only support the FC3 function. For 32-bit values, big-endian order is adopted, with the high word first, referred to as ABCD.

The mappings are initially read-only. By activating the «Writable» option, the master can also switch entities or set numerical values. When a requested value exceeds the minimum and maximum limits expected by the entity, the integration rejects it by returning an appropriate Modbus exception.

Home Assistant Modbus Slave corpo

Safety and compatibility with PLC and SCADA

Modbus does not provide an authentication system. For this reason the project offers a list of authorized IP addresses for the masters and a setting that defines the address on which the service listens. These are controls to consider during configuration, especially when the system is connected to other automation equipment.

The author also invites those who use PLCs, SCADA or energy managers to report any differences in the reading of the registers compared to the expected behavior. User feedback will help evaluate compatibility with different Modbus devices and implementations, without assuming that each combination has already been verified.

DS

Dario Scarfina

Founder and author of TecnologiaDigitale.net

Founder of TecnologiaDigitale.net. Passionate about technology, cybersecurity, artificial intelligence, smart home and digital innovation.

View author profile

Commenti

Ancora nessun commento. Sii il primo a partecipare.

L'email non verrà pubblicata. Il commento sarà visibile solo dopo approvazione.