Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Dec 8, 2022
2 parents 1acbfab + fc1b12a commit 8c4b4ef
Show file tree
Hide file tree
Showing 47 changed files with 1,742 additions and 184 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ This version of emonhub is based on [@pb66 Paul Burnell's](https://github.com/pb

### Default Interfacers

- `EmonHubJeeInterfacer`: Decode data received from RFM69Pi & emonPi in [JeeLabs data packet structure](http://jeelabs.org/2010/12/07/binary-packet-decoding/) e.g. emonTx, emonTH, JeeNode RFM12 demo etc.
- `EmonHubJeeInterfacer`: Decode data received from RFM69Pi & emonPi in [JeeLabs data packet structure](http://jeelabs.org/2010/12/07/binary-packet-decoding/) e.g. emonTx, emonTH, JeeNode RFM12 demo etc. (In the process of being replaced with the new EmonHubOEMInterfacer).
- `EmonHubMqttInterfacer`: Publish decoded data to MQTT in a format compatible with emonCMS.
- `EmonHubEmoncmsHTTPInterfacer`: Publish decoded data to Emoncms via HTTP


### Other Interfacers

*See interfacer specific readmes in [/conf/interfacer_examples](conf/interfacer_examples)*

- [OEM Interfacer](conf/interfacer_examples/OEM) (A more flexible version of the Jee, EmonTx3 and space separated serial interfacer)
- [Emoncms HTTP Interfacer](conf/interfacer_examples/Emoncms)
- [Socket Interfacer](conf/interfacer_examples/Socket)
- [Space separated serial interfacer](conf/interfacer_examples/directserial)
- [EmonTX V3 Interfacer (key:value pairs, added by @owenduffy)](conf/interfacer_examples/directserial-serialtx3e)
Expand All @@ -46,6 +50,9 @@ This version of emonhub is based on [@pb66 Paul Burnell's](https://github.com/pb
- [MBUS Interfacer](conf/interfacer_examples/MBUS)
- [Redis Interfacer](conf/interfacer_examples/Redis)
- [Influx Interfacer](conf/interfacer_examples/Influx)
- [Jaguar Land Rover Interfacer (added by @dconlon)](conf/interfacer_examples/JaguarLandRover)
- [RFM69 Interfacer](conf/interfacer_examples/RF69)



***
Expand Down Expand Up @@ -95,7 +102,7 @@ journalctl -f -u emonhub

The emonhub configuration guide can be found here:

[emonhub.conf configuration](configuration.md)
[emonhub.conf configuration](docs/configuration.md)

## EmonHub Emoncms config module

Expand Down
84 changes: 84 additions & 0 deletions conf/available.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[available]

[[emonpi]]
nodename = emonpi
nodeids = 5,
[[[rx]]]
names = power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulsecount
datacodes = h, h, h, h, h, h, h, h, h, h, L
scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
units = W,W,W,V,C,C,C,C,C,C,p

[[emontxshield]]
nodename = emontxshield
nodeids = 6,
[[[rx]]]
names = power1, power2, power3, power4, vrms
datacodes = h,h,h,h,h
scales = 1,1,1,1,0.01
units = W,W,W,W,V

[[emontx3_discreet]]
nodename = emontx3
nodeids = 7,8,9,10
[[[rx]]]
names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
datacodes = h,h,h,h,h,h,h,h,h,h,h,L
scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
units = W,W,W,W,V,C,C,C,C,C,C,p

[[emontx3_3phase]]
nodename = 3phase
nodeids = 11,12,13,14
[[[rx]]]
names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
datacodes = h,h,h,h,h,h,h,h,h,h,h,L
scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
units = W,W,W,W,V,C,C,C,C,C,C,p

[[emontx3_cm]]
nodename = emontx3cm
nodeids = 15,16
[[[rx]]]
names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
whitening = 1

[[emontx3_cm_rf69n]]
nodename = emontx3cm
nodeids = 15,16
[[[rx]]]
names = MSG2, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
whitening = 0

[[emonth1]]
nodename = emonth
nodeids = 19,20,21,22
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacodes = h,h,h,h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V

[[emonth2]]
nodename = emonth
nodeids = 23,24,25,26
[[[rx]]]
names = temperature, external temperature, humidity, battery, pulsecount
datacodes = h,h,h,h,L
scales = 0.1,0.1,0.1,0.1,1
units = C,C,%,V,p

[[emonTx4]]
nodename = emonTx4
nodeids = 17,18
[[[rx]]]
names = MSG, Vrms, P1, P2, P3, P4, P5, P6, E1, E2, E3, E4, E5, E6, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,h,h,l,l,l,l,l,l,h,h,h,L
scales = 1,0.01,1,1,1,1,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,W,W,Wh,Wh,Wh,Wh,Wh,Wh,C,C,C,p
96 changes: 96 additions & 0 deletions conf/default.emonhub.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#######################################################################
####################### emonhub.conf #########################
#######################################################################
### emonHub configuration file, for info see documentation:
### https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md
#######################################################################
####################### emonHub settings #######################
#######################################################################

[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
loglevel = DEBUG
autoconf = 1
### Uncomment this to also send to syslog
# use_syslog = yes
#######################################################################
####################### Interfacers #######################
#######################################################################

[interfacers]
### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
[[EmonPi2]]
Type = EmonHubOEMInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0
com_baud = 38400
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12,

[[USB0]]
Type = EmonHubOEMInterfacer
[[[init_settings]]]
com_port = /dev/ttyUSB0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12,
nodename = emonTx4

[[SPI]]
Type = EmonHubRFM69LPLInterfacer
[[[init_settings]]]
nodeid = 5
networkID = 210
[[[runtimesettings]]]
pubchannels = ToEmonCMS,


[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 127.0.0.1
mqtt_port = 1883
mqtt_user = emonpi
mqtt_passwd = emonpimqtt2016

[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,

# emonhub/rx/10/values format
# Use with emoncms Nodes module
node_format_enable = 0
node_format_basetopic = emonhub/

# emon/emontx/power1 format - use with Emoncms MQTT input
# http://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
nodevar_format_enable = 1
nodevar_format_basetopic = emon/

# Single JSON payload published - use with Emoncms MQTT
node_JSON_enable = 0
node_JSON_basetopic = emon/

[[emoncmsorg]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
url = https://emoncms.org
apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
senddata = 1 # Enable sending data to Emoncms.org
sendnames = 1 # Send full input names (compression will be automatically enabled)
interval = 30 # Bulk send interval to Emoncms.org in seconds

#######################################################################
####################### Nodes #######################
#######################################################################

## See config user guide: https://github.com/openenergymonitor/emonhub
## If autoconf is enabled above, node configuration will automatically
## populate based on templates listed in available.conf

[nodes]
8 changes: 8 additions & 0 deletions conf/interfacer_examples/Emoncms/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ The EmonHubEmoncmsHTTPInterfacer configuration that is used for sending data to
apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
senddata = 1
sendstatus = 1
sendnames = 1
compress = 1
```

`sendstatus` - It is possible to the EmonHubEmoncmsHTTPInterfacer to send a 'ping' to the destination emoncms that can be picked up by the myip module which will then list the source IP address. This can be useful for remote login to a home emonpi if port forwarding is enabled on your router.

`senddata` - If you only want to send the ping request, and no data, to emoncms.org set this to 0

`sendnames` - sends input names in addition to values, makes sure compress is also enabled.

`compress` - compress data, particularly important if sendnames is enabled as this effectively removes the overhead of adding in the names to every packet. Compress is enabled automatically if sendnames is enabled.

You can create more than one of these sections to send data to multiple emoncms instances. For example, if you wanted to send to an emoncms running at emoncms.example.com (or on a local LAN) you would add the following underneath the `emoncmsorg` section described above:

```text
Expand All @@ -32,6 +38,8 @@ You can create more than one of these sections to send data to multiple emoncms
apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
senddata = 1
sendstatus = 1
sendnames = 1
compress = 1
```

This time, the API key will be the API key from your account at emoncms.example.com.
17 changes: 17 additions & 0 deletions conf/interfacer_examples/JaguarLandRover/jlr.emonhub.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#######################################################################
####################### emonhub.conf #########################
#######################################################################

[interfacers]

### Retrieves data from the Jaguar Land Rover API for electric car monitoring
[[JaguarLandRover]]
Type = EmonHubJaguarLandRoverInterfacer
[[[init_settings]]]
timeinverval = 600
duringchargetimeinterval = 60
nodeid = 28
jlrusername = USERNAMEGOESHERE
jlrpassword = PASSWORDGOESHERE
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
51 changes: 51 additions & 0 deletions conf/interfacer_examples/JaguarLandRover/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Jaguar Land Rover Interfacer #

This interfacer collects data from Jagular Land Rover's InControl API. Data collected on vehicle state of charge is suitable for use with OpenEVSE via MQTT.

Tested with Range Rover Velar PHEV.

## Readings ##

The following values (in order) are determined from the Jaguar Land Rover API.

* ODOMETER_MILES
* EV_STATE_OF_CHARGE
* EV_RANGE_ON_BATTERY_MILES
* EV_RANGE_ON_BATTERY_KM
* EV_CHARGING_RATE_SOC_PER_HOUR
* EV_SECONDS_TO_FULLY_CHARGED
* EV_CHARGING_STATUS (1 or 0)

## Sample config for emonhub.conf ##

Sample configuration, add these settings under the [interfacers] tag. Changing username and password to match those for your account on https://incontrol.landrover.com/

```
[[JaguarLandRover]]
Type = EmonHubJaguarLandRoverInterfacer
[[[init_settings]]]
timeinverval = 600
duringchargetimeinterval = 60
nodeid = 28
jlrusername = USERNAMEGOESHERE
jlrpassword = PASSWORDGOESHERE
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
```

## Settings ##

### timeinverval ###
Interval between taking readings from API. Normally 10 minutes (600 seconds)

### duringchargetimeinterval ###
When charging the API updates more frequently, so update every 1 minute when charging is detected (60 seconds)

### nodeid ###
The emonHub/emonCMS nodeId to use

### jlrusername ###
Username as used in the https://incontrol.landrover.com/ site

### jlrpassword ###
Password as used in the https://incontrol.landrover.com/ site
7 changes: 7 additions & 0 deletions conf/interfacer_examples/OEM/oem.emonhub.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[OEM]]
Type = EmonHubOEMInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
31 changes: 31 additions & 0 deletions conf/interfacer_examples/OEM/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### OEM Interfacer

Replaces EmonHubJeeInterfacer with a more flexible implementation that can accept a range of different formats from connected devices, including OpenEnergyMonitor devices. Here are a number of supported data formats:

- Decimal space seperate representation of RFM binary data e.g OK 5 0 0 0 0 (-0)
- KEY:VALUE format e.g power1:100,power2:200
- JSON format e.g {"power1":100,"power2":200}

Example configuration:

```text
[[OEM]]
Type = EmonHubOEMInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
```

```
[[usbdata]]
Type = EmonHubOEMInterfacer
[[[init_settings]]]
com_port = /dev/ttyUSB0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12,
```
7 changes: 7 additions & 0 deletions conf/interfacer_examples/RF69/RF69.emonhub.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[SPI]]
Type = EmonHubRF69Interfacer
[[[init_settings]]]
nodeid = 5
group = 210
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
19 changes: 19 additions & 0 deletions conf/interfacer_examples/RF69/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### RF69 Interfacer

Read data directly from a RFM69cw module on a RaspberryPi:

```text
[[SPI]]
Type = EmonHubRF69Interfacer
[[[init_settings]]]
nodeid = 5
group = 210
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
```

Steps to get working:

1. Enable SPI in raspi-config:
2. sudo adduser emonhub spi
3. sudo apt-get install python3-spidev (may just upgrade an existing package)
Loading

0 comments on commit 8c4b4ef

Please sign in to comment.