basnijholt / addon-otmonitor

OpenTherm Monitor Home Assistant supervisor add-on
17 stars 11 forks source link

When autoconfig set to false, logs show it still being used #19

Closed Wolfensteijn closed 3 years ago

Wolfensteijn commented 3 years ago

In the default configuration (and what I wish it to do) the following is set:

mqtt_autoconfig: false

The logs then give this rather confusion piece of information:

INFO: Using autoconfig provided MQTT credentials from supervisor
ERROR: Got unexpected response from the API: Service not enabled
INFO: Finished the config overwriting.

The end result is that it appears that the autoconfig option is still used, and some part of the log is being overwritten. I also don't see any messages showing up in my MQTT broker.

fliphess commented 3 years ago

Auch, I missed that! Sorry for the inconvenience! I'll push a fix.

fliphess commented 3 years ago

I Think I've found the cause, working on a PR

fliphess commented 3 years ago

That looks a lot better:

Logging:

[cont-init.d] otmonitor.sh: executing... 
[22:17:57] INFO: Initializing service configuration.
[22:17:57] INFO: Using manually provided MQTT credentials
[22:17:57] INFO: Finished the config overwriting.
[cont-init.d] otmonitor.sh: exited 0.

Config:

...
mqtt {
  enable true
  broker addon_core_mosquitto
  port 1883
  username test
  password dGVzdA==
  devicetype central_heating
  deviceid otmonitor
  format raw
  client null
}
...
fliphess commented 3 years ago

@Wolfensteijn I've just pushed a fix, I think you should be good to go if you reload the repository and rebuild the container.

Wolfensteijn commented 3 years ago

@fliphess Feedback is nice, sorry for the delay.

Yes it is working now, thanks for the prompt response and fix.