hvxl / otmonitor

Monitor tool for the OTGW (http://otgw.tclcode.com/)
GNU Lesser General Public License v3.0
27 stars 10 forks source link

When run as a daemon some settings are not being picked up #9

Closed iamkarlson closed 3 years ago

iamkarlson commented 3 years ago

Hi, I'm trying to run otmonitor as a daemon by this addon for Home Assistant. Essentially, otmonitor is being run by the following command:

wget http://otgw.tclcode.com/download/otmonitor -O /opt/otmonitor && \
chmod +x /opt/otmonitor
cd /opt || exit
exec ./otmonitor --daemon -f /etc/otmonitor/otmonitor.conf

where's /etc/otmonitor/otmonitor.conf are:

web {
  enable true
  port 8080
  nopass true
}
connection {
  enable true
  type tcp
  host %%otgw_host%%
  port %%otgw_port%%
}
mqtt {
  enable true
  broker %%mqtt_broker%%
  port %%mqtt_port%%
  username %%mqtt_username%%
  password %%mqtt_password%%
  devicetype central_heating
  deviceid otmonitor
  format unformatted
  client random_identifier_here
}
server {
  enable true
  port 7686
  relay true
}
clock {
  year true
  date true
  auto true
}

When I navigate to the web UI of the daemon, I see the following:

image

Settings for MQTT are set but it's not enabled. What can be the reason for that?

Thanks for any help!

P.S. also there's an issue in the addon repo.

hvxl commented 3 years ago

If you check your MQTT broker logs, you would see that otmonitor actually does connect. It's only the web page that doesn't show the MQTT enable flag correctly. This has already been fixed years ago. But you are downloading a 4 year old binary that apparently dates from before the fix. Use the latest version available on github if the web site glitch bothers you.

iamkarlson commented 3 years ago

Thanks @hvxl I'll try to create an image which builds single executable from github sources instead of downloading a built one.