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
- name: BinSensor1
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