sensonet

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 18 Imported by: 1

README

sensonet

sensonet is a library that provides functions to read data from Vaillant heating systems, especially heat pumps, and to initiate certain routines on these systems. The communication works via the myVaillant portal and the sensonet module (VR921). So you need a Vaillant heating system with a VR921 module and a myVaillant user account. (Presumably the library also works with a VR940f instead of a VR921.)

Features

  • Initalisation of communication to the user account provided
  • Reading which "homes" are available under the user account
  • Reading the system information for a selected systemId consisting of configuration data, property data and state data
  • Reading the device information for a selected systemId
  • Reading the historical energy data for selected devices
  • Reading the current power consumption for selected systemId and underlying devices (this is unfortunately not supported by all heating systems)
  • Starting and stopping of hotwater boosts and of zone quick veto sessions
  • Starting and stopping of strategy based quick mode sessions
  • Data read from the myVaillant portal are cached by in a controller object to limit the number of http requests to the portal. The usage of this controller and its methods is recommended, but you can also relinquish to use the controller and use the functions (methods of the connection object) that directly do http requests.

Acknowledgements

Which Vaillant urls to use and which and how data have to be sent to the Vaillant API are partly inspired by the myPyllant project of signalkraft. Many thanks for that!

Getting Started

This project is still in a preliminary state.

Documentation

Index

Constants

View Source
const (
	CLIENT_ID    = "myvaillant"
	REDIRECT_URL = "enduservaillant.page.link://login"

	AUTH_BASE_URL     = "https://identity.vaillant-group.com/auth/realms"
	LOGIN_URL         = AUTH_BASE_URL + "/%s/login-actions/authenticate"
	TOKEN_URL         = AUTH_BASE_URL + "/%s/protocol/openid-connect/token"
	AUTH_URL          = AUTH_BASE_URL + "/%s/protocol/openid-connect/auth"
	API_URL_BASE      = "https://api.vaillant-group.com/service-connected-control/end-user-app-api/v1"
	HOTWATERBOOST_URL = "/systems/%s/tli/domestic-hot-water/%01d/boost"
	ZONEQUICKVETO_URL = "/systems/%s/tli/zones/%01d/quick-veto"
	SYSTEMS_URL       = "/systems/%s/tli"
	DEVICES_URL       = "/emf/v2/%s/currentSystem"
	ENERGY_URL        = "/emf/v2/%s/devices/%s/buckets?"
	MPC_URL           = "/hem/%s/mpc"
)
View Source
const (
	HOTWATERINDEX_DEFAULT                = 255
	ZONEINDEX_DEFAULT                    = 0
	ZONEVETOSETPOINT_DEFAULT             = 20.0
	ZONEVETODURATION_DEFAULT             = 3.0 // 3 hours as default
	OPERATIONMODE_TIME_CONTROLLED string = "TIME_CONTROLLED"
	QUICKMODE_HOTWATER            string = "Hotwater Boost"
	QUICKMODE_HEATING             string = "Heating Quick Veto"
	QUICKMODE_NOTHING             string = "Charger running idle"
	QUICKMODE_ERROR_ALREADYON     string = "Error. A quickmode is already running"

	SPECIAL_FUNCTION_QUICK_VETO     = "QUICK_VETO"
	SPECIAL_FUNCTION_HOTWATER_BOOST = "CYLINDER_BOOST"
)
View Source
const (
	STRATEGY_NONE                  = 0
	STRATEGY_HOTWATER              = 1
	STRATEGY_HEATING               = 2
	STRATEGY_HOTWATER_THEN_HEATING = 3
)
View Source
const (
	DEVICES_ALL              = 0
	DEVICES_PRIMARY_HEATER   = 1
	DEVICES_SECONDARY_HEATER = 2
	DEVICES_BACKUP_HEATER    = 3
)
View Source
const (
	RESOLUTION_HOUR  = "HOUR"
	RESOLUTION_DAY   = "DAY"
	RESOLUTION_MONTH = "MONTH"
)
View Source
const CACHE_DURATION_DEVICES = 1800
View Source
const CACHE_DURATION_HOMES = 1800
View Source
const CACHE_DURATION_MPCDATA = 90
View Source
const CACHE_DURATION_SYSTEMS = 90
View Source
const REALM_GERMANY = "vaillant-germany-b2c"

Variables

View Source
var (
	JSONContent = "application/json"
	// JSONEncoding specifies application/json
	JSONEncoding = map[string]string{
		"Content-Type": JSONContent,
		"Accept":       JSONContent,
	}
	// AcceptJSON accepting application/json
	AcceptJSON = map[string]string{
		"Accept": JSONContent,
	}
)
View Source
var ErrMustRetry = errors.New("must retry")

ErrMustRetry indicates that a rate-limited operation should be retried

View Source
var ErrTimeout = errors.New("timeout")

ErrTimeout is the error returned when a timeout happened. Modeled after context.DeadlineError

Functions

func Cached

func Cached[T any](g func() (T, error), cache time.Duration) func() (T, error)

Cached wraps a getter with a cache

func ReadBody

func ReadBody(resp *http.Response) ([]byte, error)

ReadBody reads HTTP response and returns error on response codes other than HTTP 2xx. It closes the request body after reading.

func ResetCached

func ResetCached()

func ResettableCached

func ResettableCached[T any](g func() (T, error), cache time.Duration) *cached[T]

ResettableCached wraps a getter with a cache. It returns a `Cacheable`. Instead of the cached getter, the `Get()` and `Reset()` methods are exposed.

func ResponseError

func ResponseError(resp *http.Response) error

ResponseError turns an HTTP status code into an error

Types

type AllSystemDevices added in v0.0.3

type AllSystemDevices struct {
	SystemDevicesAndSystemId []SystemDevicesAndSystemId
}

type AllSystemMpcData added in v0.0.3

type AllSystemMpcData struct {
	SystemMpcData []SystemMpcData
}

type AllSystems added in v0.0.3

type AllSystems struct {
	SystemsAndStatus []SystemAndStatus
}

type Cacheable

type Cacheable[T any] interface {
	Get() (T, error)
	Reset()
}

Cacheable is the interface for a resettable cache

type ConfigurationCircuit

type ConfigurationCircuit struct {
	Index                                  int     `json:"index"`
	HeatingCurve                           float64 `json:"heatingCurve"`
	HeatingFlowTemperatureMinimumSetpoint  float64 `json:"heatingFlowTemperatureMinimumSetpoint"`
	HeatingFlowTemperatureMaximumSetpoint  float64 `json:"heatingFlowTemperatureMaximumSetpoint"`
	HeatDemandLimitedByOutsideTemperature  float64 `json:"heatDemandLimitedByOutsideTemperature"`
	HeatingCircuitFlowSetpointExcessOffset float64 `json:"heatingCircuitFlowSetpointExcessOffset"`
	SetBackModeEnabled                     bool    `json:"setBackModeEnabled"`
	RoomTemperatureControlMode             string  `json:"roomTemperatureControlMode"`
}

type ConfigurationDhw

type ConfigurationDhw struct {
	Index                      int         `json:"index"`
	OperationModeDhw           string      `json:"operationModeDhw"`
	TappingSetpoint            float64     `json:"tappingSetpoint"`
	HolidayStartDateTime       time.Time   `json:"holidayStartDateTime"`
	HolidayEndDateTime         time.Time   `json:"holidayEndDateTime"`
	TimeProgramDhw             TimeProgram `json:"timeProgramDhw"`
	TimeProgramCirculationPump TimeProgram `json:"timeProgramCirculationPump"`
}

type ConfigurationDomesticHotWater

type ConfigurationDomesticHotWater struct {
	Index                         int         `json:"index"`
	OperationModeDomesticHotWater string      `json:"operationModeDomesticHotWater"`
	TappingSetpoint               float64     `json:"tappingSetpoint"`
	HolidayStartDateTime          time.Time   `json:"holidayStartDateTime"`
	HolidayEndDateTime            time.Time   `json:"holidayEndDateTime"`
	TimeProgramDomesticHotWater   TimeProgram `json:"timeProgramDomesticHotWater"`
	TimeProgramCirculationPump    TimeProgram `json:"timeProgramCirculationPump"`
}

type ConfigurationZone

type ConfigurationZone struct {
	Index   int `json:"index"`
	General struct {
		Name                 string    `json:"name"`
		HolidayStartDateTime time.Time `json:"holidayStartDateTime"`
		HolidayEndDateTime   time.Time `json:"holidayEndDateTime"`
		HolidaySetpoint      float64   `json:"holidaySetpoint"`
	} `json:"general"`
	Heating struct {
		OperationModeHeating      string      `json:"operationModeHeating"`
		SetBackTemperature        float64     `json:"setBackTemperature"`
		ManualModeSetpointHeating float64     `json:"manualModeSetpointHeating"`
		TimeProgramHeating        TimeProgram `json:"timeProgramHeating"`
	} `json:"heating"`
}

type ConnOption added in v0.0.3

type ConnOption func(*Connection)

func WithHttpClient added in v0.0.2

func WithHttpClient(client *http.Client) ConnOption

type Connection

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

Connection is the Sensonet connection

func NewConnection

func NewConnection(ts oauth2.TokenSource, opts ...ConnOption) (*Connection, error)

NewConnection creates a new Sensonet device connection.

func (*Connection) GetDeviceCurrentPower added in v0.0.3

func (c *Connection) GetDeviceCurrentPower(systemId, deviceUuid string) (DevicePowerMap, error)

Returns the current power consumption and product name for deviceUuid. If "All" is given as deviceUuid, then the function return the power consumption and product name for all devices of systemId

func (*Connection) GetDeviceData

func (c *Connection) GetDeviceData(systemId string, whichDevices int) ([]DeviceAndInfo, error)

Returns the device data for given criteria

func (*Connection) GetEnergyData

func (c *Connection) GetEnergyData(systemId, deviceUuid, operationMode, energyType, resolution string, startDate, endDate time.Time) (EnergyData, error)

Returns the energy data for systemId, deviceUuid and other given criteria

func (*Connection) GetHomes

func (c *Connection) GetHomes() ([]Home, error)

Returns all "homes" that belong to the current user under the myVaillant portal

func (*Connection) GetMpcData added in v0.0.3

func (c *Connection) GetMpcData(systemId string) ([]MpcDevice, error)

Returns the mpc data for systemId

func (*Connection) GetSystem

func (c *Connection) GetSystem(systemId string) (SystemStatus, error)

Returns the system report (state, properties and configuration) for a specific systemId

func (*Connection) GetSystemCurrentPower added in v0.0.3

func (c *Connection) GetSystemCurrentPower(systemId string) (float64, error)

Returns the current power consumption for systemId

func (*Connection) GetSystemDevices added in v0.0.3

func (c *Connection) GetSystemDevices(systemId string) (SystemDevices, error)

Returns the system devices for a specific systemId

func (*Connection) StartHotWaterBoost

func (c *Connection) StartHotWaterBoost(systemId string, hotwaterIndex int) error

func (*Connection) StartZoneQuickVeto

func (c *Connection) StartZoneQuickVeto(systemId string, zone int, setpoint float32, duration float32) error

func (*Connection) StopHotWaterBoost

func (c *Connection) StopHotWaterBoost(systemId string, hotwaterIndex int) error

func (*Connection) StopZoneQuickVeto

func (c *Connection) StopZoneQuickVeto(systemId string, zone int) error

type Controller added in v0.0.3

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

func NewController added in v0.0.3

func NewController(conn *Connection, opts ...CtrlOption) (*Controller, error)

NewController creates a new Sensonet controller.

func (*Controller) GetCurrentQuickMode added in v0.0.3

func (c *Controller) GetCurrentQuickMode() string

func (*Controller) GetDeviceCurrentPower added in v0.0.3

func (c *Controller) GetDeviceCurrentPower(systemId, deviceUuid string) (DevicePowerMap, error)

Returns the current power consumption and product name for deviceUuid. If "All" is given as deviceUuid, then the function return the power consumption and product name for all devices of systemId

func (*Controller) GetDeviceData added in v0.0.3

func (c *Controller) GetDeviceData(systemId string, whichDevices int) ([]DeviceAndInfo, error)

Returns the device data for given criteria

func (*Controller) GetEnergyData added in v0.0.3

func (c *Controller) GetEnergyData(systemId, deviceUuid, operationMode, energyType, resolution string, startDate, endDate time.Time) (EnergyData, error)

Returns the energy data for systemId, deviceUuid and other given criteria

func (*Controller) GetHomes added in v0.0.3

func (c *Controller) GetHomes() ([]Home, error)

Returns all "homes" that belong to the current user under the myVaillant portal

func (*Controller) GetMpcData added in v0.0.3

func (c *Controller) GetMpcData(systemId string) ([]MpcDevice, error)

Returns the mpc data for systemId

func (*Controller) GetQuickModeExpiresAt added in v0.0.4

func (c *Controller) GetQuickModeExpiresAt() string

func (*Controller) GetSystem added in v0.0.3

func (c *Controller) GetSystem(systemId string) (SystemStatus, error)

Returns the system report (state, properties and configuration) for a specific systemId

func (*Controller) GetSystemCurrentPower added in v0.0.3

func (c *Controller) GetSystemCurrentPower(systemId string) (float64, error)

Returns the current power consumption for systemId

func (*Controller) GetSystemDevices added in v0.0.3

func (c *Controller) GetSystemDevices(systemId string) (SystemDevices, error)

Returns the system devices for a specific systemId

func (*Controller) StartHotWaterBoost added in v0.0.3

func (c *Controller) StartHotWaterBoost(systemId string, hotwaterIndex int) error

func (*Controller) StartStrategybased added in v0.0.3

func (c *Controller) StartStrategybased(systemId string, strategy int, heatingPar *HeatingParStruct, hotwaterPar *HotwaterParStruct) (string, error)

func (*Controller) StartZoneQuickVeto added in v0.0.3

func (c *Controller) StartZoneQuickVeto(systemId string, zone int, setpoint float32, duration float32) error

func (*Controller) StopHotWaterBoost added in v0.0.3

func (c *Controller) StopHotWaterBoost(systemId string, hotwaterIndex int) error

func (*Controller) StopStrategybased added in v0.0.3

func (c *Controller) StopStrategybased(systemId string, heatingPar *HeatingParStruct, hotwaterPar *HotwaterParStruct) (string, error)

func (*Controller) StopZoneQuickVeto added in v0.0.3

func (c *Controller) StopZoneQuickVeto(systemId string, zone int) error

func (*Controller) WhichQuickMode added in v0.0.3

func (c *Controller) WhichQuickMode(dhwData *DhwData, domesticHotWaterData *DomesticHotWaterData, zoneData *ZoneData, strategy int, heatingPar *HeatingParStruct, hotwater *HotwaterParStruct) int

This function checks the operation mode of heating and hotwater and the hotwater live temperature and returns, which quick mode should be started, when evcc sends an "Enable"

type CredentialsStruct

type CredentialsStruct struct {
	User     string `json:"user"`
	Password string `json:"password"`
	Realm    string `json:"realm"`
	HomeName string `json:"homeName"` // optional parameter, if several homes are defined under one account
}

type CtrlOption added in v0.0.3

type CtrlOption func(*Controller)

func WithLogger added in v0.0.2

func WithLogger(logger Logger) CtrlOption

type Device

type Device struct {
	DeviceUUID         string    `json:"device_uuid"`
	EbusID             string    `json:"ebus_id"`
	Spn                int       `json:"spn"`
	BusCouplerAddress  int       `json:"bus_coupler_address"`
	ArticleNumber      string    `json:"article_number"`
	EmfValid           bool      `json:"emfValid"`
	DeviceSerialNumber string    `json:"device_serial_number"`
	DeviceType         string    `json:"device_type"`
	FirstData          time.Time `json:"first_data"`
	LastData           time.Time `json:"last_data"`
	Data               []struct {
		OperationMode string    `json:"operation_mode"`
		ValueType     string    `json:"value_type"`
		Calculated    bool      `json:"calculated"`
		From          time.Time `json:"from"`
		To            time.Time `json:"to"`
	} `json:"data"`
	ProductName string `json:"product_name"`
}

type DeviceAndInfo

type DeviceAndInfo struct {
	Device Device
	Info   string
}

type DevicePower added in v0.0.3

type DevicePower struct {
	CurrentPower float64
	ProductName  string
}

type DevicePowerMap added in v0.0.3

type DevicePowerMap map[string]DevicePower

type DhwData

type DhwData struct {
	State         StateDhw
	Properties    PropertiesDhw
	Configuration ConfigurationDhw
}

func GetDhwData

func GetDhwData(state SystemStatus, index int) *DhwData

type DomesticHotWaterData

type DomesticHotWaterData struct {
	State         StateDomesticHotWater
	Properties    PropertiesDomesticHotWater
	Configuration ConfigurationDomesticHotWater
}

func GetDomesticHotWaterData

func GetDomesticHotWaterData(state SystemStatus, index int) *DomesticHotWaterData

type EnergyData

type EnergyData struct {
	ExtraFields struct {
		Timezone string `json:"timezone"`
	} `json:"extra_fields"`
	OperationMode string `json:"operationMode"`
	//	SkipDataUpdate   bool    `json:"skip_data_update"`
	//	DataFrom         any     `json:"data_from"`
	//	DataTo           any     `json:"data_to"`
	StartDate  time.Time `json:"startDate"`
	EndDate    time.Time `json:"endDate"`
	Resolution string    `json:"resolution"`
	EnergyType string    `json:"energyType"`
	//	ValueType        any     `json:"valueType"`
	//	Calculated       any     `json:"calculated"`
	TotalConsumption float64 `json:"totalConsumption"`
	Data             []struct {
		ExtraFields struct {
			Timezone string `json:"timezone"`
		} `json:"extra_fields"`
		StartDate time.Time `json:"startDate"`
		EndDate   time.Time `json:"endDate"`
		Value     float64   `json:"value"`
	} `json:"data"`
}

type HeatingParStruct

type HeatingParStruct struct {
	ZoneIndex    int
	VetoSetpoint float32
	VetoDuration float32
}

type Helper

type Helper struct {
	*http.Client
}

Helper provides utility primitives

type Home added in v0.0.6

type Home struct {
	HomeName string `json:"homeName"`
	Address  struct {
		Street      string `json:"street"`
		Extension   any    `json:"extension"`
		City        string `json:"city"`
		PostalCode  string `json:"postalCode"`
		CountryCode string `json:"countryCode"`
	} `json:"address"`
	SerialNumber    string `json:"serialNumber"`
	SystemID        string `json:"systemId"`
	ProductMetadata struct {
		ProductType    string `json:"productType"`
		ProductionYear string `json:"productionYear"`
		ProductionWeek string `json:"productionWeek"`
		ArticleNumber  string `json:"articleNumber"`
	} `json:"productMetadata"`
	State               string    `json:"state"`
	MigrationState      string    `json:"migrationState"`
	MigrationFinishedAt time.Time `json:"migrationFinishedAt"`
	OnlineState         string    `json:"onlineState"`
	Firmware            struct {
		Version        string `json:"version"`
		UpdateEnabled  bool   `json:"updateEnabled"`
		UpdateRequired bool   `json:"updateRequired"`
	} `json:"firmware"`
	Nomenclature       string `json:"nomenclature"`
	Cag                bool   `json:"cag"`
	CountryCode        string `json:"countryCode"`
	ProductInformation string `json:"productInformation"`
	FirmwareVersion    string `json:"firmwareVersion"`
}

type Homes

type Homes []Home

type HotwaterParStruct

type HotwaterParStruct struct {
	Index int
}

type Logger added in v0.0.2

type Logger interface {
	Printf(msg string, arg ...any)
}

type MetaInfo

type MetaInfo struct {
	MinSlotsPerDay          int  `json:"minSlotsPerDay"`
	MaxSlotsPerDay          int  `json:"maxSlotsPerDay"`
	SetpointRequiredPerSlot bool `json:"setpointRequiredPerSlot"`
}

type MpcData added in v0.0.3

type MpcData struct {
	Devices []MpcDevice `json:"devices"`
}

type MpcDevice added in v0.0.3

type MpcDevice struct {
	DeviceID     string  `json:"deviceId"`
	CurrentPower float64 `json:"currentPower"`
}

type Oauth2Config

type Oauth2Config struct {
	*oauth2.Config
}

func Oauth2ConfigForRealm

func Oauth2ConfigForRealm(realm string) *Oauth2Config

func (*Oauth2Config) PasswordCredentialsToken added in v0.0.2

func (oc *Oauth2Config) PasswordCredentialsToken(ctx context.Context, username string, password string) (*oauth2.Token, error)

type PropertiesCircuit

type PropertiesCircuit struct {
	Index                    int    `json:"index"`
	MixerCircuitTypeExternal string `json:"mixerCircuitTypeExternal"`
	HeatingCircuitType       string `json:"heatingCircuitType"`
}

type PropertiesDhw

type PropertiesDhw struct {
	Index       int     `json:"index"`
	MinSetpoint float64 `json:"minSetpoint"`
	MaxSetpoint float64 `json:"maxSetpoint"`
}

type PropertiesDomesticHotWater

type PropertiesDomesticHotWater struct {
	Index       int     `json:"index"`
	MinSetpoint float64 `json:"minSetpoint"`
	MaxSetpoint float64 `json:"maxSetpoint"`
}

type PropertiesZone

type PropertiesZone struct {
	Index                  int    `json:"index"`
	IsActive               bool   `json:"isActive"`
	ZoneBinding            string `json:"zoneBinding"`
	IsCoolingAllowed       bool   `json:"isCoolingAllowed"`
	AssociatedCircuitIndex int    `json:"associatedCircuitIndex"`
}

type Setpoint

type Setpoint struct {
	StartTime int     `json:"startTime"`
	EndTime   int     `json:"endTime"`
	Setpoint  float64 `json:"setpoint"`
}

type StateCircuit

type StateCircuit struct {
	Index                         int     `json:"index"`
	CircuitState                  string  `json:"circuitState"`
	CurrentCircuitFlowTemperature float64 `json:"currentCircuitFlowTemperature,omitempty"`
	HeatingCircuitFlowSetpoint    float64 `json:"heatingCircuitFlowSetpoint"`
	CalculatedEnergyManagerState  string  `json:"calculatedEnergyManagerState"`
}

type StateDhw

type StateDhw struct {
	Index                  int     `json:"index"`
	CurrentSpecialFunction string  `json:"currentSpecialFunction"`
	CurrentDhwTemperature  float64 `json:"currentDhwTemperature"`
}

type StateDomesticHotWater

type StateDomesticHotWater struct {
	Index                              int     `json:"index"`
	CurrentSpecialFunction             string  `json:"currentSpecialFunction"`
	CurrentDomesticHotWaterTemperature float64 `json:"currentDomesticHotWaterTemperature"`
}

type StateZone

type StateZone struct {
	Index                                 int     `json:"index"`
	DesiredRoomTemperatureSetpointHeating float64 `json:"desiredRoomTemperatureSetpointHeating"`
	DesiredRoomTemperatureSetpoint        float64 `json:"desiredRoomTemperatureSetpoint"`
	CurrentRoomTemperature                float64 `json:"currentRoomTemperature,omitempty"`
	CurrentRoomHumidity                   float64 `json:"currentRoomHumidity,omitempty"`
	CurrentSpecialFunction                string  `json:"currentSpecialFunction"`
	HeatingState                          string  `json:"heatingState"`
}

type StatusError

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

StatusError indicates unsuccessful http response

func (StatusError) Error

func (e StatusError) Error() string

func (StatusError) Response

func (e StatusError) Response() *http.Response

Response returns the response with the unexpected error

func (StatusError) StatusCode

func (e StatusError) StatusCode() int

StatusCode returns the response's status code

type SystemAndStatus added in v0.0.3

type SystemAndStatus struct {
	SystemId     string
	SystemStatus SystemStatus
}

type SystemDevices

type SystemDevices struct {
	SystemType              string   `json:"system_type"`
	HasEmfCapableDevices    bool     `json:"has_emf_capable_devices"`
	PrimaryHeatGenerator    Device   `json:"primary_heat_generator"`
	SecondaryHeatGenerators []Device `json:"secondary_heat_generators"`
	ElectricBackupHeater    Device   `json:"electric_backup_heater"`
	SolarStation            any      `json:"solar_station"`
	Ventilation             any      `json:"ventilation"`
	Gateway                 any      `json:"gateway"`
}

type SystemDevicesAndSystemId added in v0.0.3

type SystemDevicesAndSystemId struct {
	SystemId      string
	SystemDevices SystemDevices
}

type SystemMpcData added in v0.0.3

type SystemMpcData struct {
	SystemId string
	MpcData  MpcData
}

type SystemStatus

type SystemStatus struct {
	State struct {
		System struct {
			OutdoorTemperature           float64 `json:"outdoorTemperature"`
			OutdoorTemperatureAverage24H float64 `json:"outdoorTemperatureAverage24h"`
			SystemFlowTemperature        float64 `json:"systemFlowTemperature"`
			SystemWaterPressure          float64 `json:"systemWaterPressure"`
			EnergyManagerState           string  `json:"energyManagerState"`
			SystemOff                    bool    `json:"systemOff"`
		} `json:"system"`
		Zones            []StateZone             `json:"zones"`
		Circuits         []StateCircuit          `json:"circuits"`
		Dhw              []StateDhw              `json:"dhw"`
		DomesticHotWater []StateDomesticHotWater `json:"domesticHotWater"`
	} `json:"state"`
	Properties struct {
		System struct {
			ControllerType                     string  `json:"controllerType"`
			SystemScheme                       int     `json:"systemScheme"`
			BackupHeaterType                   string  `json:"backupHeaterType"`
			BackupHeaterAllowedFor             string  `json:"backupHeaterAllowedFor"`
			ModuleConfigurationVR71            int     `json:"moduleConfigurationVR71"`
			EnergyProvidePowerCutBehavior      string  `json:"energyProvidePowerCutBehavior"`
			SmartPhotovoltaicBufferOffset      float64 `json:"smartPhotovoltaicBufferOffset"`
			ExternalEnergyManagementActivation bool    `json:"externalEnergyManagementActivation"`
		} `json:"system"`
		Zones            []PropertiesZone             `json:"zones"`
		Circuits         []PropertiesCircuit          `json:"circuits"`
		Dhw              []PropertiesDhw              `json:"dhw"`
		DomesticHotWater []PropertiesDomesticHotWater `json:"domesticHotWater"`
	} `json:"properties"`
	Configuration struct {
		System struct {
			ContinuousHeatingStartSetpoint float64 `json:"continuousHeatingStartSetpoint"`
			AlternativePoint               float64 `json:"alternativePoint"`
			HeatingCircuitBivalencePoint   float64 `json:"heatingCircuitBivalencePoint"`
			DhwBivalencePoint              float64 `json:"dhwBivalencePoint"`
			AdaptiveHeatingCurve           bool    `json:"adaptiveHeatingCurve"`
			DhwMaximumLoadingTime          int     `json:"dhwMaximumLoadingTime"`
			DhwHysteresis                  float64 `json:"dhwHysteresis"`
			DhwFlowSetpointOffset          float64 `json:"dhwFlowSetpointOffset"`
			ContinuousHeatingRoomSetpoint  float64 `json:"continuousHeatingRoomSetpoint"`
			HybridControlStrategy          string  `json:"hybridControlStrategy"`
			MaxFlowSetpointHpError         float64 `json:"maxFlowSetpointHpError"`
			DhwMaximumTemperature          float64 `json:"dhwMaximumTemperature"`
			MaximumPreheatingTime          int     `json:"maximumPreheatingTime"`
			ParalellTankLoadingAllowed     bool    `json:"paralellTankLoadingAllowed"`
		} `json:"system"`
		Zones            []ConfigurationZone             `json:"zones"`
		Circuits         []ConfigurationCircuit          `json:"circuits"`
		Dhw              []ConfigurationDhw              `json:"dhw"`
		DomesticHotWater []ConfigurationDomesticHotWater `json:"domesticHotWater"`
	} `json:"configuration"`
}

type TimeProgram

type TimeProgram struct {
	MetaInfo  MetaInfo   `json:"metaInfo"`
	Monday    []Setpoint `json:"monday"`
	Tuesday   []Setpoint `json:"tuesday"`
	Wednesday []Setpoint `json:"wednesday"`
	Thursday  []Setpoint `json:"thursday"`
	Friday    []Setpoint `json:"friday"`
	Saturday  []Setpoint `json:"saturday"`
	Sunday    []Setpoint `json:"sunday"`
}

type TimeSlot

type TimeSlot struct {
	StartTime int `json:"startTime"`
	EndTime   int `json:"endTime"`
}

type Value

type Value[T any] struct {
	// contains filtered or unexported fields
}

Value is a cacheable value that can expire

func NewValue

func NewValue[T any](cache time.Duration) *Value[T]

func (*Value[T]) Get

func (v *Value[T]) Get() (T, error)

func (*Value[T]) Set

func (v *Value[T]) Set(val T)

type ZoneData

type ZoneData struct {
	State         StateZone
	Properties    PropertiesZone
	Configuration ConfigurationZone
}

func GetZoneData

func GetZoneData(state SystemStatus, index int) *ZoneData

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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