Hello,
With the custom_command, here is the log I get :
[12:34:07][V][modbus_controller:232]: Updating modbus component
[12:34:45][V][modbus_controller:232]: Updating modbus component
[12:34:45][V][modbus_controller:199]: Range : 4284 Size: 1 (0) skip: 0
[12:34:45][V][modbus_controller:044]: Sending next modbus command to device 2 register 0x4284 count 1
[12:34:45][V][modbus:244]: Modbus write raw: 02.04.13.AC.00.02 (6)
[12:34:45][V][modbus_controller:569]: Command sent 0 0x4284 1 send_count: 1
[12:34:45][V][modbus_controller:081]: Modbus response queued
[12:34:45][V][modbus:159]: Clearing buffer of 8 bytes - parse succeeded
[12:34:45][V][modbus_controller:089]: Process modbus response for address 0x4284 size: 4
[12:34:45][V][modbus_controller:170]: data for register address : 0x4284 :
[12:35:07][V][modbus_controller:232]: Updating modbus component
[12:35:45][V][modbus_controller:232]: Updating modbus component
[12:35:45][V][modbus_controller:199]: Range : 4284 Size: 1 (0) skip: 0
[12:35:45][V][modbus_controller:044]: Sending next modbus command to device 2 register 0x4284 count 1
[12:35:45][V][modbus:244]: Modbus write raw: 02.04.13.AC.00.02 (6)
[12:35:45][V][modbus_controller:569]: Command sent 0 0x4284 1 send_count: 1
[12:35:45][V][modbus_controller:081]: Modbus response queued
[12:35:45][V][modbus:159]: Clearing buffer of 8 bytes - parse succeeded
[12:35:45][V][modbus_controller:089]: Process modbus response for address 0x4284 size: 4
[12:35:46][V][modbus_controller:170]: data for register address : 0x4284 :
And in HA, it seems that I have a value :
(“A l’arrêt” means “Stopped”)
If I do the same without the custom_command :
- platform: modbus_controller
modbus_controller_id: wp
id: bad_plus
name: "Fonction Bad+"
icon: "mdi:heat-wave"
device_class: "running"
address: 5036
register_type: read
#register_count: 2
force_new_range: true
#custom_command: [0x02,0x04,0x13,0xAC,0x00,0x02]
And here are the logs :
[12:39:24][V][modbus_controller:232]: Updating modbus component
[12:39:24][V][modbus_controller:199]: Range : 13AC Size: 1 (4) skip: 0
[12:39:24][V][modbus_controller:044]: Sending next modbus command to device 2 register 0x13AC count 1
[12:39:24][V][modbus:223]: Modbus write: 02.04.13.AC.00.01.F5.5C (8)
[12:39:24][V][modbus_controller:569]: Command sent 4 0x13AC 1 send_count: 1
[12:39:24][V][modbus_controller:232]: Updating modbus component
[12:39:24][D][modbus:136]: Modbus error function code: 0x84 exception: 2
[12:39:24][E][modbus_controller:094]: Modbus error function code: 0x4 exception: 2
[12:39:24][E][modbus_controller:103]: Modbus error - last command: function code=0x4 register address = 0x13AC registers count=1 payload size=0
[12:39:24][V][modbus:159]: Clearing buffer of 4 bytes - parse succeeded
And the feedback in HA :

(“Inconnu” means “unknown”)
And putting 2 sensors, gives me :
[12:56:17][V][modbus_controller:044]: Sending next modbus command to device 2 register 0xBC1A count 1
[12:56:17][V][modbus:244]: Modbus write raw: 02.04.15.74.00.02 (6)
[12:56:17][V][modbus_controller:569]: Command sent 0 0xBC1A 1 send_count: 1
[12:56:17][V][modbus_controller:081]: Modbus response queued
[12:56:17][V][modbus:159]: Clearing buffer of 8 bytes - parse succeeded
[12:56:17][V][modbus_controller:089]: Process modbus response for address 0xBC1A size: 4
[12:56:17][V][modbus_controller:170]: data for register address : 0xBC1A :
[12:56:17][D][binary_sensor:036]: 'Fonction Heizung+': Sending state OFF
Code :
- platform: modbus_controller
modbus_controller_id: wp
id: bad_plus
name: "Fonction Bad+"
icon: "mdi:heat-wave"
device_class: "running"
#address: 5036
#register_type: read
#register_count: 2
#force_new_range: true
custom_command: [0x02,0x04,0x13,0xAC,0x00,0x02]
- platform: modbus_controller
modbus_controller_id: wp
id: heizung_plus
name: "Fonction Heizung+"
icon: "mdi:heat-wave"
device_class: "running"
#address: 5492
#register_type: read
#register_count: 2
#force_new_range: true
custom_command: [0x02,0x04,0x15,0x74,0x00,0x02]