Custom component folder structure (e.g. for DSMR sensor)

Hi,

I vaguely remember some warnings in my logging some releases ago about the custom component folder structure changing. I didn’t pay attention and as a result my DSMR custom component is no longer working (using the build-in component instead which is updating my usage every second…). As I seem to be unable to find information on how the new structure works I kinda need your help :slight_smile:

What I had is:
config\custom_components\dsmr\sensor.py

What I think is needs to be (but not working) is:
config\custom_components\sensor\dsmr\sensor.py

It could be that the .py file needs to be moved / copied somewhere else?!

Any help is appreciated/

config\custom_components\dsmr\sensor.py is the new structure. In the past it would have been config\custom_components\sensor\dsmr.py. However, you may need a config\custom_components\dsmr\__init__.py, even if it’s just an empty file.

You might also want to check out this topic:

Thanks for the responses! Will give it a try :slight_smile:

Edit: Works like a charm! :smiley:

cheers

1 Like