Sunny is a library to get actual data from SMA inverters and energy meters via Ethernet (Speedwire).
Note: SMA & Speedwire are registered trademarks by SMA Solar Technology AG
An example application can be found here.
The password in the following function is the one of the user account which is by default "0000".
To discover reachable devices call:
devices, err := sunny.DiscoverDevices(password)
This will return a list of device instances that can be used for additional communication.
To directly connect to a device use:
device, err := sunny.NewDevice(address, password)
Where address is the IP address of the device.
To get all current values from a device use GetValues()
:
values, err := device.GetValues()
values
will be a map[string]interface{}
with the values of the device.
The values differs from device to device:
- Energy Meter: Every value that is provided. See Energy Meter Protocol
- Inverters: Provided values that are decrypted.
See
valuesDef
in values.go
Note: The data from energy meters are broadcasted only once a second.
The base protocol is implemented based on the information provided SMA in the documentation of the Energy Meter Protocol and the Speedwire device discovery.
For the core functionality of the protocol are no public information available. Because the missing information the main protocol structure is based on own packet analyses and some existing projects: