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
Strange behavior from the “cableLocked” sensor (or actually switch) #32
Comments
I think there are 2 values that determine the state of the switch but we need to check this further. We are right now in the middle of getting this as an official integration in HA and there will take some time before all functionality is ported (starting with sensors only) |
As fondberg says, there state of the switch is determined by either locked or permanently locked. Perhaps it would be better to split it as you say, it was more a quick fix since we noticed that the locked state was not changed by permanently locking (which may or may not be a bug on Easee side?). Also there are some improvements needed to make sure the switch is updated after changing it, not waiting a minute or so. I'll look into it. |
Great, thank you for looking into this. |
See proposal in #36 PS! There is still a delay between activating the switch in HA and getting the actual update/status. It seems to update quite immediately in the Easee app, so switch is working fine, however need to check how to force an update after calling the function (avoid waiting for SCAN_INTERVAL_SECONDS to see the actual value). |
Looks good! As far as I can understand, this is the same as I was thinking. |
Released in 0.9.15, please test and see if ok. |
Awesome! I'm currently at work, so I have only been able to do limited testing so far. I will do some more extensive testing of the "cable_locked_car" sensor when I get home, so I can test if it behaves correctly with car connected and disconnected. However I noticed one small strange thing in the history of the sensor (not sure if it is related to the integration or HA itself): 13:49:48 |
I was able to do some more testing this morning, and I'm happy to report the "cable_locked_car" sensor also works great. Everything works as it should:
Great work, thanks a lot! Small sidenote regarding the naming of the sensor: I do think the "car" part of the name is slightly misleading. It may lead someone to think it is related to locking the car end of the cable, or that it's state is only determined by the car, while in fact it's an indicator if the cable is currently locked to the charger or not, which is determined by a combination of the car (connected / not connected) and the charger (the permanent lock). To avoid confusion they could be named something like this: |
Ok, good. I actually thought it was the car end locking it. But if that's not correct, we should rename it for sure. What I don't understand then: shouldn't it be locked always when permanently locked is enabled? independent of car connected or not? This may very well be the reason for this confusion, because I noticed there was some inconsistency (in my head at least) on this quite early. For instance my charger currently shows cableLocked=false and cablePermanentlyLocked=true while car is disconnected. Then I'm talking about the Easee API directly, not the sensors although they should be the same now. |
(NOTE: Everything I write below is based on the opinion that the sensor should tell me: "Will I be able to pull the cable from the charger or not") Yeah, it is actually always locked if the permanent lock is enabled, as I wrote after my testing this morning:
To clarify, if the cable is permanently locked and the car is disconnected, you will see state.lockCablePermanently=True and state.cableLocked=False, but the actual sensor is True (i.e. Locked). The sensor will switch to False when both of them are False. Which in my opinion is correct, since you are not able to pull the cable from the charger if either of them is True. So in my opinion both the sensor and the switch now works perfectly as they should, it's just the naming that is somewhat confusing. |
Strange, I have different behavior. Currently with no car connected: However I just noticed that "state.cableLocked" is in fact "true" on my charger even with no car connected, as long as the permanent lock is also on. Which kind of makes sense, because the cable is in fact locked as long as the permanent lock is on. If i disable the permanent lock, with to car connected, the "state.cableLocked" changes to "false". So I was mistaken when I said "To clarify, if the cable is permanently locked and the car is disconnected, you will see state.lockCablePermanently=True and state.cableLocked=False, but the actual sensor is True (i.e. Locked)". It seems like the only time these two states are different for me, is if there is a car connected, but the permanent lock is off. In that scenario I will have state.cableLocked=true (because there is a car connected which forces the charger to lock the cable) while state.lockCablePermanently=false (because it is not permanently locked). - I will verify this when I get home. It is strange you have different behavior, what firmware is your Easee on? I'm currently on 235, but will now upgrade to the latest (240) and see if it changes anything. |
I upgraded to 240 yesterday, but quite sure it was like this before as well. Because I added the cable_locked = cableLocked OR cablePermanentlyLocked initially because I thought it was annoying :) either it is locked or its not was my thinking. But I guess we can keep the switch as is, but rename cable_locked_car to cable_locked = cableLocked OR cablePermanentlyLocked if we agree that's what we want? I believe that's what the Easee app is showing (blue icon), but the API is different. That is why I thought it had to be the car, and proposed the _car name which is wrong then. |
In the app the blue icon indicates the permanent lock. (Click the "i" top right corner, and "cable lock" to see the explanation) I have now updated to 240 and restarted Home Assistant, and still have the same behavior. I came to think of another possible difference: Did you have the cable connected to the charger or not when you took that screenshot? |
Right, I see. Blue is permanent but it will also indicate that it is locked. My cable is connected to the charger, I always leave it there (can it be permanently locked if it isn't connected to charger??). |
I was really curious about this, so I called my wife and had her remove the cable from the charger. When I enabled the permanent lock with the cable removed, I could also end up with the same result as in your screenshot: When she plugged the cable back in (permanent lock still on) it did not seem to lock, and nothing updated. But after disabling and enabling the permanent lock, it locked as it should, and the previous behavior was back, where cable_locked_car = True when cable_permanently_locked_charger = on. I wasn't able to do any more testing as my wife wanted to go back inside :p so I will test some more when I get home (but it will be really late). Maybe this is due to different cables or something like that. Honestly I'm not sure what the best solution is, since for me it is working perfectly as it is right now (just with a slightly confusing name for the sensor). |
Hehe, good work! I guess there's no hurry, let's leave it for some days to be 100% sure before we conclude and change it the way it should be :) |
Yeah I agree, this is not urgent at all. For me the switch is most important (since we have to switch between two cables - Leaf with type 1 and Tesla with type 2) and that work perfectly, so I'm really happy I found this component. Have a nice evening and thanks again. :-) |
can you try with https://github.com/fondberg/easee_hass/releases/tag/v0.9.19? |
The switch "cable_permanently_locked_charger" was broken in 0.9.17, but works great again in 0.9.19. The different behavior of the "cable_locked_car" sensor for me and tmjo seems to be related to how the charger reports the state.cableLocked. In my opinion it is correct for the sensor to report the same as state.cableLocked, like I believe it does currently. So as far as I'm concerned no further change is needed related to this, except perhaps removing the "car" part of the "cable_locked_car" sensor name, as it might be misleading as mentioned previously. |
Hi! Did u do any more testing of the values? Here's my last logs, as one can observe, charging is performed, and cable is always permanently locked. However, the cable_locked_car sensors does not change. Does it appear locked in your case? I can ask Easee about this topic, but would be great if you could provide something similar to the above. Any ideas why it could be different? |
Yeah, I did a quick test session now to make a screenshot from the History, so you can see how it works: What happens here is:
So in summary:
In my opinion this works exactly as it should (Meaning: "cable_locked_car" tells me "will I be able to pull the cable from the charger or not?") Sidenote: |
Hmm, interesting. Wonder why mine is not updating similarly...... You're description is how I would expect it to work. |
As for why it's different, I can only guess either your Easee is broken, or they added the functionality/sensor at a later hardware model (mine is fairly new; I got it this summer). Ideally someone else should test as well. |
(I clicked the "Close" button by mistake) |
Got my charger in June or July, so don't think it is different. Firmware is latest. But I'll try to figure out why. |
Is not the issue only the name of the switch/sensors? In the API easee calls these 2 values lockCablePermanently and cableLocked. So I suggest we change the switch name to "Permanent cable lock" and the sensor name to "Cable lock". |
@olalid I like the suggestion, works for me. |
Yes, I think there has been bugs in certain versions och HA component and Easee SW/firmware, so not so sure the differences seen are really valid anymore. But the behavior I see on my charger is equal to what you stated above. |
Yeah, that sums it up pretty good, and it also feels like this is the "correct" behavior as well. |
Hum, I am not sure anymore. My sensors last 24h: cable_locked_car is unlocked and permanently_locked_charger is on. The latter is ok, because it is permanently locked (in charger) as shown in app too. The "car" one is a mystery to me. It was named just "locked" initially, then changed to "car_locked" because we believed it to be when the car is charging and thus locks it to the car. But apparantly not, because I charged this night. But what does the "car" one do then? Nothing? |
The charger has no idea what is going on with the lock at the car end of the cable, so I think first of all that is very confusing to name it something with "car" in the name. |
if you add this to your configuration.yaml
Then toggle the switch for permanent lock back and forth when the car is not connected. |
I can check that later, right now I don't have time. But for me we can rename it or remove it. I am not sure what it does, but results are the same as I found in the initial discussions here. Was different than for theAzzi, maybe something is wrong. At the time there wasn't any debugging messages as I would have noticed it. Are you sure the charger cannot know the car has locked the cable in his end? I would assume this is a safety feature to avoid user pulling out cable during charging, so I guess there is some kind of info going there. But perhaps just that it is charging and that's that. I'll try to debug later, but if it's working for you guys, just rename it and we're done. It's not a very important function to me, but will try to figure out what is going on. |
Yes, as I interpret it, the only signalling that goes on from car to the charger is about detecting the car and if the car is ready to charge or not. You could interpret that as if it has locked the cable of course, but not really what is intended for. |
I am closing this because as far as I can tell it works as intended. If someone still has issues, we need to have more details. |
From forum: https://community.home-assistant.io/t/easee-ev-charging-station/186474/70
Hi,
I started testing this integration today, and so far it looks very promising. Thank you @fondberg and the rest of the developers! :-)
I did notice some (in my opinion) strange behavior from the “cableLocked” sensor (or actually switch), switch.easee_charger_ehXXXXXX_cablelocked, and I was just wondering if this is by design or a bug:
If a car is connected to the charger, and the “permanent lock” is enabled, the “cablelocked” switch is “on”.
I go ahead and turn the “cablelocked” switch to “off” in Home Assistant.
This disables the “permanent lock” option as I can verify this in the Easee app and web page.
However the “cablelocked” switch will jump back to “on” in Home assistant. (Probably because the cable is still in fact locked as there is a car connected).
I can not re-enable the “permanent lock” from Home Assistant, as the switch is already “on”.
This means there is an inconsistency between what the switch displays (state.cableLocked?), and what the switch actually does when switched (state.lockCablePermanently?).
(Sidenote: If a car is not connected to the charger, the switch will function more as expected, as the state.lockCablePermanently and state.cableLocked will be the same state (both true or both false), however there is a delay where the switch goes back to the previous state for a while before it updates).
In my opinion this is not logical behavior from a switch, and my suggestion is to divide this in 2 parts:
A switch which relates only to the “permanent lock” so this function can be easily switched on/off (both manually and in automations).
A sensor for showing if the cable is locked or not (this is basically what the switch shows as it is now, however this should not be a switch as you cannot control this anyway. You can only control if the cable is permanently locked or not)
The text was updated successfully, but these errors were encountered: