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

[Bug]: error when calling set override #423

Closed
KipK opened this issue Jan 28, 2025 · 6 comments
Closed

[Bug]: error when calling set override #423

KipK opened this issue Jan 28, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@KipK
Copy link
Contributor

KipK commented Jan 28, 2025

The problem

I got this problem few times, for unknown reason yet, I can't call set override from HA.
Got this error in the log:

Update OpenEVSE State: Error executing script. Unexpected error for call_service at pos 1: '01J7BSHM4CWTVBXH5978MGEAMR'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, 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(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<9 lines>...
    )
    ^
  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 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openevse/services.py", line 450, in _list_overrides
    manager = self.hass.data[DOMAIN][config_id][MANAGER]
              ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: '01J7BSHM4CWTVBXH5978MGEAMR'



[140497558270400] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openevse/services.py", line 202, in _set_override
    manager = self.hass.data[DOMAIN][config_id][MANAGER]
              ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: '01J7BSHM4CWTVBXH5978MGEAMR'

Restarting OpenEVSE or HA does nothing.
The only way to fix it is to empty the pycache folder of Openevse integration and restart home assistant.

Then it happends few days later.

What version of Home Assistant?

2025.1.4

What version of OpenEVSE?

5.1.2

Diagnostics information

{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2025.1.4",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.13.1",
"docker": true,
"arch": "x86_64",
"timezone": "Europe/Paris",
"os_name": "Linux",
"os_version": "6.6.73-haos",
"supervisor": "2024.12.3",
"host_os": "Home Assistant OS 14.2",
"docker_version": "27.2.0",
"chassis": "vm",
"run_as_root": true
},
"custom_components": {
"hacs": {
"documentation": "https://hacs.xyz/docs/use/",
"version": "2.0.5",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"openevse": {
"documentation": "https://github.com/firstof9/openevse/",
"version": "0.0.0-dev",
"requirements": [
"python-openevse-http==0.1.70"
]
},
"kia_uvo": {
"documentation": "https://github.com/Hyundai-Kia-Connect/kia_uvo",
"version": "2.35.0",
"requirements": [
"hyundai_kia_connect_api==3.32.0"
]
},
"scheduler": {
"documentation": "https://github.com/nielsfaber/scheduler-component",
"version": "v0.0.0",
"requirements": []
},
"climate_template": {
"documentation": "https://github.com/jcwillox/hass-template-climate",
"version": "0.0.0",
"requirements": []
},
"config_editor": {
"documentation": "https://github.com/junkfix/config-editor-card",
"version": "4.4.2",
"requirements": []
},
"versatile_thermostat": {
"documentation": "https://github.com/jmcollin78/versatile_thermostat",
"version": "7.1.6",
"requirements": []
},
"switch_manager": {
"documentation": "https://github.com/Sian-Lee-SA/Home-Assistant-Switch-Manager",
"version": "2.0.3",
"requirements": []
},
"presence_simulation": {
"documentation": "https://github.com/slashback100/presence_simulation",
"version": "4.12",
"requirements": []
},
"pirateweather": {
"documentation": "https://github.com/alexander0042/pirate-weather-ha",
"version": "1.7",
"requirements": []
},
"duet3d": {
"documentation": "https://github.com/Lyr3x/hass-Duet3D",
"version": "v0.1.3",
"requirements": []
},
"lightener": {
"documentation": "https://github.com/fredck/lightener/blob/master/README.md",
"version": "v2.3.1",
"requirements": []
},
"fontawesome": {
"documentation": "https://github.com/thomasloven/hass-fontawesome",
"version": "2.2.3",
"requirements": []
}
},
"integration_manifest": {
"domain": "openevse",
"name": "OpenEVSE",
"after_dependencies": [
"zeroconf"
],
"codeowners": [
"firstof9"
],
"config_flow": true,
"documentation": "https://github.com/firstof9/openevse/",
"import_executor": true,
"iot_class": "local_push",
"issue_tracker": "https://github.com/firstof9/openevse/issues",
"loggers": [
"openevsehttp"
],
"requirements": [
"python-openevse-http==0.1.70"
],
"version": "0.0.0-dev",
"zeroconf": [
"_openevse._tcp.local."
],
"is_built_in": false,
"overwrites_built_in": true
},
"setup_times": {
"null": {
"setup": 2.3859000066295266e-05
},
"01JJ4VKJ7BGNTWN4BFD6PNF2MT": {
"wait_import_platforms": -0.0070932029993855394,
"config_entry_setup": 1.2058144089996858
}
},
"data": {
"config": {
"created_at": "2025-01-21T16:37:21.771295+00:00",
"data": {
"grid": "",
"host": "192.168.1.8",
"invert_grid": false,
"name": "openevse",
"password": "",
"solar": "",
"username": "",
"voltage": ""
},
"discovery_keys": {},
"disabled_by": null,
"domain": "openevse",
"entry_id": "01JJ4VKJ7BGNTWN4BFD6PNF2MT",
"minor_version": 1,
"modified_at": "2025-01-21T16:37:21.771298+00:00",
"options": {},
"pref_disable_new_entities": false,
"pref_disable_polling": false,
"source": "user",
"title": "openevse",
"unique_id": null,
"version": 1
}
}
}

Anything in the logs that might be useful for us?

Additional information

No response

@KipK
Copy link
Contributor Author

KipK commented Jan 28, 2025

Just saw the python-openevse-htt in requirements.txt was bumped to 0.1.70, but manifest.json is still at 0.1.65 on main git.
Perhaps this is where the issue comes from. I've fixed it on my side and let's see how it goes.

edit: no changes, and I get same problem on websocket-check branch

setting charge current using number.openevse... works, but using set override service pop-up this error too.

@firstof9 firstof9 added the bug Something isn't working label Jan 28, 2025
@firstof9
Copy link
Owner

Something's gone very wrong with your Home Assistant:

KeyError: '01J7BSHM4CWTVBXH5978MGEAMR'

and from your diagnostics:

"entry_id": "01JJ4VKJ7BGNTWN4BFD6PNF2MT",

These should match.

Try removing the integration and setting it up again.

@KipK
Copy link
Contributor Author

KipK commented Feb 2, 2025

It's probably because I got the logs and diag at 2 different time frame. I've reinstalled the plugin inbetween, serial probably changed too.

But I still have this issue sometime not only while calling override.

Here are fresh logs in sync with diag

Enregistreur: openevsehttp.websocket
Source: /usr/local/lib/python3.13/site-packages/openevsehttp/websocket.py:128
S'est produit pour la première fois: 16:14:47 (1 occurrences)
Dernier enregistrement: 16:14:47

Unexpected exception occurred: '01JJ4VKJ7BGNTWN4BFD6PNF2MT'
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/openevsehttp/websocket.py", line 92, in running
    await self.callback(msgtype, msg, None)
  File "/usr/local/lib/python3.13/site-packages/openevsehttp/__main__.py", line 290, in _update_status
    await self.callback()  # pylint: disable=not-callable
    ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/openevse/__init__.py", line 354, in websocket_update
    coordinator = self.hass.data[DOMAIN][self.config.entry_id][COORDINATOR]
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: '01JJ4VKJ7BGNTWN4BFD6PNF2MT'
Enregistreur: openevsehttp.__main__
Source: runner.py:154
S'est produit pour la première fois: 16:14:47 (244 occurrences)
Dernier enregistrement: 16:14:47

Websocket to ws://192.168.1.8/ws failed, aborting [Error: '01JJ4VKJ7BGNTWN4BFD6PNF2MT']

Diagnostic:

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2025.1.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.13.1",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Paris",
    "os_name": "Linux",
    "os_version": "6.6.73-haos",
    "supervisor": "2024.12.3",
    "host_os": "Home Assistant OS 14.2",
    "docker_version": "27.2.0",
    "chassis": "vm",
    "run_as_root": true
  },
    "openevse": {
      "documentation": "https://github.com/firstof9/openevse/",
      "version": "0.0.0-dev",
      "requirements": [
        "python-openevse-http==0.1.71"
      ]
    },
  },
  "integration_manifest": {
    "domain": "openevse",
    "name": "OpenEVSE",
    "after_dependencies": [
      "zeroconf"
    ],
    "codeowners": [
      "firstof9"
    ],
    "config_flow": true,
    "documentation": "https://github.com/firstof9/openevse/",
    "import_executor": true,
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/firstof9/openevse/issues",
    "loggers": [
      "openevsehttp"
    ],
    "requirements": [
      "python-openevse-http==0.1.71"
    ],
    "version": "0.0.0-dev",
    "zeroconf": [
      "_openevse._tcp.local."
    ],
    "is_built_in": false,
    "overwrites_built_in": true
  },
  "setup_times": {
    "null": {
      "setup": 2.4631997803226113e-05
    },
    "01JJ4VKJ7BGNTWN4BFD6PNF2MT": {
      "wait_import_platforms": -0.006685032989480533,
      "config_entry_setup": 2.1677558749943273
    }
  },
  "data": {
    "config": {
      "created_at": "2025-01-21T16:37:21.771295+00:00",
      "data": {
        "grid": "",
        "host": "192.168.1.8",
        "invert_grid": false,
        "name": "openevse",
        "password": "",
        "solar": "",
        "username": "",
        "voltage": ""
      },
      "discovery_keys": {},
      "disabled_by": null,
      "domain": "openevse",
      "entry_id": "01JJ4VKJ7BGNTWN4BFD6PNF2MT",
      "minor_version": 1,
      "modified_at": "2025-01-21T16:37:21.771298+00:00",
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "title": "openevse",
      "unique_id": null,
      "version": 1
    }
  }
}

After few minutes, it got back to working normally itself.

@firstof9
Copy link
Owner

firstof9 commented Feb 2, 2025

"version": "0.0.0-dev",

I see you're not using HACS for the install hehe

So is it working again once more?

@KipK
Copy link
Contributor Author

KipK commented Feb 2, 2025

As I use your current dev version, and sometime tries different branches, I've installed it manually yes.

So is it working again once more?

Yes after having the issue, and couldn't solved it, even when restarting HA, I had to do something else. When I was back, it was working back to normal.

@KipK
Copy link
Contributor Author

KipK commented Feb 5, 2025

fixed

@KipK KipK closed this as completed Feb 5, 2025
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