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.
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
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.
-
- Posts: 115
- Joined: Thu Mar 02, 2023 10:15 pm
- Location: germany
- Has thanked: 64 times
- Been thanked: 23 times
Re: Mini data logger Raspberry Pi Zero / Annex
thanks for sharing peridot
very interesting for me at the moment - I'm working on a similar project - reading out my "Hoymiles DTU" (AHOY- DTU) with the aim of controlling the microinverter - but I started today with coding - the first steps were already successful - I can read out the data with WGET
it should also be possible to read out a "shelly power meter" and thus control the power generation of the microinverter without feeding "back into the grid"
Of course, the data should then also be displayed on a nice VGA screen
have a nice day
Ron
very interesting for me at the moment - I'm working on a similar project - reading out my "Hoymiles DTU" (AHOY- DTU) with the aim of controlling the microinverter - but I started today with coding - the first steps were already successful - I can read out the data with WGET
it should also be possible to read out a "shelly power meter" and thus control the power generation of the microinverter without feeding "back into the grid"
Of course, the data should then also be displayed on a nice VGA screen
have a nice day
Ron
Modules : 3xESP32-Cam MB (Chip"DM ESP32 S" ),AI-Thinker Audio Kit (ES8388), ESP32 Dev Kit with Display