https://github.com/skoef/pvoutput
Golang API client for pvoutput.org
https://github.com/skoef/pvoutput
Last synced: 11 months ago
JSON representation
Golang API client for pvoutput.org
- Host: GitHub
- URL: https://github.com/skoef/pvoutput
- Owner: skoef
- Created: 2020-08-18T17:46:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-05T07:50:10.000Z (almost 5 years ago)
- Last Synced: 2025-01-07T23:53:58.705Z (over 1 year ago)
- Language: Go
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://goreportcard.com/report/github.com/skoef/pvoutput) [](http://godoc.org/github.com/skoef/pvoutput)
# Golang API Client for PVOutput.org
This is a golang library to interact with the [PVOutput](https://pvoutput.org) API.
## Example usage:
```golang
package main
import (
"time"
"github.com/skoef/pvoutput"
)
func main() {
// create an API client per system you want to manage
api := pvoutput.NewAPI("XXX", "12345", false)
// get PV generation data from your solar inverter or
// power consumption data from your utility meter
//
// ...
// format data in pvoutput struct
output := pvoutput.NewOutput()
output.Date = time.Now()
output.Generated = 4567 // 4.5 kWh
output.Consumed = 7124 // 7.1 kWh
// write data to API
err := api.AddOutput(output)
if err != nil {
panic(err)
}
}
```