Closed blammit closed 1 month ago
This is because mqtt/system/Ac/In/0/Connected
is true
instead of 1
when connected, on VenusOS v3.50~7.
@ReinvdZee do you know if this is a deliberate change? On VenusOS v3.41~1 it is still 1
when connected, when querying the value on MQTT.
We can easily fix this bug in gui-v2 by checking if Connected
is either 1
or true
, but I just want to check whether this change is intentional, and whether any other values have changed in a similar manner.
@blammit I'm not sure if this is intentional or not. In dbus, it still has the value 1
.
Maybe this was changed in the MQTT broker? @mpvader, @wiebeytec?
Dbus-flashmq looks at the dbus type for generating the json string. Dbus has a distinction between bool and int, so I'm curious what the underlying type is.
Can you run (something like) this on various Venus versions and post the output:?
dbus-send --print-reply=literal --system --dest=com.victronenergy.system /Ac/In/0/Connected com.victronenergy.BusItem.GetValue
Example result for an int:
dbus-send --print-reply=literal --system --dest=com.victronenergy.system /Relay/1/State com.victronenergy.BusItem.GetValue
variant int32 1
Example result for a bool:
dbus-send --print-reply=literal --system --dest=com.victronenergy.platform /ConnectVrmTunnel com.victronenergy.BusItem.GetValue
variant boolean true
@wiebeytec
On Venus OS 3.50~9, this is the output:
root@einstein:~# dbus-send --print-reply=literal --system --dest=com.victronenergy.system /Ac/In/0/Connected com.victronenergy.BusItem.GetValue
variant boolean true
And on 3.41:
dbus-send --print-reply=literal --system --dest=com.victronenergy.system /Ac/In/0/Connected com.victronenergy.BusItem.GetValue
variant int32 1
In both cases, the values shows up in dbus-spy
as 1
. So it seems the type has changed along the way.
Did you get no output from the second command, or did you make a copy/paste mistake?
@wiebeytec,
Sorry, copy mistake. I updated the comment
I tried to see if i could find something in systemcalc (if that's even the right project) or velib_python to explain this, but nothing obvious stands out.
I don't know at which end(s) it needs fixing, although it seems reasonable GUIv2 can handle both.
I agree, Gui-v2 should be able to handle both.
The path is indeed created by dbus-systemcalc-py
.
Maybe @izak has a clue?
My mistake guys...
It is the new feature where a system with no Inverter/Charger will show a connected grid connection if you have a grid meter. It is meant to better support systems with only a grid meter, and this is the line of code (that last input_count==0
creates a bool instead of an int).
newvalues.update(self.input_tree(input_count, source.service, source.instance, t, input_count==0))
Easy fix, I will cast it to an int explicitly.
Introduced in v3.50~3. Affects only systems without an inverter/charger and with a grid meter.
Thanks! I will also add a patch to allow gui-v2 to recognise either 1
or true
as "connected".
Tested on this installation.
Overview grid looks like this:
Even though
mqtt/system/0/Ac/ActiveIn/Source = 1
:And Brief page shows some Grid output: