Coder Social home page Coder Social logo

signalk-venus-plugin's Introduction

venus-signalk

This code is a Signal K Node Server plugin. It reads data from a Victron GX-device, such as the Cerbo GX into signalk-server.

Besides using the Cerbo GX, or any of the other commercially available GX devices, it is also possible to run Venus OS on a RaspberryPi2 or 3, for example.

Supported Victron products:

  • Inverter/Chargers: Multis, Quattros
  • Battery Monitors: any type that is supported by Venus. For example the BMV-700 series, or the Lynx Shunt VE.Can, as well as various integrated Lithium battery systems.
  • Solar Chargers: both the types with a VE.Direct and the types with a VE.Can connection
  • Tank senders: the resistive inputs on the Venus GX, as well as a tank sender connected to Venus over N2K

Know that there is also a version of Venus OS with signalk-server, and this plug-in pre-installed. In which case you don't need to self install or configure this plugin. See Venus OS large.

Support

Use the #victron channel on the Signal K Slack.

Plugin installation & configuration

Installing is simple. The plugin is available in the signalk app store. Simply click to install.

Then there are two settings. The first is how to connect to Venus OS. Choose between these:

  • A. Connect to localhost
  • B. Connect to a GX-device over tcp using MQTT (Plain text)
  • C. Connect to a GX-device over tcp using MQTT (SSL)

Use option A when signalk-server is installed on the GX-device itself.

Use option B or C in case signalk-server is a separate device, for example a raspberrypi running Raspbian, in which case the plugin needs to connect to the GX-device on the ethernet/wifi network. You should use SSL if GX-device is not on the local network.

When using option B or C go enter the hostname or ipaddress of the Venus device in the plugin configuration.

Also ensure that MQTT is turned on in the GX-devices Services Settings.

Test harness

To see data, without having actual Victron or other Venus compatible hardware setup, get and run below explained Dummy data script. Or, clone dbus-recorder and run play.sh.

Note that using the test harness could cause for some errors during init, as it doesn't support doing a GetValue on the root item (/).

How to develop this plugin outside of Signal K

First run npm install.

Use ./demo.sh to run the code with full debug logging and the produced delta serialised to stdout.

When not tested on an actual Venus device, there will be no output since there is no data coming in. Use a dummy data script to test / develop on a pc:

https://gist.github.com/mpvader/94672c05d68bb6762859ba70240ea887

dbus-listener.py is an example of how similar data would be read in Python. It is not required to use the plugin.

signalk-venus-plugin's People

Contributors

dirkjanfaber avatar dpreuss avatar jepefe avatar macjl avatar michellewhy avatar mpvader avatar nmbath avatar sbender9 avatar tkurki avatar webmasterkai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

signalk-venus-plugin's Issues

Adding Frequency - Should I submit PR?

I see frequency was missing, so I added it to my install. I can submit PR if you would prefer.

'/Ac/ActiveIn/L1/F': {
  path: m => {
    return makePath(m, `${m.instanceName}.acin.frequency`, true)
  }
},

...
'/Ac/Out/L1/F': {
path: m => {
return makePath(m, ${m.instanceName}.acout.frequency, true)
}
},

Inconsistent path names

On my installation the plugin injects two paths (from many) into Signal K which seem to break with the convention normally adopted by the plugin when creating Signal K paths from Victron data names. These are:

electrical.batteries.257starter.current - there should be a period ('.') after the device number
electrical.batteries.258-second.voltage - the hyphen ('-') should be a period ('.')

P

put error 502 Did not receive change confirmation

HI,
I'm using the new release 1.29.
Sending a SignalK PUT with Node-red cause an error reported in the subject.
It happened with both mode 0 or 1.
It works, the regulators switched ON or OFF, but the error is always there.

Thanks.

`Oct 22 14:05:20 2022-10-22T01:05:20.915Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/293/Mode to 1
Oct 22 14:05:20 2022-10-22T01:05:20.918Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/291/Mode to 1
Oct 22 14:05:20 2022-10-22T01:05:20.920Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/292/Mode to 1
Oct 22 14:05:20 2022-10-22T01:05:20.923Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/288/Mode to 1
Oct 22 14:05:20 2022-10-22T01:05:20.926Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/289/Mode to 1
Oct 22 14:05:20 22 Oct 14:05:20 - [info] [function:88071768.090f48] object
Oct 22 14:05:21 client connected Thor
Oct 22 14:05:21 22 Oct 14:05:21 - [info] [function:88071768.090f48] object
Oct 22 14:05:21 22 Oct 14:05:21 - [error] [signalk-send-put:2x85] put error 502 Did not receive change confirmation
Oct 22 14:05:21 22 Oct 14:05:21 - [error] [signalk-send-put:2x100] put error 502 Did not receive change confirmation
Oct 22 14:05:21 22 Oct 14:05:21 - [error] [signalk-send-put:Solbian] put error 502 Did not receive change confirmation
Oct 22 14:05:21 22 Oct 14:05:21 - [error] [signalk-send-put:Solbian PT] put error 502 Did not receive change confirmation
Oct 22 14:05:21 22 Oct 14:05:21 - [error] [signalk-send-put:Solbian STB] put error 502 Did not receive change confirmation

Oct 22 14:06:15 2022-10-22T01:06:15.176Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/293/Mode to 0
Oct 22 14:06:15 2022-10-22T01:06:15.180Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/291/Mode to 0
Oct 22 14:06:15 2022-10-22T01:06:15.182Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/292/Mode to 0
Oct 22 14:06:15 2022-10-22T01:06:15.184Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/288/Mode to 0
Oct 22 14:06:15 2022-10-22T01:06:15.186Z signalk-venus-plugin setting mode W/b827eb5bf6e5/solarcharger/289/Mode to 0
Oct 22 14:06:15 22 Oct 14:06:15 - [info] [function:88071768.090f48] object
Oct 22 14:06:15 22 Oct 14:06:15 - [info] [function:88071768.090f48] object
Oct 22 14:06:16 22 Oct 14:06:16 - [error] [signalk-send-put:2x85] put error 502 Did not receive change confirmation
Oct 22 14:06:16 22 Oct 14:06:16 - [error] [signalk-send-put:2x100] put error 502 Did not receive change confirmation
Oct 22 14:06:16 22 Oct 14:06:16 - [error] [signalk-send-put:Solbian] put error 502 Did not receive change confirmation
Oct 22 14:06:16 22 Oct 14:06:16 - [error] [signalk-send-put:Solbian PT] put error 502 Did not receive change confirmation
Oct 22 14:06:16 22 Oct 14:06:16 - [error] [signalk-send-put:Solbian STB] put error 502 Did not receive change confirmation`

cosmetic issue: venusToDeltas.js absorption instead of absortion at line 381

It always hurt my eyes when seeing charger state reported as "absortion". Guess it's coming from venusToDeltas.js line 381:

'com.victronenergy.vebus': {
0: 'off',
1: 'low power',
2: 'fault',
3: 'bulk',
4: 'absortion',
5: 'float',
6: 'storage',
7: 'equalize',
8: 'passthru',
9: 'inverting',
10: 'power assist',
11: 'power supply',
252: 'bulk protection'
},

numbering (USB) devices by serial number?

I am running a PI3B with Venus OS and currently have 4 USB-VE-direct cables plugged in (2x BMV, 2x solar). When fiddling with that, and possibly adding more of these via USB hubs, the "VRM" numbers get reordered in VenusOS, which then screws up the logging into influxdb.
My workaround is to re-map the inputs within the plugin, and that seems to work.
But I am wondering if the mapping could be made more consistent by reading the device's serial number. Preferably the controller's serial number, not the one from the USB dongle.
Thanks!
Dirk

Changing ip address of venus leaves the old ip address dangling with thousands of deltas

My Venus's ip address changed and I updated it in plugin config. The result was that I got data, but dashboard showed thousands of deltas per second and the status kept changin between connecting to and connected to new ip address.

Rebooting the server brought things back to normal.

Probably related to #47 - delta stats in both issues could be explained by multiple connections to venus.

Inconsistent use of SignalK path names in the plugin

Having been looking at data associated with consumed amp hours, there seems to be an inconsistent use of path names.

The main SignalK Scheme defines the path "electrical.batteries.*.capacity.dischargeSinceFull" as "Cumulative discharge since battery was last full"

Therefore the data from the SignalK-venus-plugfin related to consumed amps (dbus path '/ConsumedAmphours') should be mapped to the above path, instead it is mapped at line 51 within venusToDeltas.js to electrical.batteries.${m.instanceName}.capacity.consumedCharge

The data mapped to "electrical.batteries.*.capacity.dischargeSinceFull" is actually dbus path '/History/LastDischarge', which is misleading to the SignalK path, as defined in the schema.

This seems to be in error and is misleading to the original SignalK schema (https://github.com/SignalK/specification/blob/master/schemas/groups/electrical.json lines 430-434).

Could we map as follows:

Dbus Path - SignalK Path
/ConsumedAmphours - electrical.batteries..capacity.dischargeSinceFull (NOTE 1)
//History/LastDischarge - electrical.batteries.
.capacity.history.lastDischargeSinceFull

NOTE1: CAN data from PGN127506 (Consumed AH) should be mapped to this SignalK path, and making this change would keep everything consistent.

I also note the there are several dbus /history/ paths and maybe history should be added to all these in SignalK, to make it clear they are historical data and not current, examples are

'/History/TotalAhDrawn': {
  path: m => `electrical.batteries.${m.instanceName}.lifetimeDischarge`,
  conversion: ahToCoulomb
},
'/History/DischargedEnergy' : {
  path: m => `electrical.batteries.${m.instanceName}.capacity.dischargedEnergy`,
  conversion: ahToCoulomb,
  units: 'C'
},

Happy to create a diff if required, but a fairly simple change to the venusToDeltas.js file.

Many Thanks

mqtt connection error

I get following error message from the signalk dashboard
ID: Venus
Status: connecting to mqtt: Error: getaddrinfo ENOTFOUND venus.local

The Venus Device is a CERBO GX, MQTT Access Plain and SSL is activated.
MQTT-Explorer receives all messages from CERBO

The plugin setting page is configured as follows:
connect via plain text
Adress: tcp:host=http://192.168.178.90/,port=1883
Mqtt host: venus.local

Any ideas how to solve/where to debug?

Signal K server Version 1.45.0

Readme out of date

The installation and configuration instructions do not match the actual plugin configuration.

Connecting to Venus Os via mDNS results in thousands of deltas/second

I've got my Signal K server connected to remote Venus device using signalk-venus-plugin. In the connection settings I've specified address as venus.local (an mDNS name) instead of an IP addresses. The server is able to make connection and read Venus data but the number of deltas per second just keeps growing to thousands and eventually freezes the system. When connected using IP address the deltas/second howers around 50-60.

I'm running Signal K Server v 1.30.0 on RPi 4 with 2GB ram, node version 14.4.0, OS is Raspbian Lite 4.19.118.
Plugin is configured to poll Venus every 2 seconds, but I have tried 10,20,30 seconds and it didn't make any difference in the behaviour. mDNS daemon is avahi v0.7

I've switched to IP address connection string for now but it would be really nice to use zero-conf/mDNS

mqtt connection : log error

when using mqtt connectivity option to venus, (cerbo)
a recurring (every second) error is logged in server log.

16E7A2B3-8F8F-4CA5-9BB1-5DA0F796883D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.