Giter Site home page Giter Site logo

basnijholt / addon-otmonitor Goto Github PK

View Code? Open in Web Editor NEW
15.0 9.0 11.0 160 KB

OpenTherm Monitor Home Assistant supervisor add-on

Dockerfile 3.58% Shell 6.68% HTML 50.35% CSS 4.96% JavaScript 34.43%
hassio home-assistant hassio-addons supervisor otgw opentherm-gateway opentherm-monitor

addon-otmonitor's Introduction

otmonitor Home Assistant supervisor add-on

About

Opentherm monitor is a management and monitoring application for your opentherm gateway.

Installation

Install by going to Supervisor -> Add-on store -> Add new repository by url and fill in https://github.com/basnijholt/addon-otmonitor.

Documentation

See otmonitor/DOCS.md.

Local development

To locally test or develop on this addon, use vscode as explained in the home assistant local adding testing developer documentation.

It takes a while to build, download and start the local devcontainer as it runs a local home assistant instance using docker-in-docker (din), which is slow, but it's very useful to test your local changes.

In short:

  • Install Docker on your local machine
  • Copy the .devcontainer directory from the root of the community-addons repository
  • Open the project in Visual Studio Code
  • Select Rebuild and Reopen in Container from the command palette
  • Wait until the devcontainer itself is build
  • Start the ha instance by running task Start Home Assistant
  • Grab a coffee and wait until all the required home-assistant containers are up
  • Setup your local ha instance on http://localhost:812
  • Install mosquitto mqtt broker
  • Install the local otmonitor addon
  • Test your changes

To build the container manually, use:

ARCH=amd64
docker build --build-arg BUILD_FROM=homeassistant/${ARCH}-base-debian:bullseye --build-arg BUILD_ARCH=${ARCH} .

addon-otmonitor's People

Contributors

andriej avatar basnijholt avatar fliphess avatar iamkarlson avatar merll avatar mihsu81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

addon-otmonitor's Issues

I cannot commit to this repository anymore

Hey @basnijholt!

This weekend I made the big decision and bought a Plugwise Anna thermostat and got rid of my OpentTerm gateway. (They're really affordable in the summer ๐Ÿ‘ )

Because of this, I'm not in the position anymore to commit to this project.
I won't be watching for new issues to push fixes in the future, so for the sake of the principle of least permissions, I think it would be wise to remove my merge permissions.

Thanks a lot for your trust and intentions giving me commit rights and the freedom to push a lot of improvements to this repository, I had a lot of fun doing so :)

See you around!

-X-

Flip

(I will close this issue in a few days, as it's not related to anything that requires fixing)

deprecated: loop error in logs

Looking at system logs, there's an deprecation warning:

defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)
defa3e4e[597]: /usr/local/lib/python3.8/site-packages/pyotgw/protocol.py:147: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
defa3e4e[597]:   await asyncio.sleep(timeout, loop=self.loop)

Adding custom changes to html to the docroot at build time

Hey Bas!

Thanks for addon!

I'm migrating from home-assistant manually installed in a virtualenv to supervised and figuring out how to replace the services I'm running with addons.

I'm currently looking for a replacement for otmonitor and then I've found this addon. Lovely!

In my current otmonitor I'm making some changes to the HTML in the docroot prior to building the binary (mostly css changes)

I'd love to create a PR adding this, but If you are hesitant to support it to prevent future issues, I'm open to creating a fork for personal use.

Are you open to supporting such a change?

No data on page

Hi,

I have install the addon without problems and setup the "Configuration" and runs the addon.
In the logfile I get no error's, but the otmonitor page don't receive any info from the otgw.

What do I wrong and is there anything I can check?

Can't install anymore

 ---> 6301732f4be4
Step 7/27 : ARG BUILD_ARCH
 ---> Using cache
 ---> 623f7c2c3f0d
Step 8/27 : SHELL ["/bin/bash", "-o", "pipefail", "+x", "-c"]
 ---> Using cache
 ---> 21c831cd8613
Step 9/27 : WORKDIR /otmonitor
 ---> Using cache
 ---> 1ebe80d61eb6
Step 10/27 : RUN apt-get update  && apt-get install -y --no-install-recommends wget  && wget -qO /tmp/otm.tgz https://github.com/hvxl/otmonitor/archive/master.tar.gz  && tar xzf /tmp/otm.tgz --strip=1 -C .  && rm /tmp/otm.tgz  && wget -qO ./sdx.kit https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/tclkit/sdx-20110317.kit   && if [[ "${BUILD_ARCH}" = "aarch64" ]]; then URL_BASE="tclkit-aarch64"; fi  && if [[ "${BUILD_ARCH}" = "amd64" ]]; then URL_BASE="tclkit-x64"; fi  && if [[ "${BUILD_ARCH}" = "armhf" ]]; then URL_BASE="tclkit-ahf"; fi  && if [[ "${BUILD_ARCH}" = "armv7" ]]; then URL_BASE="tclkit-ahf"; fi  && if [[ "${BUILD_ARCH}" = "i386" ]]; then URL_BASE="tclkit"; fi  && wget -qO tclkit https://otgw.tclcode.com/download/${URL_BASE}  && cp tclkit runtime  && chmod +x tclkit  && ./tclkit sdx.kit wrap otmonitor -runtime runtime
 ---> Running in 9584e930cfdc
Get:1 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:4 http://security.debian.org/debian-security buster/updates/main amd64 Packages [308 kB]
Get:5 http://deb.debian.org/debian buster/main amd64 Packages [7906 kB]
Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [15.2 kB]
Fetched 8469 kB in 3s (2996 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  libpcre2-8-0
The following NEW packages will be installed:
  libpcre2-8-0 wget
0 upgraded, 2 newly installed, 0 to remove and 32 not upgraded.
Need to get 1115 kB of archives.
After this operation, 3925 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 libpcre2-8-0 amd64 10.32-5 [213 kB]
Get:2 http://deb.debian.org/debian buster/main amd64 wget amd64 1.20.1-1.1 [902 kB]
debconf: delaying package configuration, since apt-utils is not installed

Fetched 1115 kB in 0s (5081 kB/s)
Selecting previously unselected package libpcre2-8-0:amd64.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 6918 files and directories currently installed.)
Preparing to unpack .../libpcre2-8-0_10.32-5_amd64.deb ...
Unpacking libpcre2-8-0:amd64 (10.32-5) ...
Selecting previously unselected package wget.
Preparing to unpack .../wget_1.20.1-1.1_amd64.deb ...
Unpacking wget (1.20.1-1.1) ...
Setting up libpcre2-8-0:amd64 (10.32-5) ...
Setting up wget (1.20.1-1.1) ...
Processing triggers for libc-bin (2.28-10) ...
Removing intermediate container 9584e930cfdc

While trying to install on latest superrvisor and Debian 11.1 I see error as above.
There was no issue with Debian 11.0.

Does not build on raspberry

It does not build on any other arch than amd64, because you are downloading a x64 binary

a quick test changing the BUILD_ARCH and download, seem to install, see

Not tested is the running state.

s6-overlay-suexec

Many thanks for this super helpful addon.
Unfortunately, since an HA update I always get the following message and the addon no longer starts.

s6-overlay-suexec: fatal: can only run as pid 1

Is there anything I can do to get it to start again?

How to set boiler setpoint via this addon?

Hi Bas,
Thanks for the addon! I'm trying to make use of it and encounter a problem that I couldn't see any place where I can actually use my otgw to set a temperature of the boiler. Am I missing something? In normal otgw monitor you would have an option to set mode override and then control whatever you want. Where to set these options here?

otmonitor add-on does not install (Home Assistant Core 2020.12.0)

When I try to install the otmonitor add-on through Supervisor, I get the error message:

The command '/bin/bash -o pipefail -c ./tclkit sdx.kit wrap otmonitor -runtime runtime && cp otmonitor /opt/otmonitor &&chmod +x /opt/otmonitor' returned a non-zero code:126

afbeelding

I'm running Home Assistant Core 2020.12.0

What could be the problem?

Thanks

No issue;-)
Just found and installed this addon earlier today, after soldering my OTGW.
Great stuff!

problem while installing

After adding repo to add-on supervisor, I've clicked install and got error in popup.
Error comes from cloudflare which is my proxy in-between for nginx (and securing whole installation).

There is no issue with that regarding other ingress addons - I'd like to give otmonitor a spin.
How can I help you debug?

Override mode is not set as well as other settings.

Hi,
I've run an addon with appropriate settings for MQTT/OTGW. However, if I open a web UI from the addon page I can see some data but can't change any settings. Button Done which appears in non-daemon version of the app is not visible in the addon.

image
image

Is there anything I can try to get the settings working? Did you experience such an issue?

S6 init issue?

I've reinstalled HA on my host and while trying to install add-on I have an error:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/nginx.sh
/package/admin/s6-overlay-3.1.0.1/etc/s6-rc/scripts/cont-init: 14: /etc/cont-init.d/nginx.sh: Permission denied
cont-init: info: /etc/cont-init.d/nginx.sh exited 126
cont-init: info: running /etc/cont-init.d/otmonitor.sh
[20:19:45] INFO: Initializing service configuration.
[20:19:47] INFO: Using manually provided MQTT credentials
[20:19:48] INFO: Finished updating otmonitor config file.
cont-init: info: /etc/cont-init.d/otmonitor.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

which seem to be quite odd?

It's HA OS installation

Add websocket to nginx

Currently, even when using proper setup with SSL, in "messages" there's an error about websocket in browser.
Adding otmonitor webpage to nginx-proxy with websocket support makes it working properly (so the messages and charts update themselves automatically).

I think it's worth adding in nginx configuration

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

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.

Adding webserver access user/pass

Going through some network-security internally, I can see that currently there's no doable way of securiing access to this addon (so non-VLAN network can have thermostat managed by anyone).

I can see that in .conf file of otmonitor there's space for nopass set to true.
I can't find options how it should look like to have at least admin user defined (and allowed in add-on configuration).

Would love to see that feature enabled tho.

Tried looking at source code but I'm not yet familiar enough with TCL

Connect over serial?

My otgw is connected directly via serial, but it seems the config has a fixed type tcp. Would you consider adding an option to make that configurable?

New supervisor 2021.02.5- 'startup' deprecated error

21-02-08 11:02:26 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'startup' with 'before' is deprecated. Please report this to the maintainer of otmonitor in latest stable Supervisor: 2021.02.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.