euc2mqtt


Nameeuc2mqtt JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryEaton UPS Companion to MQTT Publisher
upload_time2024-05-20 13:45:54
maintainerNone
docs_urlNone
authorislandc_
requires_python>=3.12
licenseMIT License Copyright (c) 2024 islandc_ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords eaton ups mqtt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # euc2mqtt

[![License](https://img.shields.io/github/license/islandcontroller/euc2mqtt)](LICENSE) ![PyPI - Version](https://img.shields.io/pypi/v/euc2mqtt)

A tool for publishing status data from a local Eaton UPS Companion service to Homeassistant.

<p align="center"><img src="https://raw.githubusercontent.com/islandcontroller/euc2mqtt/master/scr.png"/></p>

## Quick Start

The following quick start guide should get you up and running from a blank Homeassistant installation. Feel free to skip a step if your system is already configured.

### Install mosquitto

1. In Homeassistant, navigate to *Settings*, *Add-ons*
2. Click the *Add-on store* button
3. Search for *Mosquitto broker* and select the result
4. Click on *Install*

> [!NOTE]
> When using the *Mosquitto broker* Add-on, your MQTT broker hostname will be the same as your Homeassistant's, e.g. "`homeassistant.local`".

### Create a new Homeassistant user for data ingest

As mosquitto requires authentication, I heavily suggest creating a new user for data ingest.

1. In Homeassistant, navigate to *Settings*, *People*
2. Click on *Add person*, input a user name
3. Check *Allow person to log in*
4. Enter all required fields
5. Check *Can only log in from local network*

### Get the application

Windows binaries are provided on the [GitHub Releases](https://github.com/islandcontroller/euc2mqtt/releases) page.

If you prefer to use your own Python insallation, a pre-built package is hosted on [PyPI](https://pypi.org/project/euc2mqtt/) and can be installed and updated using the [`pip`](https://pip.pypa.io/en/stable/getting-started/) utility:

    pip install -U euc2mqtt

### Run it!

> [!NOTE]
> This tool needs to run on the same host as Eaton UPS Companion, as EUC in its default configuration only accepts connections on `localhost:4679`.

Open a terminal and run the tool, providing the broker hostname (your Homeassistant hostname), username and the password!

*Option 1: Standalone application*

    .\euc2mqtt --mqtt <broker hostname> --username <user> --password <password>

*Option 2: Run as Python module*

    python -m euc2mqtt --mqtt <broker hostname> --username <user> --password <password>

### More info

A more in-depth description of available command line parameters can be viewed by appending `-h` at the end of your input. For example:

```
> .\euc2mqtt -h

usage: euc2mqtt [-h] [--name NAME] [--mqtt MQTT] [--euc EUC] [--username USERNAME] [--password PASSWORD] [--interval INTERVAL] [--full-update FULL_UPDATE] [--logfile LOGFILE] [--verbose]

MQTT Publisher for Eaton UPS Companion status messages to Home Assistant. See https://github.com/islandcontroller/euc2mqtt for more info!

options:
  -h, --help            show this help message and exit
  --name NAME           Device name
  --mqtt MQTT           MQTT broker hostname and port (hostname[:port])
  --euc EUC             Eaton UPS Companion hostname and port (hostname[:port])
  --username USERNAME   Username for MQTT broker authentication
  --password PASSWORD   Password for MQTT broker authentication
  --interval INTERVAL   Update interval in seconds
  --full-update FULL_UPDATE
                        Number of incremental dataset fetches between full updates
  --logfile LOGFILE     Output log messages to a file
  --verbose             Enable verbose logging
```

## Running as a Windows Task

1. Open *Task Scheduler* and select *Create New Task...*
2. Select the following options on the *General* tab:
    - Check *Run whether user is logged in or not*
    - Uncheck *Do not store password*
3. On the *Triggers* tab, create a "At startup" trigger
4. On the *Actions* tab, add the standalone application as a program to run:
    - Action: *Start a program*
    - Program/Script: (Navigate to your `euc2mqtt.exe` here)
    - Add arguments: `--mqtt <broker hostname> --username <user> --password <password>`
5. On the *Settings* tab, select the following options:
    - Check *Allow task to be run on demand*
    - Select *If task fails, restart every: 1 minute*
    - Uncheck *Stop the task if it runs longer than: ...*
    - Select *If the task is already running: Do not start a new instance*
6. Click *OK*. You will be prompted for a username and password to run the task as.

## Configuring bind address for Eaton UPS Companion

> [!WARNING]
> Exposing the EUC service may pose a security risk.

> [!NOTE]
> When euc2mqtt is run on the same host as EUC, it is not required to expose the EUC service.

1. Start a `notepad` instance with Admin privileges
2. Open `C:\Program Files (x86)\Eaton\UPSCompanion\configs\config.js`
3. Edit the "`httpServers`" line to listen on all interfaces:

        "httpServers": {"http": {"port": 4679, "hostname": "0.0.0.0"}}, 

## Legal Information

The contents of this repository are licensed under the MIT License. The full license text is provided in the [`LICENSE`](LICENSE) file.

    SPDX-License-Identifier: MIT

"Eaton" is a trademark of Eaton Corporation. "Windows" is a trademark of Microsoft Corporation. All trademarks are property of their respective owners.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "euc2mqtt",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "eaton, ups, mqtt",
    "author": "islandc_",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/33/88/d10b1e2e2f4d56de248adacd4fa40716953d848bcac8abc8b90c62724612/euc2mqtt-1.0.0.tar.gz",
    "platform": null,
    "description": "# euc2mqtt\n\n[![License](https://img.shields.io/github/license/islandcontroller/euc2mqtt)](LICENSE) ![PyPI - Version](https://img.shields.io/pypi/v/euc2mqtt)\n\nA tool for publishing status data from a local Eaton UPS Companion service to Homeassistant.\n\n<p align=\"center\"><img src=\"https://raw.githubusercontent.com/islandcontroller/euc2mqtt/master/scr.png\"/></p>\n\n## Quick Start\n\nThe following quick start guide should get you up and running from a blank Homeassistant installation. Feel free to skip a step if your system is already configured.\n\n### Install mosquitto\n\n1. In Homeassistant, navigate to *Settings*, *Add-ons*\n2. Click the *Add-on store* button\n3. Search for *Mosquitto broker* and select the result\n4. Click on *Install*\n\n> [!NOTE]\n> When using the *Mosquitto broker* Add-on, your MQTT broker hostname will be the same as your Homeassistant's, e.g. \"`homeassistant.local`\".\n\n### Create a new Homeassistant user for data ingest\n\nAs mosquitto requires authentication, I heavily suggest creating a new user for data ingest.\n\n1. In Homeassistant, navigate to *Settings*, *People*\n2. Click on *Add person*, input a user name\n3. Check *Allow person to log in*\n4. Enter all required fields\n5. Check *Can only log in from local network*\n\n### Get the application\n\nWindows binaries are provided on the [GitHub Releases](https://github.com/islandcontroller/euc2mqtt/releases) page.\n\nIf you prefer to use your own Python insallation, a pre-built package is hosted on [PyPI](https://pypi.org/project/euc2mqtt/) and can be installed and updated using the [`pip`](https://pip.pypa.io/en/stable/getting-started/) utility:\n\n    pip install -U euc2mqtt\n\n### Run it!\n\n> [!NOTE]\n> This tool needs to run on the same host as Eaton UPS Companion, as EUC in its default configuration only accepts connections on `localhost:4679`.\n\nOpen a terminal and run the tool, providing the broker hostname (your Homeassistant hostname), username and the password!\n\n*Option 1: Standalone application*\n\n    .\\euc2mqtt --mqtt <broker hostname> --username <user> --password <password>\n\n*Option 2: Run as Python module*\n\n    python -m euc2mqtt --mqtt <broker hostname> --username <user> --password <password>\n\n### More info\n\nA more in-depth description of available command line parameters can be viewed by appending `-h` at the end of your input. For example:\n\n```\n> .\\euc2mqtt -h\n\nusage: euc2mqtt [-h] [--name NAME] [--mqtt MQTT] [--euc EUC] [--username USERNAME] [--password PASSWORD] [--interval INTERVAL] [--full-update FULL_UPDATE] [--logfile LOGFILE] [--verbose]\n\nMQTT Publisher for Eaton UPS Companion status messages to Home Assistant. See https://github.com/islandcontroller/euc2mqtt for more info!\n\noptions:\n  -h, --help            show this help message and exit\n  --name NAME           Device name\n  --mqtt MQTT           MQTT broker hostname and port (hostname[:port])\n  --euc EUC             Eaton UPS Companion hostname and port (hostname[:port])\n  --username USERNAME   Username for MQTT broker authentication\n  --password PASSWORD   Password for MQTT broker authentication\n  --interval INTERVAL   Update interval in seconds\n  --full-update FULL_UPDATE\n                        Number of incremental dataset fetches between full updates\n  --logfile LOGFILE     Output log messages to a file\n  --verbose             Enable verbose logging\n```\n\n## Running as a Windows Task\n\n1. Open *Task Scheduler* and select *Create New Task...*\n2. Select the following options on the *General* tab:\n    - Check *Run whether user is logged in or not*\n    - Uncheck *Do not store password*\n3. On the *Triggers* tab, create a \"At startup\" trigger\n4. On the *Actions* tab, add the standalone application as a program to run:\n    - Action: *Start a program*\n    - Program/Script: (Navigate to your `euc2mqtt.exe` here)\n    - Add arguments: `--mqtt <broker hostname> --username <user> --password <password>`\n5. On the *Settings* tab, select the following options:\n    - Check *Allow task to be run on demand*\n    - Select *If task fails, restart every: 1 minute*\n    - Uncheck *Stop the task if it runs longer than: ...*\n    - Select *If the task is already running: Do not start a new instance*\n6. Click *OK*. You will be prompted for a username and password to run the task as.\n\n## Configuring bind address for Eaton UPS Companion\n\n> [!WARNING]\n> Exposing the EUC service may pose a security risk.\n\n> [!NOTE]\n> When euc2mqtt is run on the same host as EUC, it is not required to expose the EUC service.\n\n1. Start a `notepad` instance with Admin privileges\n2. Open `C:\\Program Files (x86)\\Eaton\\UPSCompanion\\configs\\config.js`\n3. Edit the \"`httpServers`\" line to listen on all interfaces:\n\n        \"httpServers\": {\"http\": {\"port\": 4679, \"hostname\": \"0.0.0.0\"}}, \n\n## Legal Information\n\nThe contents of this repository are licensed under the MIT License. The full license text is provided in the [`LICENSE`](LICENSE) file.\n\n    SPDX-License-Identifier: MIT\n\n\"Eaton\" is a trademark of Eaton Corporation. \"Windows\" is a trademark of Microsoft Corporation. All trademarks are property of their respective owners.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 islandc_  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Eaton UPS Companion to MQTT Publisher",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://github.com/islandcontroller/euc2mqtt?tab=readme-ov-file",
        "Issues": "https://github.com/islandcontroller/euc2mqtt/issues/",
        "Repository": "https://github.com/islandcontroller/euc2mqtt.git"
    },
    "split_keywords": [
        "eaton",
        " ups",
        " mqtt"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b33970e1e8fbe23c3abf88ca7ef71dd7f77eb515f11700471a9d6dc22a8447db",
                "md5": "733789b2da536ea6f9324cc91c88a6ae",
                "sha256": "80c8c4e755f429112dfc669c6d1871775e396f80ca5f685b321c5f942a006a0e"
            },
            "downloads": -1,
            "filename": "euc2mqtt-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "733789b2da536ea6f9324cc91c88a6ae",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 12249,
            "upload_time": "2024-05-20T13:45:52",
            "upload_time_iso_8601": "2024-05-20T13:45:52.806124Z",
            "url": "https://files.pythonhosted.org/packages/b3/39/70e1e8fbe23c3abf88ca7ef71dd7f77eb515f11700471a9d6dc22a8447db/euc2mqtt-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3388d10b1e2e2f4d56de248adacd4fa40716953d848bcac8abc8b90c62724612",
                "md5": "327105b3007aebc018dec6cbdc446e50",
                "sha256": "e4300da9a2499b362ae7f75eb8922dcf044e0d37817610f2bd1aea9c0ed53e01"
            },
            "downloads": -1,
            "filename": "euc2mqtt-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "327105b3007aebc018dec6cbdc446e50",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 92518,
            "upload_time": "2024-05-20T13:45:54",
            "upload_time_iso_8601": "2024-05-20T13:45:54.423970Z",
            "url": "https://files.pythonhosted.org/packages/33/88/d10b1e2e2f4d56de248adacd4fa40716953d848bcac8abc8b90c62724612/euc2mqtt-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-20 13:45:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "islandcontroller",
    "github_project": "euc2mqtt?tab=readme-ov-file",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "euc2mqtt"
}
        
Elapsed time: 0.25500s