Error setup modbus comunication on BH8-CTRLX-230

Hi

I have a Carlo Gavazzi Smarthome module BH8-CTRLX-230 which is modbus compatible over Ethernet. I’m trying to get it working with HA. I guess I’m doing somthing wrong, as I’m not getting this to play.

For this example I have on my Dupline Address

A1 - Temp Sensor
A4 – Relay output to switch ON/OFF

I’m using the dec Modbus address

modbus:
type: tcp
host: 192.168.111.10
port: 502

sensor:
platform: modbus
registers:
- name: Sensor1
unit_of_measurement: °C
slave: 10
register: 256
scale: 0.1
precision: 1
offset: 2

switch:
platform: modbus
slave: 10
coils:
- name: Switch1
slave: 10
coil: 1283

binary_sensor:

  • platform: modbus
    coils:
    • name: BinSensor1
      slave: 1
      coil: 5379

The BH8-CTRLX-230 module uses the following info (extracted from the manual ): (http://www.smartbuilding.no/assets/ctrlx_manual.pdf page 96…)

• Function code 01 - read output table bit
• Function code 02 - read input table bit
• Function code 03 - read multiple registers
• Function code 05 - set single output bit
• Function code 06 - preset single register
• Function code 16 - preset multiple register

I presume that I should use function 01 for reading and function 05 for writing digital
The address to do that are for 01 and 05 respectively (just extracts from the help files):

Function code 01 - read output table bit
Register
Address Dupline
Address Register 8 bit
value
Dec Hex Level
1280 500 A1 00h=Off/01h=On Bit
1281 501 A2 00h=Off/01h=On Bit
1282 502 A3 00h=Off/01h=On Bit
1283 503 A4 00h=Off/01h=On Bit
1284 504 A5 00h=Off/01h=On Bit

Function code 03 - read multiple registers
Register
Address Dupline
Address Register 8 bit
value
Dec Hex Hi Lo Level
256 100 A1 0 0…255 Analink
257 101 A2 0 0…255 Analink
258 102 A3 0 0…255 Analink
259 103 A4 0 0…255 Analink
260 104 A5 0 0…255 Analink

Function code 05 - set single output bit
Register
Address Dupline
Address Register 8 bit
value
Dec Hex Level
5376 1500 A1 00h=Off/01h=On Bit
5377 1501 A2 00h=Off/01h=On Bit
5378 1502 A3 00h=Off/01h=On Bit
5379 1503 A4 00h=Off/01h=On Bit
5380 1504 A5 00h=Off/01h=On Bit

Are the ports blocked by a firewall?
Test to access with another modbus client, there are a few free clients that you can test with.

Hi, there is no firewall. Both are in the same network.
It looks like I get connection thru the “Simply Modbus TCP Client” from my PC
The node I try connecting to is a Carlo Gavazzi CTRLX smart-house controller

Old topic and you’ve probably figured it out? If so - I would appreciate some assistance.
I’m struggling with reading I/O’s - like “the light is on” - the Carlo Gavazzi controller is not the best to work with.

I’ve figured out how to read the analog values though, via Node-RED (modbus FC3) with MQTT to HA.
Have you had any luck reading digital registers? As I understand the manual you have to send a “query” to the controller and “decrypt” the response - is this really necessary with Modbus TCP?

Atm I’m reading the temperatures from 7 TEMDIS room thermostats with the following conversion to get it right:

var x = [0,0,0,0,0,0,0,0,0,0];
var msg_o = [msg, msg, msg, msg, msg, msg, msg, msg, msg, msg];

for(i=0; i<11; i++)
{
    x[i] = ((msg.payload[i]*50)/255)+0;
    msg_o[i] = { payload :Number((x[i]).toFixed(1)),
                    topic : "Romtermostat " };
    
}

return msg_o;

Hei, ser at du har styrt med et lignende system som jeg har, Carlo Gavazzi Smarthome module BH8-CTRLX-230.
Jeg har flyttet inn i et hus med dette systemet og ønsker å få dette integrert i HA. Jeg er ikke en recer på HA. Har du fått til denne integrasjonen?