Howto feed data from my inverter to local emoncms

I have a Solutronic PV-inverter that i collect data from via a small shell script on my RPi. I would like to feed these data into my local emonCMS on the RPi.

I am currently feeding the data to PVoutput.org from a shell script via a curl string like:

curl -d "d=`date '+%Y%m%d'`" -d "t=`date '+%H:%M'`" \
 -d "v1=$eg1" -d "v2=$pg1" -d "v6=$udc" \
 -H "X-Pvoutput-Apikey: xxxxxxxxxxxxxxxxxxyyyyyyyyyyyzzzzzzzzzzz" \
 -H "X-Pvoutput-SystemId: 4950" http://pvoutput.org/service/r2/addstatus.jsp 

$eg1 is energy today until now
$pg1 is power generated
$udc is dc voltage.

The script is run every 5 mins from cron to update pvoutput.org with live data.

I have seached on this site but can't find definitions on how i could use a similar curl (or other) string from a shell script to feed the same data into my local emonCMS. Anyone that can point me i the right direction.

 

jensk's picture

Re: Howto feed data from my inverter to local emoncms

Read the wrong documentation - it was for emoncms version 2. That's why I could not get it to work.

I have got it right now and data is parsed to emoncms through this bash string:

 

curl "http://<ip-adress-of-emoncms>/emoncms/inout/post?json{<emoncms-input-
variable>:<bash-variable>}&apikey=<emoncms-api-key>"

 

 

 

TrystanLea's picture

Re: Howto feed data from my inverter to local emoncms

Excellent good work, good to see it used this way, Im working on improving the documentation so hopefully things should be clearer in the future

jensk's picture

Re: Howto feed data from my inverter to local emoncms

Yes it is nice to get everything working even for a arduino newbie like me. Right now i have one Funky sensor delivering temp data to my RFM12Pi and my solar data is injected via curl from my bash script.

Thank you for a good emoncms

allmac's picture

Re: Howto feed data from my inverter to local emoncms

I send some data to Emoncms using shell script and MQTT.

SAMPLE (Emoncms server Raspberry-Pi data):

#!/bin/bash

declare -a mem
mem=$(free -m | grep -n 'Me' | awk '{ print $2","$3","$4","$5","$6 }')
GPU_temp=$(($(cat /sys/class/thermal/thermal_zone0/temp)/1000))
CPU_temp=$(/opt/vc/bin/vcgencmd measure_temp | cut -d "=" -f2 | cut -d "'" -f1)
CPU_usage=$(top -bn2  | grep "Cpu(s)" | tail -1 | cut -c36-40 | sed 's/,/./' | xargs)

dados=$(printf "%s,%s,%s,%s" "$mem" "$GPU_temp" "$CPU_temp" "$CPU_usage")

mosquitto_pub -h 192.168.1.11 -t emonhub/rx/12/values -m "$dados"
mosquitto_pub -h 192.168.1.11 -t emonhub/tx/12/values -m "$dados"

RX goes to NODES
TX goes to INPUT/Feeds (I did a hacked version of EmonHubMqttInterfacer to do this directly)

pseudoruprecht's picture

Re: Howto feed data from my inverter to local emoncms

You might want to give Node-RED a try, now that it's included in the latest Image [1]  and the Raspbian Jessie repositories. There's a first glimpse at what can be achieved at [2].

Together with the Johnny5-node from [3], driving an Arduino (via Firmata) is straightforward.

 

[1] http://openenergymonitor.org/emon/node/11799

[2] http://openenergymonitor.blogspot.de/2015/10/emonpi-nodered-and-mqtt.html

[3] http://flows.nodered.org/node/node-red-contrib-gpio

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.