Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tydom2mqtt is failing to start when no tty #40

Closed
fmartinou opened this issue Nov 22, 2021 · 11 comments
Closed

tydom2mqtt is failing to start when no tty #40

fmartinou opened this issue Nov 22, 2021 · 11 comments

Comments

@fmartinou
Copy link
Contributor

tydom2mqtt fail starting if no tty is enabled.
Example failing

$ docker run -e TYDOM_MAC="xxx" ... --rm mrwiwi/tydom2mqtt_edge

Starting main.py <-- stuck here

Example working

$ docker run -t -e TYDOM_MAC="xxx" ... --rm mrwiwi/tydom2mqtt_edge

Starting main.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
STARTING TYDOM2MQTT
Dectecting environnement......
...

It's caused by the Popen in forever.py.

Generally speaking, I don't think that handling uncaught errors in an uber Python process for automatic restart is a good practice.
Especially when working in containerized environments 🤔

Better use --restart Docker option to handle automatic restart on crash.

You can find here the related commit on my fork.

@mrwiwi
Copy link
Owner

mrwiwi commented Nov 23, 2021

Hi @fmartinou ! Big thanks to take upon that project, you seems way more skilled that I am and I'm glad !
The forever py was a dirty workaround before home assistant introduced the watchdog. Could you please take the lead on a proper add-on (if you use home assistant) ? I did what I could be don't have time and skills, I started that project just for my needs, with no experience in coding so...

@fmartinou
Copy link
Contributor Author

Hi @mrwiwi,

I'm using Home-Assistant but unfortunately, I'm not using Hass.io so I don't know much about Supervisor, addons and so on.
I don't really know what an addon should look like and don't know how to test it 🤔 .

I'll take some time to know more about all that and I'll let you know if I think I can be helpful.

Thanks again for your project! I'm now able to control my heating system from Home-Asssistant 🤩 !

@mrwiwi
Copy link
Owner

mrwiwi commented Nov 23, 2021

You should try a supervised install ! Big advantage is backup/logs/installation of everything in HA, and add-ons are just docker containers integrated in HA ! You can check my add-on for tydom2mqtt, with your skills I'm pretty sure you will figure it out very quickly !

@mrwiwi
Copy link
Owner

mrwiwi commented Nov 24, 2021

I've just installed your add-on, that's great, lighter indeed ! I think all users should switch to your fork now, what do you think ?

@fmartinou
Copy link
Contributor Author

Hi,

I'm currently working on that :)
You were right; addon publishing is not that hard 😃

I'm going to create an external addon repository because I'm planning to deploy 2 other addons in addition to tydom2mqtt:

Please give me few additional days and existing users should be able to switch to my fork 😄

Besides that, would you be interesting to join me as developer on my fmartinou/tydom2mqtt fork?

Because I now about Docker, Code quality, automation... but I don't know much about Deltadore stuff (and I have almost no Deltadore devices at home) 🤔

@mrwiwi
Copy link
Owner

mrwiwi commented Nov 24, 2021

I'm in ! ^^ I just have covers and alarm, but I begin to know pretty well the tydom box and websockets ;D

@fmartinou
Copy link
Contributor Author

Invitation sent; welcome on board!

@fmartinou
Copy link
Contributor Author

Hi @mrwiwi ,

I created a static documentation (hosted on Github pages) for the project: https://fmartinou.github.io/tydom2mqtt/
The source files (markdown files) are right next to the source code.

In addition, I created the first release on my fork (2.0.0) and referenced it into my new hass.io addons repository

Could you give it a try?
(The repository to add to your Home-Assistant instance is https://github.com/fmartinou/hassio-addons.git)

Thanks!

@fmartinou
Copy link
Contributor Author

fmartinou commented Nov 25, 2021 via email

@mrwiwi
Copy link
Owner

mrwiwi commented Nov 25, 2021

That's awesome !!! Hassio add-on working perfectly here, except for MQTT default value : localhost doesn't work, but "homeassistant" do !

The documentation, the icon... Wow it feels like an professional project :D thanks a lot !

@fmartinou
Copy link
Contributor Author

Hi!

Thanks for your support!

default value : localhost doesn't work, but "homeassistant" do

Oh yeah, I get it.

By default, addons are running in the same network as homeassistant (see host_network)

So on localhost, there is no MQTT_broker.

=> I changed the default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants