mlnoga / rct

A library for communication with solar power inverters of the RCT power brand, not endorsed by or affiliated with the eponymous company.
GNU Lesser General Public License v2.1
6 stars 2 forks source link
battery golang pv rct-power solar

rct

A library for communication with solar power inverters of the RCT power brand. Tested with the RCT PS 6.0 solar power inverter, battery and grid power sensor.

RCT power is a registered trademark of RCT Power GmbH. This library is not provided by, endorsed by, supported by or affiliated with the company in any way.

It is provided without any warranties, entirely for use at your own risk under a LGPL 2.1 license.

Usage

Install via go get github.com/mlnoga/rct.

Use like this:

package main

import (
  "rct"
  "time"
  "fmt"
)

func main() {
  conn, err:=rct.NewConnection("my-RCT-hostname-or-IP-address", time.Second*2)
  if err!=nil {
    fmt.Println(err)
    return
  }
  defer conn.Close()

  a, err:=rct.QueryFloat32(rct.SolarGenAPowerW)
  if err!=nil {
    fmt.Println(err)
    return
  }

  fmt.Printf("%s is %.0fV\n", string(rct.SolarGenAPowerW), a)
}

Architecture