question

yvl avatar image
yvl asked

HowTo Set xx/Settings/CGwacs/BatteryLife/MinimumSocLimit via MQTT ?

Hello,

i just set up my home automation system to calculate the next Day PV-Yield, very nice and it works very well:

1636097581045.png


With this as base i am now able to set the MinimumSocLimit (in ESS, without Battery Life), manually at the moment.

I use MQTT to connect all the stuff to my Home Automation.

Is ist possible to set the MinimumSocLimit via MQTT ?

I already see the xls-File with Modbus-TCP - D-Bus register settings an it is writable ... (with Modbus-TCP)..

But i had no success with MQTT:

1636097767010.png


Thank you for the help !

regards Yves.


ESSModbus TCPMQTT
1636097581045.png (49.0 KiB)
1636097767010.png (96.2 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

1 Answer
yvl avatar image
yvl answered ·

Hello,

ok, sorry now it works !

it was a wrong formatted message what i send.

found in /var/log/dbus-mqtt/current:

@400000006184e10420c219cc Traceback (most recent call last):
@400000006184e10420c3989c   File "/opt/victronenergy/dbus-mqtt/dbus_mqtt.py", line 136, in _on_message
@400000006184e10420c6bd4c     self._handle_write(topic, msg.payload)
@400000006184e10420c79fdc   File "/opt/victronenergy/dbus-mqtt/dbus_mqtt.py", line 149, in _handle_write
@400000006184e10420c9267c     value = json.loads(payload)['value']
@400000006184e10420c9a37c   File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
@400000006184e10420cb2a1c     return _default_decoder.decode(s)
@400000006184e10420cb977c   File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
@400000006184e10420cd0a94     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
@400000006184e10420cd77f4   File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
@400000006184e10420cecbcc     raise ValueError("No JSON object could be decoded")
@400000006184e10420d03714 ValueError: No JSON object could be decoded


With correct format of the setting it works:

W/_________/settings/0/Settings/CGwacs/BatteryLife/MinimumSocLimit
{ "value": 50 }

the spaces between the brackets are significant !

regards Yves.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.