So I’ve written a VE.direct binding for my SmartShunt and BlueSolar MPPT charger (though it should work with a lot of stuff in their range) Have finally got around to moving my rig to openhab 3 so I’m wanting to do a PR to make this public/official. Before that, though, I’m looking for anybody who is interested/has Victron charger/BMV/shunt hardware attached via USB (VE.direct) who’s interested in doing some testing/validation/etc. Anybody out there?
You can download “Venus OS” (OSS from Victron) directly to say a Raspberry Pi and then you have basically a “Venus GX” - with that you can activate an MQTT-Server, and it publishes multiple information via MQTT - or you can configure a Modbus on it, yes! But for that you need either “Venus GX” (~300 €) or you use an Raspberry Pi (v2 would do it)
@binderth Do you use your setup for data logging only or do you directly control anything on the devices? (The relay on the solar controller for example)? Also, are you using the secondary input for temperature or battery midpoint on the shunt (I haven’t implemented anything for that yet, but it will be pretty trivial to do so).
I just started with using it in my RV. Just soldered the cables and setup Venus OS and was right there, when I got a list of the MQTT-topics of the broker.
So - no, I neither use the relay on the solar MPPT nor do I use temperatures or stuff yet.
I plan to use with VE.direct:
getting the data for logging and optimizing my use of the RV!
adding a GPS and temperature to my setup
adding tank sensors for fresh water and grey water tanks.
that’s it for now.
I try to download your binding and testing it… could take a while, as the weekend is already planned, but perhaps I find some time…
Well, it sounds like your use case is pretty much identical to mine I don’t recall VE having anything with a GPS. But I can send you some scripts I have that grab a from regular USB GPS dongle and update OpenHAB’s location, TZ, etc.
As far as the tank sensors go, I know VE has a couple things for that but I don’t think any of them have VE.direct. I haven’t set anything up yet myself to get or track tank data.
you’re rigtht, I read the other day, that GPS, tank sensors and temperatures can be integrated within Venus OS; but after re-reading it seems, they’re NOT VE.direct, but USB-dongles again!
so, yeah that’s not VE.direct based and therefore not included in your binding!
I just updated the jar with a version that auto-detects VE.Direct serial cables. Mucking about w/the udev stuff is still necessary if you have more than one device that ends up as /dev/ttyUSBX (and you will likely need to manually change the auto-detected /dev/ttyUSBX to your custom name). But I’d wanted to get this change done as it sets the full item names to: vedirect:bmv:VE4O3XXR:HQ2101T1RM2:battery1_current1, where the ID’s are the serial # of the cable and the serial # of the attached device. Just makes some stuff easier for debugging and adding/removing the devices. So now, setup should be as easy as plugging in a VE.direct cable and it will show up in your inbox, and after adding it as a Thing, the attached device will then show up in your inbox to be added as well.
oh! I don’t have the factory VE.direct cables. I soldered my own for a fraction of the price…
I just use CP2104 USB to TTL modules with Micro JST connectors… nonetheless I have added those to my udev-rules and now I have to drive up to my RV to test it out…
PS: I did come across a “Layer 8”-error!
don’t use the /dev/tty... but the way longer /dev/serial/by-id/usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_008B6F5A-if00-port0
I think you need to add /dev/ttyUSB_solar to your startup args"
-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB_solar
The error you’re hitting is before it even tries to open the serial port, it can’t find it in OpenHAB’s SerialPortManager. Also it’s weird that the long version doesn’t work… Wonder why OpenHAB would put a char limit in place.
The bridge doesn’t have any channels. It will detect what’s attached and create a new Thing in your inbox for a solar controller/BMV/Inverter/whatever that will have the channels.
That didn’t happen with my Setup. I’ll try again later and are there any more information in DEBUG mode? Then I’ll put the binding in debig/trace before…
If you wish to have solution which does not require playing with udev you can give a shot to [co7io] Persistent serial port identifier provider for openhab. This is openhab side implementation of same logic which binds serial port to specific hardware and not identifier assigned by linux.
ok, didn’t set to TRACE yet, but now I got this (probaply overlooked it the day before):
2021-09-30 15:49:04.120 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'vedirect:bmv:VEDirectSolar:HQ2050G12MZ' to inbox.
2021-09-30 15:49:04.121 [INFO ] [openhab.event.InboxAddedEvent ] - Discovery Result with UID 'vedirect:bmv:VEDirectSolar:HQ2050G12MZ' has been added.
So right now I could add both Things, added all channels as equipment to my model and got this:
2021-09-30 15:49:38.724 [INFO ] [internal.VEDirectSerialBridgeHandler] - Initializing VEDirect Serial Bridge: /dev/ttyUSB_shunt
2021-09-30 15:49:38.743 [INFO ] [internal.VEDirectSerialBridgeHandler] - Connecting to VE.Direct using /dev/ttyUSB_shunt.
2021-09-30 15:49:39.086 [ERROR] [internal.VEDirectSerialBridgeHandler] - Invalid block: Csum 9879!
2021-09-30 15:49:39.089 [ERROR] [internal.VEDirectSerialBridgeHandler] - 70001000056A0FF58
PID 0xA056
FW 156
SER# HQ18044A75V
V 27010
I 1400
VPV 74100
PPV 41
CS 5
MPPT 1
OR 0x00000000
ERR 0
LOAD ON
H19 17654
H20 36
H21 112
H22 144
H23 450
HSDS 93
Checksum h
==> /var/log/openhab/events.log <==
2021-09-30 15:49:38.733 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vedirect:serial:VEDirectShunt' changed from OFFLINE (COMMUNICATION_ERROR): Invalid port: ttyUSB_shunt to UNKNOWN
2021-09-30 15:49:38.778 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vedirect:serial:VEDirectShunt' changed from UNKNOWN to ONLINE
==> /var/log/openhab/openhab.log <==
2021-09-30 15:49:40.090 [ERROR] [overy.VEDirectDeviceDiscoveryService] - Declaring Unknown Device
2021-09-30 15:49:40.096 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'vedirect:mppt:VEDirectShunt:HQ18044A75V' to inbox.
==> /var/log/openhab/events.log <==
2021-09-30 15:49:40.096 [INFO ] [openhab.event.InboxAddedEvent ] - Discovery Result with UID 'vedirect:mppt:VEDirectShunt:HQ18044A75V' has been added.
2021-09-30 15:51:11.916 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vedirect:bmv:VEDirectSolar:BinderShunt' changed from UNINITIALIZED to INITIALIZING
2021-09-30 15:51:11.931 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vedirect:bmv:VEDirectSolar:BinderShunt' changed from INITIALIZING to ONLINE
==> /var/log/openhab/openhab.log <==
2021-09-30 15:51:16.929 [ERROR] [irect.internal.VEDirectDeviceHandler] - Trying to update yesterday_max_power
2021-09-30 15:51:16.945 [ERROR] [irect.internal.VEDirectDeviceHandler] - Trying to update yesterday_yield
2021-09-30 15:51:38.194 [WARN ] [re.thing.internal.ThingFactoryHelper] - Could not create channel 'relay', because channel type 'vedirect:switch' could not be found.
==> /var/log/openhab/events.log <==
2021-09-30 15:51:38.213 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vedirect:mppt:VEDirectShunt:BinderSolar' changed from UNINITIALIZED to INITIALIZING
2021-09-30 15:51:38.230 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'vedirect:mppt:VEDirectShunt:BinderSolar' changed from INITIALIZING to ONLINE
==> /var/log/openhab/openhab.log <==
2021-09-30 15:51:43.227 [ERROR] [irect.internal.VEDirectDeviceHandler] - Trying to update yesterday_max_power
2021-09-30 15:51:43.246 [ERROR] [irect.internal.VEDirectDeviceHandler] - Trying to update yesterday_yield
2021-09-30 15:52:59.816 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: vedirect:switch
2021-09-30 15:53:06.693 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: vedirect:switch
2021-09-30 15:53:24.052 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: vedirect:switch