#!/bin/bash # # I gave the variables (DATE TIME GENW VOLT etc) the same names I used in the Python script. # It made things easier to keep track of. They can be given any name you like. # # Generate a "here doc" that takes its data from the meter_data.txt file written by the Python script. read DATE TIME VOLTAGE AMPS FREQUENCY POWER TOTKWH < /home/pi/DDSD285/meter_data.txt # # #/usr/bin/curl -s -m 3 --connect-timeout 2 "http://192.168.0.182/emoncms/input/post?node=TWHGOFFICE&csv=$POWER,$TOTKWH&apikey=5880fef251b2409d66e2a28cf6d30493" > /dev/null /usr/bin/curl -s -m 3 --connect-timeout 2 "http://192.168.0.182/emoncms/input/post?node=TWHGOFFICE&json={POWER:$POWER,TOTKWH:$TOTKWH,VOLTAGE:$VOLTAGE,AMPS:$AMPS}&apikey=5880fef251b2409d66e2a28cf6d30493" > /dev/$ # # -s is the curl "silent" switch. # -m sets the maximun amount of time (in seconds) curl is allowed for the entire send transaction. # set the node number to the node that has the data you want to transmit. # # Variables # GENW = GENerated power in Watts, from my pv system # HTOT = House TOTal. total house load, in Watts. # VOLT = self explanatory. # CONS = present CONSumption in Watts. # TEC = Total Energy Consumed in KWh. # IMPA = IMPorted energy, Leg A, in KWh. # IMPB = IMPorted energy, Leg B, in KWh. # EXPA = EXPorted energy, Leg A, in KWh. # EXPB = EXPorted energy, Leg B, in KWh. # NETA = NET energy, Leg A. # NETB = NET energy, Leg B. # NETC = pv production in KWh.