Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 99284

Modbus TCP sensor configuration help

$
0
0

@Dehumanizer wrote:

Hello,
I am trying to add modbus sensors from my home heating control unit but I’m failing so far, although it works from a PHP script, so the modbus itself is ok and working, I’m just lost about how to configure it in HA so that it would display (correct) data.
The modbus device does have temperature data for each room in two bytes, the final value is constructed like this: <high byte> * 256 +<low byte>/10
the php function for reading and converting values which works for me goes like this:

<?
$modbus = new ModbusMaster("<device_ip>", "TCP");

$a=$modbus->readMultipleRegisters(0, 2033, 1);
$temperature=($a[0]*256+$a[1])/10;

?>

Actually I’m reading more than 1 register, there is some more data in the real code, that’s why I’m using readMultipleRegisters, but for the sake of simplicity here, let’s say I just read one register with the temperature, this code works and $temperature contains correct temperature value.

So my question is, how to read the same value from Home Assistant and what parameters to use?

Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 99284

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>