-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wallbox interaction #59
Conversation
With this function i can start/stop the wallbox ;-) |
I still believe that this isn't an actual start / stop behavior. When I run your code trying to start charging, the only thing that happens is that the "chargingCanceled" flag toggles, but no current is flowing... |
As i wrote before... What do you think... |
Ok, I made some tests. First it seems that my car wasn't accepting current, I now started charging via the cars app, now the wallbox is actually charging. But still, the Whenever I send your |
Oh my fault... you are right. I had used following code
And in my mind i was a step ahead... So i think one function maybe "wallbox_controller" with different sets of byteArrays should work... What do you think? |
not sure what you mean with the controller method. I would not want to have a user of the library need to handle bytearrays just for toggle switches in the wallbox, I would always wrap that special setting into a separate method. Internally I could introduce such a controller method for reusing the same code of sending the request. Is that what you meant? |
Yes, exactly... :-) |
@vchrisb in this PR another 4-5 methods will be added to the e3dc client. Is there any plan on e.g. splitting some functionalities into subclasses, so that maintenance of code will be easier in the future? The
Is that something that is planned, should I implement the new wallbox-feature like that or would you prefer just adding the new code to the |
For now I would suggest implementing it like the other methods in |
@othorg I think the PR is ready for reviewing. Can you please test it again with your system? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few changes for consistency...
Is that really the case? I think it toggles the
Yes you're right, I forgot that and also setting the number of phases. I added both functionalities right now, please test once again. |
have you tested what happens / is returned if you set an invalid current? Maybe we actually get an error in return... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
This has enabled me to implement my own "sun mode" adapted to my BEV, which does not charge or charges much less at lower allowed currents.
wallbox_power_by_current =
{
# ...
12: 6950,
11: 6400,
10: 5550,
9: 4850,
8: 2000
}
extern_data_net = rscpFindTag(req, "WB_EXTERN_DATA_NET") | ||
if extern_data_net is not None: | ||
extern_data = rscpFindTagIndex(extern_data_net, "WB_EXTERN_DATA") | ||
outObj["consumptionNet"] = struct.unpack("h", extern_data[0:2])[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The total consumption from the grid in watthours is returned in extern_data[2:6]
.
The value seems to be reset by the WB only if no car is connected and nobody requests this value for a few minutes (or hours).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean instead of using extern_data[0:2]
, I should unpack extern_data[2:6]
?
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
extern_data_sun = rscpFindTag(req, "WB_EXTERN_DATA_SUN") | ||
if extern_data_sun is not None: | ||
extern_data = rscpFindTagIndex(extern_data_sun, "WB_EXTERN_DATA") | ||
outObj["consumptionSun"] = struct.unpack("h", extern_data[0:2])[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The total consumption from the solar panels in watthours is returned in extern_data[2:6]
.
The value seems to be reset by the WB only if no car is connected and nobody requests this value for a few minutes (or hours).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I implement something here? or just a note?
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
e3dc/_e3dc.py
Outdated
rsp_param_1 = rscpFindTag(req, "WB_RSP_PARAM_1") | ||
if rsp_param_1 is not None: | ||
extern_data = rscpFindTagIndex(rsp_param_1, "WB_EXTERN_DATA") | ||
outObj["maxChargeCurrent"] = extern_data[2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to send the dedicated request WB_REQ_PARAM_1
.
The value is also returned in WB_EXTERN_DATA_ALG[3]
.
"energyAll": rscpFindTagIndex(req, "WB_ENERGY_ALL"), | ||
"energySolar": rscpFindTagIndex(req, "WB_ENERGY_SOLAR"), | ||
"soc": rscpFindTagIndex(req, "WB_SOC"), | ||
"appSoftware": rscpFindTagIndex(req, "WB_APP_SOFTWARE"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 0
for my E3DC Easy Connect WB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Is that expected behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
0
for my E3DC Easy Connect WB.Same here. Is that expected behaviour?
I don't know. I guess this field is not supported / filled currently. Luckily, it is of little interest.
My E3DC system clips the requested |
Co-authored-by: Michael Seibt <[email protected]>
Thanks for testing, that is what I expected here. Once we have cleared your suggestions, I think this PR would be ready for completing. |
My wallbox has a key switch either for locking or for restriction to sun mode (depending on the wallbox configuration in the E3DC settings). Whether the wallbox may discharge the battery can be controlled with |
awesome, where did you find those infos / how were you able to reverse-engineer those values? Edit: reading key state works (although I haven't physically toggled the keyswitch on my wallbox yet), but I fail to request the "Battery to car mode". Do you have some "example code" how to request that mode? |
I have watched the data and compared it with the detailed charge info at the E-Mobility page. The
Sorry, it is |
Hi, As i see there are only very few changes do be done prior to merging this PR. |
All, @vchrisb - what's open/pending in the PR? |
If you want to see how I get the S10 & WB data using the unmodified release 0.7.3, you could look at https://github.com/mstv/e3dc_control/blob/main/control/e3dc_direct.py. |
Thank you @mstv, your code works fine for me, so I could integrate it in hacs-e3dc based on the current version of I did yesterday some more testing throughout the day with this PR and my Wallbox and did not find any issues. |
Of course. I just provided it in order to make my above comments clearer. It would be good to
either in this or in a follow-up PR. |
It would be great if this change gets merged to gain access to Wallbox settings and information. |
close in favor of #118 |
This PR will enable the library to interact with the wallbox as known from the wallbox page on the web portal.
This PR is still in progress