HA_enoceanmqtt icon indicating copy to clipboard operation
HA_enoceanmqtt copied to clipboard

Cannot use custom EEP.xml

Open OlwinFroon opened this issue 1 year ago • 6 comments

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

OlwinFroon avatar Dec 21 '23 16:12 OlwinFroon

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.

mak-gitdev avatar Dec 21 '23 17:12 mak-gitdev

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

Gotta try that ...

OlwinFroon avatar Dec 21 '23 17:12 OlwinFroon

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

OlwinFroon avatar Dec 21 '23 17:12 OlwinFroon

As simple as that :sweat_smile:

mak-gitdev avatar Dec 21 '23 17:12 mak-gitdev

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

OlwinFroon avatar Jan 06 '24 15:01 OlwinFroon

Reopened for tracking

mak-gitdev avatar Jan 07 '24 07:01 mak-gitdev