README
¶
go-owl
A local listener for the Owl Intuition energy monitor
Package owl reads a slice of bytes as broadcast by the Owl Intuition electricity monitor and decodes them into an ElecReading containing three channels of Power and Energy measurements. It also reports battery level, signal strength and timestamp. Although the Owl Intuition broadcasts weather readings these are ignored as they are of limited use. Errors are returned if the byte slice is not decoded successfully.
Further information on the Owl Intuition multicast and UDP messages formats can be found on the OWL Intuition support pages.
Full documentation: godoc.org/github.com/billglover/go-owl
Examples
- basic – logs electricity readings to the console
- multicast – similar to
basic
but listens to the multicast address - prometheus – exposes electricty readings as metrics for Prometheus
To run the basic example:
examples/multicast ▸ go build
examples/multicast ▸ ./multicast
2017-11-07 21:50:44 +0000 GMT : electricity reading : power=434.00w
2017-11-07 21:50:56 +0000 GMT : electricity reading : power=418.00w
2017-11-07 21:51:32 +0000 GMT : electricity reading : power=402.00w
Benchmarks
goos: darwin
goarch: amd64
pkg: github.com/billglover/go-owl
BenchmarkRead-8 50000 24739 ns/op
PASS
ok github.com/billglover/go-owl 1.496s
Note: remember, benchmarks allow for relative comparisons as actual performance is system dependence.
Contributing
Contributions are welcome. Please leave a comment on an issue if you are going to work on it.
Documentation
¶
Overview ¶
Package owl reads a slice of bytes as broadcast by the Owl Intuition electricity monitor and decodes them into an ElecReading containing three channels of Power and Energy measurements. It also reports battery level, signal strength and timestamp. Although the Owl Intuition broadcasts weather readings these are ignored as they are of limited use. Errors are returned if the byte slice is not decoded successfully.
Further information on the Owl Intuition multicast and UDP messages formats can be found on the OWL Intuition support pages.
https://theowl.zendesk.com/hc/en-gb/articles/201284603-Multicast-UDP-API-Information
Index ¶
Examples ¶
Constants ¶
const ( // MulticastAddress is the default address for the Owl Intuition. MulticastAddress string = "224.192.32.19:22600" )
Variables ¶
var ( // ErrWeatherPacket indicates we have received a weather packet. ErrWeatherPacket = errors.New("weather packets are not decoded") // ErrInvalidPacket indicates we were unable to decode a valid packet. ErrInvalidPacket = errors.New("unable to decode packet") )
Functions ¶
This section is empty.
Types ¶
type ElecChan ¶
ElecChan represents a single channel electricity reading containing both instantaneous Power and Energy used throughout the day.
type ElecReading ¶
type ElecReading struct { ID string Timestamp time.Time RSSI float64 LQI float64 Battery float64 Chan [3]ElecChan }
ElecReading represents a single electricity reading from the Owl Intuition.
func Read ¶
func Read(b []byte) (ElecReading, error)
Read takes a byte slice and returns an ElecReading containing three channels of data. It returns an empty reading and an error if decoding the byte slice was unsuccessful.
Example ¶
Output: 2017-11-06 06:48:31 +0000 UTC power=305.00 energy=1863.39 battery=100.00