Adding breakpoint on a custom integration with devcontainers and Ludeeus Blueprint devcontainer/integration

Hello,

I’m strugling for many days with the debug of my custom integration.
My config is the following:

I’ve added this config in my configuration.yaml:

debugpy:
   start: true
   wait: false
   port: 5678

I’ve added this piece of config in launch.json:

{
      // Example of attaching to local debug server
      "name": "Python: Attach Local",
      "type": "python",
      "request": "attach",
      "port": 5678,
      "host": "localhost",
      "justMyCode": false,
      "pathMappings": [
        {
          "localRoot": "${workspaceFolder}",
          "remoteRoot": "."
        },
        {
          "localRoot": "${workspaceFolder}/custom_component/versatile_thermostat",
          "remoteRoot": "/config/custom_component/versatile_thermostat"
        }
      ]
    },
  • I run hass (start devcontainer) and it starts fine, my custom integration is visible,
  • I attach the debugger by clicking here Capture d’écran 2023-01-27 à 12.20.05. I see some thread and stack trace so I should be operational,
  • I add some breakpoint but the execution never stop in my breakpoints whereever I put it (in my specific code or in HA legacy code.

Any would be appreciated.

Maybe my problem is that I’m running HA with the Ludeeus blueprint integration. I don’t know exactly how it works.

Note: I have read many post on this subject without success:

Hello,

Any help for this. I have change many things like removing the Ludeeus Blueprint without more success.

Really no idea ? Nobody got the breakpoints working when developing a new Integration ?
I can’t believe that

Hi Jean Marc,

I’m struggling too … did you found anything?

Hello, yes it works now. This is a too old issue, I can’t remember what I do.

ah ah you are lucky :slight_smile: Not working for me working on a custom component (the netatmo one), and no debug is really a pain, logging has its merit but well nothing beats a breakpoint !

Hi @jmcollin. I would also appreciate being able to use debugging in my development. Would you be able to please share your docker configuration file and/or anything else which might point the rest of us in the right direction?

Thanks in advanced.

What I propose to you is to have a look on my project which is able to add breakpoint now without problem: GitHub - jmcollin78/versatile_thermostat: A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management

You can have a look at the devcontainer.json which install some addon, the .vscode directory can also be interesting.

Disclaimer: I’m not a Python dev specialist so be fair with python tooling and coding.