func (sm *SMA) TotalEnergy() (float64, error) {
	values, err := sm.hasValue()

	var energy float64
	if sm.device.IsEnergyMeter() {
		energy = sm.asFloat(values["active_energy_plus"]) / 3600000
	} else {
		energy = sm.asFloat(values["energy_total"]) / 1000
	}

	return energy, err
}
// TotalEnergy implements the api.MeterEnergy interface
TotalEnergy implements the api.MeterEnergy interface
// TotalEnergy implements the api . MeterEnergy interface
func (sm *SMA) TotalEnergy() (float64, error) {
	values, err := sm.hasValue()
	var energy float64
	if sm.device.IsEnergyMeter() {
		energy = sm.asFloat(values["active_energy_plus"]) / 3600000
	} else {
		energy = sm.asFloat(values["energy_total"]) / 1000
	}
	return energy, err
}
func ( sm * SMA ) TotalEnergy ( ) ( float64 , error ) { values , err := sm . hasValue ( ) var energy float64 if sm . device . IsEnergyMeter ( ) { energy = sm . asFloat ( values [ " " ] ) / 3600000 } else { energy = sm . asFloat ( values [ " " ] ) / 1000 } return energy , err }
TotalEnergy implements the api.MeterEnergy interface
TotalEnergy implements the api . MeterEnergy interface