Closed mtucker502 closed 1 year ago
Hi @mtucker502, I've not used grid myself. If this driver is registering your device correctly then it is doing its job, the interface you are using to publish data values is Victron's own dbus-mqtt interface.
Having said that, could the cause of your issue be the same as the one reported earlier this week, posting strings instead on numeric values? You have quotes around numeric values.
W/102c6b64af99/grid/1/Ac/L1/Voltage {"value": "120.2"} W/102c6b64af99/grid/1/Ac/L2/Voltage {"value": "120.2"} W/102c6b64af99/grid/1/Ac/L1/Current {"value": "11.98"} W/102c6b64af99/grid/1/Ac/L2/Current {"value": "18.51"}
One more thing that looks a bit odd in your log file:
INFO:device_manager: Unregistering device ctsensor
Are you publishing data after the driver has stopped or been killed? I'm not sure how the dbus will behave if your device is not connected.
I had the pip install error earlier :)
This one though you were right on the money. I'm sending floats as strings. Is there a preferred method for decoding bytes from paho-mqtt into the proper type?
Currently I'm decoding as "utf-8" and for these sensor values then converting to floats. Example: sensor_value = float(message.payload.decode("UTF-8"))
I couldn't tell you. As far as I know you just need to ensure your numeric values are floats or integers.
As you found the problem was, can this issue be closed?
Note: My current setup is off-grid. I want to validate that I can get the sensor values into ESS before I make the grid connection.
I am able to write to Ac/Energy and Ac/Power without issue. I can also write to L1/Voltage and L2/Voltage. But if I write to L/Power or L/Current the screen crashes. If I leave my client connected long enough entire Cerbo will reboot.
dbus-mqtt-device logs:
MQTT Explorer:
Mosquitto_pub:
Before mqtt client connects:
After mqtt client writes to L1/L2 current/power: