Skip to content

Can't set up WSS / TLS in 0.8.13 - AttributeError: 'CentralSystemSettings' object has no attribute 'certfile' #83

@BJReplay

Description

@BJReplay

Describe the bug
I set up your repo as a custom HACS repo, and installed 0.8.3 to test adding two chargers - one that I had installed today, and a simulator that I was using to tune automations for when the charger arrived.

As my charger supports wss, I removed the central station and charger, and attempted to re-set up the central station with TLS / WSS.

I have the certificates mounted to a mount (/certs) in the HA docker container, and specified them as /certs/fulchain.cer and /certs/my.cert.key

However, I couldn't set up the central station using WSS / TLS (i.e. with the TLS box ticked), and the error shown below was logged on each attempt. If I didn't specify TLS, I could set it up.

I reverted to the HACS repo (removed your repo as custom repo), and re-downloaded 0.7.0, and was able to set up WSS / TLS as expected.

To Reproduce
Steps to reproduce the behavior:

  1. Remove any existing central stations and chargers.
  2. Ensure that certificates are available (i.e. copied to config / in a mount point).
  3. Attempt to set up a central station leaving all items default except for TLS ticked on, and specifying the certificates.
  4. See error - failed to set up service.
  5. Note log errors.

Expected behavior
TLS should be able to be specified.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Docker
  • Browser edge
  • Version N/A

Additional context
Logs:

2025-02-01 22:03:56.745 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry central for ocpp
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/__init__.py", line 104, in async_setup_entry
    central_sys = await CentralSystem.create(hass, entry)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ocpp/api.py", line 153, in create
    localhost_certfile = self.settings.certfile
                         ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'CentralSystemSettings' object has no attribute 'certfile'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions