zivillian / ism7mqtt

GNU General Public License v3.0
49 stars 8 forks source link

Docker version always using separate topics #101

Closed alexkno79 closed 3 months ago

alexkno79 commented 3 months ago

I wanted to change my logic of working with the mqtt messages from using separate topics to using the json messages instead.

So I adapted the container by removing the ISM7_SEPARATE flag but still all values are returned only as separate message/topic but not as json.

Running ism7mqtt locally without —seperate works fine. But running it in docker it seems seperate is forced even if not requested. I tested both with docker run and also compose file.

It looks like this is triggered by the way ISM7_HOMEASSISTANT_ID is initialized. I can see in portainer that the variable seems to be created for the container but with empty string. I guess this is triggered due to the line „ ISM7_HOMEASSISTANT_ID=“ in the docker file. And as any value for this variable triggers separate and retain to be set to true in program.cs, those two are always activated

Would it be possible to either remove it from the docker file (those who need it can set it anyway; like done for ISM7_SEPARATE) but this way it is not forced for users who want/need the json. Maybe also in Program.cs changing discoveryId != null to also check for empty string would work? Or also in Program.cs setting null as fall back value….