Skip to content
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

Error thrown when setting dynamic current and vehicle not charging, expected? #455

Closed
jacoscar opened this issue Sep 5, 2024 · 17 comments
Closed
Labels
bug Something isn't working

Comments

@jacoscar
Copy link

jacoscar commented Sep 5, 2024

The problem

I've created an automation that uses the service "set circuit dynamic limit" for my Easee One charger.

I always get this error when executing it with the car is not charging, is this to be expected?

Version of Easee integration having the issue?

0.9.59

Version of Home Assistant Core having the issue?

2024.9.0

Anything in the logs that might be useful for us?

Logger: homeassistant.components.automation.limit_dynamic_current
Source: helpers/script.py:525
integration: Automation (documentation, issues)
First occurred: 10:04:46 AM (1 occurrences)
Last logged: 10:04:46 AM

Limit dynamic current: Error executing script. Unexpected error for call_service at pos 3: 'dynamicCircuitCurrentP1'
Traceback (most recent call last):
  File "/config/custom_components/easee/controller.py", line 760, in check_circuit_current
    or charger_data.state[compare_p2] != current_p2
       ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyeasee/utils.py", line 55, in __getitem__
    if type(self._storage[key]) == str and validate_iso8601(self._storage[key]):
            ~~~~~~~~~~~~~^^^^^
KeyError: 'dynamicCircuitCurrentP2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/easee/services.py", line 582, in circuit_execute_set_current
    circuit = controller.check_circuit_current(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/easee/controller.py", line 766, in check_circuit_current
    charger_data.config[compare_p1] != current_p1
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyeasee/utils.py", line 55, in __getitem__
    if type(self._storage[key]) == str and validate_iso8601(self._storage[key]):
            ~~~~~~~~~~~~~^^^^^
KeyError: 'dynamicCircuitCurrentP1

Additional information

No response

@jacoscar jacoscar added the bug Something isn't working label Sep 5, 2024
@olalid
Copy link
Collaborator

olalid commented Sep 5, 2024

I think this and your other problem is one and the same really.
Did this start happening after upgrading HA to the latest version possibly?

@olalid
Copy link
Collaborator

olalid commented Sep 5, 2024

Probably same root cause as #454

@jacoscar
Copy link
Author

jacoscar commented Sep 5, 2024

I think this and your other problem is one and the same really. Did this start happening after upgrading HA to the latest version possibly?

I don't know, as when I installed the integration for the first time I was asked to upgrade HA, so I ended up on 2024.9.0. My previous HA version was not supported.

@olalid
Copy link
Collaborator

olalid commented Sep 5, 2024

Ok, I have not myself tried it with 2024.9.0 yet, so I will try that later this evening and see if I can reproduce the errors you are seeing.

@olalid
Copy link
Collaborator

olalid commented Sep 5, 2024

No, it works for me with 2024.9.0...
If you have not, can you please enable logging for Easee (see readme) and then search for any rows containing state_dynamicCircuitCurrentP1, state_dynamicCircuitCurrentP2 or state_dynamicCircuitCurrentP3 in the log file after doing a restart?
You should see some lines like this, indicating where values for the circuit current limits are received from the cloud.

2024-09-05 17:31:51.527 DEBUG (MainThread) [custom_components.easee.controller] Observation state_dynamicCircuitCurrentP1 0 type 3 <class 'int'>
2024-09-05 17:31:57.616 DEBUG (MainThread) [custom_components.easee.controller] Callback EXXXX 111 state_dynamicCircuitCurrentP1 0.0 3
2024-09-05 17:31:51.527 DEBUG (MainThread) [custom_components.easee.controller] Observation state_dynamicCircuitCurrentP2 0 type 3 <class 'int'>
2024-09-05 17:31:57.616 DEBUG (MainThread) [custom_components.easee.controller] Callback EXXXXX 112 state_dynamicCircuitCurrentP2 0.0 3
2024-09-05 17:31:51.527 DEBUG (MainThread) [custom_components.easee.controller] Observation state_dynamicCircuitCurrentP3 5 type 3 <class 'int'>
2024-09-05 17:31:57.616 DEBUG (MainThread) [custom_components.easee.controller] Callback EXXXX 113 state_dynamicCircuitCurrentP3 5.0 3

@olalid
Copy link
Collaborator

olalid commented Sep 5, 2024

Hang on. Easee One is a one phase version, right?
It could be that it provides the data in a different way...
Do you have anything that says Callback EXXXXX 112 state_dynamicCircuitCurrentP1/2/3 at all?
Do you have any log file rows that says Unsupported data id?

@jacoscar
Copy link
Author

jacoscar commented Sep 5, 2024

No, it works for me with 2024.9.0... If you have not, can you please enable logging for Easee (see readme) and then search for any rows containing state_dynamicCircuitCurrentP1, state_dynamicCircuitCurrentP2 or state_dynamicCircuitCurrentP3 in the log file after doing a restart? You should see some lines like this, indicating where values for the circuit current limits are received from the cloud.

2024-09-05 17:31:51.527 DEBUG (MainThread) [custom_components.easee.controller] Observation state_dynamicCircuitCurrentP1 0 type 3 <class 'int'>
2024-09-05 17:31:57.616 DEBUG (MainThread) [custom_components.easee.controller] Callback EXXXX 111 state_dynamicCircuitCurrentP1 0.0 3
2024-09-05 17:31:51.527 DEBUG (MainThread) [custom_components.easee.controller] Observation state_dynamicCircuitCurrentP2 0 type 3 <class 'int'>
2024-09-05 17:31:57.616 DEBUG (MainThread) [custom_components.easee.controller] Callback EXXXXX 112 state_dynamicCircuitCurrentP2 0.0 3
2024-09-05 17:31:51.527 DEBUG (MainThread) [custom_components.easee.controller] Observation state_dynamicCircuitCurrentP3 5 type 3 <class 'int'>
2024-09-05 17:31:57.616 DEBUG (MainThread) [custom_components.easee.controller] Callback EXXXX 113 state_dynamicCircuitCurrentP3 5.0 3
2024-09-05 18:32:26.100 DEBUG (MainThread) [custom_components.easee.controller] Observation state_circuitTotalPhaseConductorCurrentL1 0.01899999938905239 type 3 <class 'float'>
2024-09-05 18:32:26.100 DEBUG (MainThread) [custom_components.easee.controller] Observation state_chargerFirmware 58 type 4 <class 'int'>
2024-09-05 18:32:26.100 DEBUG (MainThread) [custom_components.easee.controller] Observation state_reasonForNoCurrent 79 type 4 <class 'int'>
2024-09-05 18:32:26.100 DEBUG (MainThread) [custom_components.easee.controller] Observation state_smartCharging False type 2 <class 'bool'>
2024-09-05 18:32:26.101 DEBUG (MainThread) [custom_components.easee.controller] Observation state_cableLocked True type 2 <class 'bool'>
2024-09-05 18:32:26.101 DEBUG (MainThread) [custom_components.easee.controller] Observation state_cableRating 32 type 4 <class 'int'>
2024-09-05 18:32:26.101 DEBUG (MainThread) [custom_components.easee.controller] Observation state_chargerOpMode 4 type 4 <class 'int'>
2024-09-05 18:32:26.101 DEBUG (MainThread) [custom_components.easee.controller] Observation state_outputPhase 0 type 4 <class 'int'>
2024-09-05 18:32:26.101 DEBUG (MainThread) [custom_components.easee.controller] Observation state_dynamicCircuitCurrentP1 6 type 3 <class 'int'>
2024-09-05 18:32:26.101 DEBUG (MainThread) [custom_components.easee.controller] Observation state_outputCurrent 6 type 3 <class 'int'>
2024-09-05 18:32:26.101 DEBUG (MainThread) [custom_components.easee.controller] Observation state_deratingActive False type 2 <class 'bool'>
2024-09-05 18:32:26.101 DEBUG (MainThread) [custom_components.easee.controller] Observation state_errorString Initial clock sync issues: num retries=1, fallback to non-tls=0 type 6 <class 'str'>

Hang on. Easee One is a one phase version, right? It could be that it provides the data in a different way... Do you have anything that says Callback EXXXXX 112 state_dynamicCircuitCurrentP1/2/3 at all? Do you have any log file rows that says Unsupported data id?

Yes, it is one phase


2024-09-05 18:32:27.139 DEBUG (MainThread) [custom_components.easee.entity] Entity async_update : XXXXXXXXX weekly_schedule
2024-09-05 18:32:27.139 DEBUG (MainThread) [custom_components.easee.binary_sensor] Getting state of weekly_schedule
2024-09-05 18:32:27.139 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 109 state_chargerOpMode 4 4
2024-09-05 18:32:27.139 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 110 state_outputPhase 0 4
2024-09-05 18:32:27.139 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 111 state_dynamicCircuitCurrentP1 6.0 3
2024-09-05 18:32:27.139 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 114 state_outputCurrent 6.0 3
2024-09-05 18:32:27.140 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 116 state_deratingActive False 2



2024-09-05 18:32:27.037 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 11 state_chargerOfflineReason 0 4
2024-09-05 18:32:27.038 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 15 config_localPreAuthorizeEnabled True 2
2024-09-05 18:32:27.038 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 16 config_localAuthorizeOfflineEnabled True 2
2024-09-05 18:32:27.038 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 17 config_allowOfflineTxForUnknownId True 2
2024-09-05 18:32:27.038 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 21 config_detectedPowerGridType 3 4
2024-09-05 18:32:27.039 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 22 config_circuitMaxCurrentP1 40.0 3
2024-09-05 18:32:27.039 DEBUG (MainThread) [custom_components.easee.controller] Callback XXXXXXXXX 30 state_lockCablePermanently False 2````







@olalid
Copy link
Collaborator

olalid commented Sep 5, 2024

Ok, so it reports only the state_dynamicCircuitCurrentP1 etc...

Strange that your original post log file extract says
KeyError: 'dynamicCircuitCurrentP1 in that case, that specific key should be present.
I would expect it to fail with KeyError: 'dynamicCircuitCurrentP2' and KeyError: 'dynamicCircuitCurrentP3', but not with KeyError: 'dynamicCircuitCurrentP1', so not sure I understand why that happens...

In any case, I guess we need to change some things to be able to support these one phase versions...

@olalid
Copy link
Collaborator

olalid commented Sep 5, 2024

@jacoscar if you are able, please try this PR #456

@olalid
Copy link
Collaborator

olalid commented Sep 6, 2024

@jacoscar I suspect you have a similar issue as this one also?
#451
Can you please tell us which product code the Easee One has? Should be visible in same way in the GUI as in that issue.

@jacoscar
Copy link
Author

jacoscar commented Sep 6, 2024

@jacoscar I suspect you have a similar issue as this one also? #451 Can you please tell us which product code the Easee One has? Should be visible in same way in the GUI as in that issue.

image

@jacoscar
Copy link
Author

jacoscar commented Sep 6, 2024

@jacoscar if you are able, please try this PR #456

image

it works and I don't see the error when changing the dynamic circuit current limit anymore

thanks!

@olalid
Copy link
Collaborator

olalid commented Sep 6, 2024

Thanks for testing, please let us know if you encounter anything else later.

@jacoscar
Copy link
Author

jacoscar commented Sep 10, 2024

Not sure this is the right place to ask, but I want to create a current balancing automation where I want to increase or decrease the value of my EV charging current by 1A, but I am only able to input given numbers.

image

Would I need to use the YAML interface to enter a template value?

action: easee.set_circuit_dynamic_limit
metadata: {}
data:
  current_p1: 6
  current_p2: 16
  current_p3: 16
  time_to_live: 0
  device_id: ab0be2c0ff963a79db408227ac489e05

@olalid
Copy link
Collaborator

olalid commented Sep 10, 2024

Yes, you would need to enter at template that uses the current value of the setting and add or subtract from that to get the new value. Which should be possible to do if you switch to YAML mode.

@olalid
Copy link
Collaborator

olalid commented Sep 17, 2024

This issue is most likely solved in v0.9.60. Please update and test.

@jacoscar
Copy link
Author

tested and ok

@olalid olalid closed this as completed Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants