solarman

package module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 6 Imported by: 3

README

go-solarman

Unnoficial Solarman Inverter API implementation in Go.

Only implements /token and /currentData endpoints for now.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(appID, appSecret, email, password string) (*Client, error)

func (*Client) CurrentData

func (c *Client) CurrentData(deviceID int) (CurrentData, error)

func (*Client) StationDevices added in v0.1.4

func (c *Client) StationDevices(stationID int) ([]Device, error)

func (*Client) Stations added in v0.1.4

func (c *Client) Stations() ([]Station, error)

type CurrentData

type CurrentData struct {
	Code           any        `json:"code"`
	Msg            any        `json:"msg"`
	Success        bool       `json:"success"`
	RequestID      string     `json:"requestId"`
	DeviceSn       string     `json:"deviceSn"`
	DeviceID       int        `json:"deviceId"`
	DeviceType     string     `json:"deviceType"`
	DeviceState    int        `json:"deviceState"`
	CollectionTime int        `json:"collectionTime"`
	DataList       []DataList `json:"dataList"`
}

type DataList

type DataList struct {
	Key   string `json:"key"`
	Value string `json:"value"`
	Unit  any    `json:"unit"`
	Name  string `json:"name"`
}

type Device added in v0.1.4

type Device struct {
	DeviceID       int    `json:"deviceId"`
	DeviceSn       string `json:"deviceSn"`
	DeviceType     string `json:"deviceType"`
	ConnectStatus  int    `json:"connectStatus"`
	CollectionTime int    `json:"collectionTime"`
}

type Station added in v0.1.4

type Station struct {
	ID                 int     `json:"id"`
	Name               string  `json:"name"`
	GenerationPower    float64 `json:"generationPower"`
	InstalledCapacity  float64 `json:"installedCapacity"`
	NetworkStatus      string  `json:"networkStatus"`
	LocationAddress    string  `json:"locationAddress"`
	GridInterconnType  string  `json:"gridInterconnectionType"`
	LastUpdateTime     int     `json:"lastUpdateTime"`
	StartOperatingTime int     `json:"startOperatingTime"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL