Support decoding EM-CP/EV-CC meter readings (#714)
This commit is contained in:
parent
1b5b8e283f
commit
a29bfdbb2e
1 changed files with 2 additions and 3 deletions
|
|
@ -1,13 +1,13 @@
|
|||
package charger
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/andig/evcc/api"
|
||||
"github.com/andig/evcc/util"
|
||||
"github.com/andig/evcc/util/modbus"
|
||||
"github.com/volkszaehler/mbmd/meters/rs485"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -144,8 +144,7 @@ func (wb *PhoenixEMCP) ChargingTime() (time.Duration, error) {
|
|||
}
|
||||
|
||||
func (wb *PhoenixEMCP) decodeReading(b []byte) float64 {
|
||||
v := binary.BigEndian.Uint32(b)
|
||||
return float64(v)
|
||||
return rs485.RTUUint32ToFloat64Swapped(b) / 100
|
||||
}
|
||||
|
||||
// CurrentPower implements the Meter.CurrentPower interface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue