joscha82 / wattpilot

Python library to connect to a Fronius Wattpilot Wallbox
MIT License
40 stars 10 forks source link

car, err, modelStatus state are diffrent to the api description? #8

Open thecem opened 2 years ago

thecem commented 2 years ago

Don´t know the Fronius API yet, but oriented on Go-E API v2 I dont understand following. May I´m wrong, but i this right?

modelStatus | R | uint8 | Status | Reason why we allow charging or not right now (NotChargingBecauseNoChargeCtrlData=0, NotChargingBecauseOvertemperature=1, NotChargingBecauseAccessControlWait=2, ChargingBecauseForceStateOn=3, NotChargingBecauseForceStateOff=4, NotChargingBecauseScheduler=5, NotChargingBecauseEnergyLimit=6, ChargingBecauseAwattarPriceLow=7, ChargingBecauseAutomaticStopTestLadung=8, ChargingBecauseAutomaticStopNotEnoughTime=9, ChargingBecauseAutomaticStop=10, ChargingBecauseAutomaticStopNoClock=11, ChargingBecausePvSurplus=12, ChargingBecauseFallbackGoEDefault=13, ChargingBecauseFallbackGoEScheduler=14, ChargingBecauseFallbackDefault=15, NotChargingBecauseFallbackGoEAwattar=16, NotChargingBecauseFallbackAwattar=17, NotChargingBecauseFallbackAutomaticStop=18, ChargingBecauseCarCompatibilityKeepAlive=19, ChargingBecauseChargePauseNotAllowed=20, NotChargingBecauseSimulateUnplugging=22, NotChargingBecausePhaseSwitch=23, NotChargingBecauseMinPauseDuration=24) -- | -- | -- | -- | -- car | R | optional | Status | carState, null if internal error (Unknown/Error=0, Idle=1, Charging=2, WaitCar=3, Complete=4, Error=5) -- | -- | -- | -- | -- err | R | optional | Status | error, null if internal error (None = 0, FiAc = 1, FiDc = 2, Phase = 3, Overvolt = 4, Overamp = 5, Diode = 6, PpInvalid = 7, GndInvalid = 8, ContactorStuck = 9, ContactorMiss = 10, FiUnknown = 11, Unknown = 12, Overtemp = 13, NoComm = 14, StatusLockStuckOpen = 15, StatusLockStuckLocked = 16, Reserved20 = 20, Reserved21 = 21, Reserved22 = 22, Reserved23 = 23, Reserved24 = 24)

https://github.com/joscha82/wattpilot/blob/ca98bb3905dacbc11139b09f1d731e175136b429/src/wattpilot/__init__.py#L40

https://github.com/joscha82/wattpilot/blob/ca98bb3905dacbc11139b09f1d731e175136b429/src/wattpilot/__init__.py#L52

Is this right or are there things mixed up?

"err" -> "errorState" -> should be: error, null if internal error (None = 0, FiAc = 1, FiDc = 2, Phase = 3, Overvolt = 4, Overamp = 5, Diode = 6, PpInvalid = 7, GndInvalid = 8, ContactorStuck = 9, ContactorMiss = 10, FiUnknown = 11, Unknown = 12, Overtemp = 13, NoComm = 14, StatusLockStuckOpen = 15, StatusLockStuckLocked = 16, Reserved20 = 20, Reserved21 = 21, Reserved22 = 22, Reserved23 = 23, Reserved24 = 24) "car" -> (Unknown/Error=0, Idle=1, Charging=2, WaitCar=3, Complete=4, Error=5) 0 and 5 is missing 1 -> No Car 2 -> Charging 3 -> Wait for car allows 4 -> Complete

ChargingState -> ModelState ?

May this would better fit?

Thx!

joscha82 commented 2 years ago

most likely the go-e API is correct. go-e API Description did not contain the description for err and car properties and the values in the sourcecode were guessed and taken from the older API Description (just realised go-e updated the description a few days ago). I will update the properties in the source.

thecem commented 2 years ago

Perfect! Thx!

Is there in between an api description for Fronius Wattpilot? I will bother them on the fair InterSolar in May...;-)

joscha82 commented 2 years ago

No as Fronius Wattpilot does not even have an "open" API, but the software of the wattpilot seems to have a similar codebase as the e-go chargers and the information from e-go API Description most likely fits to 95% for the wattpilot (at least the properties). There is a property (pck) in the API which seems to include the software-modules of the wallbox. It includes a froniusinverter module (for PV excess charging) but no API module on the wattpilot. I do not know if the reason for the missing API is a business decision by Fronius (closed "fronius" ecosystem, lesser licensecosts,...) or e-go (keeping a sellingpoint for e-go charger against wattpilot) or a technical decision, as the capacity of the microcontroller might be the limiting factor and they needed the space to add the froniusinverter code.

ahochsteger commented 2 years ago

@joscha82, @thecem maybe you are interested in this PR which besides full Home Assistant support introduces value maps in wattpilot.yaml to provide human-readable values instead of plain integers: https://github.com/joscha82/wattpilot/pull/9