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

Cannot use custom EEP.xml #109

Open
OlwinFroon opened this issue Dec 21, 2023 · 6 comments
Open

Cannot use custom EEP.xml #109

OlwinFroon opened this issue Dec 21, 2023 · 6 comments
Labels
addon Addon related issues

Comments

@OlwinFroon
Copy link

The problem

As depicted here, HA_enoceanmqtt stops working as soon as I edit a custom EEP file into the configuration.

Perhaps it is because of my configuraition setup. I didn´t want to clutter up my config root directory, so I added a directory /config/enoceanmqtt to hold
device file, custom mappin and EEP and the log.

Insights so far:
a) adding a custom EEP.xml will cause E2M to stop right after the start.
There are no log entries.
b) adding a copy of the same custom EEP.xml to the /config directory (without removing the one in the subdirectory or changing the configuration) will cause E2M to run, but it will ignore the custom EEP.
c) the reason for this issue lies in the run.py script of HA_enoceanmqtt-addon.

What type of installation are you running?

Addon

What version of HA_enoceanmqtt has the issue?

0.1.28-1

What was the last working version of HA_enoceanmqtt?

0.1.28

What type of Home Assitant installation are you running?

Home Assistant OS

Anything in the logs that might be useful to solve the issue? (Strongly recommended if applicable)

No response

Additional information

No response

@mak-gitdev mak-gitdev added the addon Addon related issues label Dec 21, 2023
@mak-gitdev
Copy link
Owner

Hi @OlwinFroon,

TL;DR

This will be fixed by 0.1.29.

Collapse to see the detailed explanation

The issue comes from the run.sh file.
The custom EEP is installed by overwriting the default EEP.xml file.
As it stands, the location of the default EEP.xml is retrieved using this command:

   EEP_FILE_LOCATION=$(find / -name "EEP.xml" -print -quit 2>/dev/null)

This will look for a file named EEP.xml in the whole Docker container (yes, an addon is a Docker container) and select the first one encountered as there should always be only one.
This issue was a latent bug as this command will look into the /config as well.
Since 0.1.28-1, without going into further details, the first file will always be found in /config.
Hence we end up trying to overwrite the custom EEP file with ... the custom EEP file, hence the error.

This can be fixed by excluding the /config directory from the search.

   EEP_FILE_LOCATION=$(find / -path /config -prune -o -name 'EEP.xml' -print -quit 2>/dev/null)

Version 0.1.29 will fix this issue.

@OlwinFroon
Copy link
Author

Oh. So the issue wouldn't have occured if I just renamed the custom to anything else but EEP.xml.

Gotta try that ...

@OlwinFroon
Copy link
Author

Woo hoo, renamed it to myEEP.xml and it works :D

@mak-gitdev
Copy link
Owner

As simple as that 😅

@OlwinFroon
Copy link
Author

Okay, the workaround works, the fix will come with the next version.
I guess this can be closed.
Happy new year, btw :)

@mak-gitdev
Copy link
Owner

Reopened for tracking

@mak-gitdev mak-gitdev reopened this Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon Addon related issues
Projects
None yet
Development

No branches or pull requests

2 participants