GX additional attributes/mobus registers

Is it possible to add ‘Writable’ Scheduled Charge Schedules to the Modbus queries mapped to the attributes file? I’ve added the below and can read the data but I cannot change the schedule via Modbus.

com.victronenergy.settings,/Settings/CGwacs/BatteryLife/Schedule/Charge/1/Start,d,Seconds,5437,uint32,1,W
com.victronenergy.settings,/Settings/CGwacs/BatteryLife/Schedule/Charge/1/Duration,d,Seconds,5439,uint32,1,W
com.victronenergy.settings,/Settings/CGwacs/BatteryLife/Schedule/Charge/1/Soc,d,%,5441,uint16,1,R
com.victronenergy.settings,/Settings/CGwacs/BatteryLife/Schedule/Charge/1/Day,d,Day,5442,int16,1,W
com.victronenergy.settings,/Settings/CGwacs/BatteryLife/Schedule/Charge/1/AllowDischarge,d,0=Not allowed;1=Allowed,5443,int16,1,R

I am just winging it in the hope that I can get the write function to work. Any help will be appreciated.

Ingo

I can’t say why that doesn’t work. Just from a quick glance, it should. You have a W at the end (writable), and they are integers (string writes are not currently supported). It should work.

Have you tried writing single registers, or only as a range? There is an issue in dbus-modbustcp that if you write a range that spans across a service boundary, it doesn’t work. Well, reading is also broken, but the tail end just returns zeros so it is less noticeable.

@plonkster I tried a single write using ModBus Poll and that also doesn’t work. I suspect the ‘Set’ method might not be supported so I changed to MQTT, using SetValue, which seems to work fine. To be honest, I don’t know why other registers work but my own doesn’t unless it’s hardcoded somewhere.

The mbpoll command on Linux? That thing is off by one on the register numbers…

Windows

OK… but still, I found that sometimes tools are one off on the registers, for some reason. It’s a long shot, I admit, but sometimes it pays to play around a bit. Fetch something you know absolutely SHOULD work (say, slave 100, address 800, the first character of the serial number). Then work from there.

Relay #2 On|Off works perfectly using register 807 so I don’t think there is a register offset in this case.

1 Like