Mini data logger Raspberry Pi Zero / Annex
Mini data logger Raspberry Pi Zero / Annex
RPI Zero running EmonCMS software with all the data collection processing handled by Annex via MQTT to Emoncms. Annex also controlling power / UPS / shutdown etc. Few charts attached of data collected, House Power and Network RSSI.
You do not have the required permissions to view the files attached to this post.
Re: Mini data logger Raspberry Pi Zero / Annex
Here Annex is combining the data from a Fronius Solar controller (Annex makes the API request) with the data from the energy meter (pulse detector as CT sensors are not easy to install in Australia due to the construction of the Electricity Meter Box). Annex is then making the Grid power calculations/values and then sending all this data as a MQTT post (mqtt server runs on the Pi as part of the EmonCms install)
Snippets of the Annex Code
Snippets of the Annex Code
Code: [Local Link Removed for Guests]
Sub gridpower
wlog "Gridpower"
Local gridwatts,ginpower,goutpower,rndom
gridwatts=upower
'upower=(upower*3600)/10
'check for solar contribution
If gridwatts>0 Then
'smooth upower,s3(),3
ginpower=upower
goutpower=0
'upower=Int(upower)+spower 'add solar to grid power for total usage
upower=Int(upower) 'Grud usage only
Else 'no grid input so solar is greater than usage
' print "Calc Power Usage.."
'so apply just an average as usage and the balance as grid out
rndom=Rnd(100) + gridavg
'print "Random:"; random
'smooth rndom,s1(),6
upower=Int(rndom)
'print "smooth:"; upower
ginpower=upower-spower
checkpos ginpower
goutpower=spower-upower
checkpos goutpower
End If
wlog "latest watts:";upower
wlog "latest Solar:";spower
wlog "to Grid:";goutpower
wlog "from Grid:";ginpower
power$="{"+q$+"power"+q$+":"+Str$(upower)+","+q$+"solar"+q$+":"+Str$(spower)+","+q$+"gridout"+q$+":"+Str$(goutpower)+","+q$+"gridin"+q$+":"+Str$(ginpower)+","+q$+"gridavg"+q$+":"+Str$(gridavg)+"}"
'wlog power$
'
wlog mqtt.publish("emon/STA1", power$)
End Sub
sub fronius
wgetasync ("192.168.0.41/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceID=1&DataCollection=CommonInverterData",80)
end sub
answer_done:
'wlog WGETRESULT$
'Body.Data.PAC.Value
ret$=json$(WGETRESULT$,"PAC.Value")
if ret$ <> "not found" then
sw$=ret$
sw$=replace$(sw$,": ","")
wlog "Solar ";sw$
end if
Return
You do not have the required permissions to view the files attached to this post.