Skip to content

Commit

Permalink
Merge pull request #35 from beaylott/patch-1
Browse files Browse the repository at this point in the history
New VE.Direct config and updated README
  • Loading branch information
glynhudson authored Jul 14, 2017
2 parents 756a33d + da696d3 commit e97ee59
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 36 deletions.
22 changes: 22 additions & 0 deletions conf/interfacer_examples/vedirect/mppt.vedirect.emonhub.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[[VEDirect]]
Type = EmonHubVEDirectInterfacer
[[[init_settings]]]
com_port = /dev/ttyUSB0
com_baud = 19200
toextract = V,VPV,PPV,I,IL,LOAD,Relay,H19,H20,H21,H22,H23,ERR,CS,FW,PID,HSDS
poll_interval = 10
[[[runtimesettings]]]
nodeoffset = 9 #make sure this matches with nodename below
pubchannels = ToEmonCMS,
subchannels = ToBlueSolarMPTT,
basetopic = emonhub/

[nodes]

[[9]]
nodename = BlueSolarMPTT
[[[rx]]]
names = V,VPV,PPV,I,IL,LOAD,Relay,H19,H20,H21,H22,H23,ERR,CS,FW,PID,HSDS
datacode = 0
scales = 0.001,0.001,0.001,0.001,1,1,1,1,0.001,1,0.001,1,1,1,1,1,1,1
units = V,V,W,A,A,1,1,kWh,kWh,W,kWh,W,1,1,1,1,1,1
64 changes: 28 additions & 36 deletions conf/interfacer_examples/vedirect/readme.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,47 @@
#VE Direct interface Victron products#
# Interfacer for Victron VE.Direct Protocol

The VE Direct protocol is as binary/ASCII [protocol](https://www.victronenergy.com/upload/documents/VE.Direct-Protocol.pdf) used by [Victron Energy] to communicate between it's products. For those who don't know, Victron is the leading producer of solar inverters and charge controllers designed for the off grid market.
The VE.Direct protocol is as binary/ASCII [protocol](https://www.victronenergy.com/live/vedirect_protocol:faq) created and used by [Victron Energy](https://www.victronenergy.com/) for communication between and with their products.

With this interfacer now it's possible to interface data from any VE Direct compatible Victron product with Emon. In this example we use the [BMV 700](https://www.google.rw/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwi14t-MkqfLAhVBExoKHRGeCioQFggbMAA&url=https%3A%2F%2Fwww.victronenergy.com%2Fbattery-monitors%2Fbmv-700&usg=AFQjCNGENUubkSY_HkWGN61NdkP8onXHag&sig2=XjH6HIbtSzwY_kDDKOfsJw), which is a battery monitor. For emon users that have a battery bank, this will allow them to get stats on their batteries very easily.
This interfacer provides support for reading data from any Victron product that can use the VE.Direct protocol for inter-device communication. Currently this includes the BMV600, BMV700, Blue Solar MPPT, and Phoenix ranges.

##Usage and configuration##
There is a sample vedirect.emonhub.conf file located in this directory.
This is already preconfigured to talk to a BMV700 that is connect to the emonpi via isolated [USB cable](https://www.victronenergy.com/accessories/ve-direct-to-usb-interface)
Example configurations are provided for the BMV700 battery monitor and Blue Solar MPPT charge controller.

Each VE Direct product has it's own source of variables that it delivers. The full list of variables can be found on Victron's github page as [datalist.py](https://github.com/victronenergy/velib_python/blob/master/dbusmonitor.py).
A VE.Direct to USB converter is available from Victron which would allow direct connection to a emonPi/Raspberry Pi or laptop.

This file isn't necessary, but it's just useful as a reference to see which data codes correspond to which values.
## Usage and configuration

Each supported product has it's own set of data that can be read over VE.Direct called 'fields' . The full list of available fields can be found in the VE.Direct Protocol white paper found [here](https://www.victronenergy.com/support-and-downloads/whitepapers). This information can be used to adapt the provided configurations for your device.


###Sample interfacer config within emonhub.conf ###
### Sample interfacer config for a BMV700
# Sample configuration for Victron Product with VEDirect connection over USB
# Configuration is for BMV 700
[[VEDirect]]
Type = EmonHubVEDirectInterfacer
[[[init_settings]]]
com_port = /dev/ttyUSB0 # Where to find our device
com_baud = 19200 # Baud rate needed to decode
toextract = SOC,CE,TTG,V,I,Relay,Alarm # These are the fields we wish to extract, explanation can be seen in datalist.py
poll_interval = 10 # How often to get data in seconds
[[[runtimesettings]]]
nodeoffset = 9 #make sure this matches with nodename below
pubchannels = ToEmonCMS,
subchannels = ToBMV,
basetopic = emonhub/


### Followed by a corresponding Node declaration in emonhub.conf###
In this example our battery monitor will be designated node id 9

[[9]]
nodename = emonDC
firmware =V1_6_emonTxV3_4_DiscreteSampling #not used
hardware = emonTx_(NodeID_DIP_Switch1:ON) #not used
[[[init_settings]]]
com_port = /dev/ttyUSB0 # Where to find our device
com_baud = 19200 # Baud rate needed to decode
toextract = SOC,CE,TTG,V,I,Relay,Alarm
poll_interval = 10 # How often to get data in seconds
[[[runtimesettings]]]
nodeoffset = 9 #make sure this matches with nodename below
pubchannels = ToEmonCMS,
subchannels = ToBMV,
basetopic = emonhub/


# Followed by a corresponding Node declaration

[[9]] # This node name should be consistent with the nodeoffset parameter above
nodename = VictronBMV700
[[[rx]]]
names = SOC,CE,TTG,V,I,Relay,Alarm # Make sure this matches 'toextract' in interfacer
names = SOC,CE,TTG,V,I,Relay,Alarm # Make sure this matches 'toextract' in interfacer definition above
datacode = 0 #no need to decode values
scales = 0.1,1,1,0.001,1,1,1 # Some scaling necassary
units =%,Ah,s,V,A,S,S
units = %,Ah,s,V,A,S,S


With this config in place now you simply need to restart emonhub on our emonpi by ssh'ing into it and typing
With this config in place you just need to restart emonhub on your emonPi by rebooting it or ssh'ing into it and typing

$>sudo service emonhub restart

If there are any problems you can debug by looking inside /var/emonhub/emonhub.log

Hope that helps

If there are any problems you can debug by looking inside /var/emonhub/emonhub.log.

0 comments on commit e97ee59

Please sign in to comment.