scratching my head and trying to get this to work. Have modbus connectivity, quite some experience with reading modbus data, but never had tried to write something back.
Using eshome 2024.11.2, trying to control MasterPact MTZ mains switch.
This is the command I try to achieve - basically sending values to 8000 and subsequent registers.
I understand I need to use function code 16.
Wonder can it be done nicely with a switch component?
Or is there a way to send directly the serial string/package to modbus uart?
“01 10 1f 40 00 06 0c 03 88 00 0a 11 01 00 01 12 f0 12 fo 1e 78”
Appreciate any hint or direction. Thank You so much!
wrong - that the damn thing is accepting the values … but not doing anything
And then I got confused by that user manual description
|OCTEC STRING|0000=0x30303030| and seeing 12336 on screen … though chatg friend is also saying hex 0x3030 is decimal 12336 (I’ve always been bad w base conversions ).
In few days will get back to the device and check what it is giving back if sending wrong password. Meanwhile also learned the registers for execution status codes.
Last but not least, might be I need to have 4609 and not 4353 in 8001 … found both mentioned in the documentation, but away from the device. At least that gives a hope
all good with the esphome and modbus custom command. Receiving status code 0 back (and different codes if doing w wrong password or wrong command address). Must be some “enable remote operation” config on the switch. Will keep digging
I don’t know your device, but in standard modbus protocol successful response for function code 16 is just:
slave address : function code : start address : quantity : CRC
8 bytes, it doesn’t include the values you “wrote” to registers.
you are righyt here that’s the case as well.
I am “reading” the values back as I have them configured in the esphome yaml for display purposes.
Receiving the code back - was meant for reading the command status register (once command has finished). Have reached out to manufacturer to figure out what’s wrong. As if there was some configured protection - then the device typically is responding with the proper code. In my case it responds with Command status code=0 as for success … but does not do anything. Will see what they say.