Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skoef/pvoutput
Golang API client for pvoutput.org
https://github.com/skoef/pvoutput
Last synced: about 1 month 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-05T07:50:10.000Z (over 3 years ago)
- Last Synced: 2023-03-11T13:03:16.120Z (almost 2 years 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
[![Go Report Card](https://goreportcard.com/badge/github.com/skoef/pvoutput)](https://goreportcard.com/report/github.com/skoef/pvoutput) [![Documentation](https://godoc.org/github.com/skoef/pvoutput?status.svg)](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 mainimport (
"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)
}
}
```