Giter Club home page Giter Club logo

Comments (3)

mjmccans avatar mjmccans commented on June 17, 2024

I am wondering if you are bumping into a permissions issue. One thing to try would be using the --config option to expressly set out the full path to your options file.

On a side note, native support for Airthings devices using the new bluetooth integration is being added to Home Assistant Core so you may not need this script in the future. I believe it was merged into the dev branch yesterday but missed the beta window for version 2022.10 so it is now slated for version 2022.11. The native support will provide a much nicer user experience, including auto-discovery of devices.

from airthings-mqtt-ha.

eresgit avatar eresgit commented on June 17, 2024

Using the --config options and setting the output path made it run like expected, I am not sure the reason why Environment path does not work, some assumptions may be wrong on my end.

I prefer using only MQTT discovery so your project works perfect for me, what I would like however would be a way to upload the measurements to the airthings cloud without using my phone manually, but that's beside the point in this issue :)

Thanks

from airthings-mqtt-ha.

StefanTT avatar StefanTT commented on June 17, 2024

Sorry for the too late comment but I think I can clarify the confusion.

The script loads ./options.json if no config file is specified. This file is taken from the current directory of the python process running the script. The current directory is not where the script lies. If you expect this to work you have to change the service file to something like this:

[Unit]
Description=Airthings to Home Assistant via MQTT
After=network-online.target

[Service]
User=hass
Group=hass
Environment="PATH=/usr/local/bin:/usr/bin:/bin"
ExecStart=python ./airthings-mqtt-ha.py
WorkingDirectory=/usr/local/src/airthings-mqtt/src
Restart=always
RestartSec=2s

from airthings-mqtt-ha.

Related Issues (8)

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.