lgpcs

package
v0.0.0-...-cdc5bdb Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package lgpcs implements access to the LG pcs device (aka inverter). Pcs is the LG power conditioning system that converts the PV (or battery) - DC current into AC current (and controls the batteries)

Index

Constants

View Source
const (
	LoginURI     = "/v1/login"
	UserLoginURI = "/v1/user/setting/login"
	MeterURI     = "/v1/user/essinfo/home"
)

URIs

Variables

This section is empty.

Functions

This section is empty.

Types

type Com

type Com struct {
	*request.Helper
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance(uri, registration, password string, cache time.Duration) (*Com, error)

GetInstance implements the singleton pattern to handle the access via the authkey to the PCS of the LG ESS HOME system

func (*Com) Data

func (m *Com) Data() (EssData, error)

Data gives the data read from the pcs.

func (*Com) Login

func (m *Com) Login() error

Login calls login and stores the returned authorization key

type EssData

type EssData struct {
	GridPower               float64 `json:"grid_power,string"`
	PvTotalPower            float64 `json:"pcs_pv_total_power,string"`
	BatConvPower            float64 `json:"batconv_power,string"`
	BatUserSoc              float64 `json:"bat_user_soc,string"`
	CurrentGridFeedInEnergy float64 `json:"current_grid_feed_in_energy,string"`
	CurrentPvGenerationSum  float64 `json:"current_pv_generation_sum,string"`
}

type MeterResponse

type MeterResponse struct {
	Statistics EssData
	Direction  struct {
		IsGridSelling        int `json:"is_grid_selling_,string"`
		IsBatteryDischarging int `json:"is_battery_discharging_,string"`
	}
}

Jump to

Keyboard shortcuts

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