pydevice2mqtt


Namepydevice2mqtt JSON
Version 0.2.5 PyPI version JSON
download
home_page
SummaryThis project provides a simplified control of devices via MQTT. Supports the Hasso auto configuration protocol
upload_time2023-06-25 19:04:18
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords hassio mqtt homeassistent homeautomation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pydevice2mqtt

Python class library for device handling via MQTT. 
All devices supports the auto discovery and configuration of Hassio

## Build and Install
### build wheel: 

    # from top folder: 
    pip install -e .
    flit build

### install wheel:
       
    pip install pydevice2mqtt

## Usage
```Python
import os
import pathlib       
import pydevice2mqtt
    
# may create a dict with the device information
new_device: dict = {"ArbitrarySensor": [
    {"name": "Sensor 1",
     "device_class": "current",
     "unit_of_measurement": "A",
     "object_id": "special_ID1"},
    {"name": "Sensor 2",
     "device_class": "temperature",
     "unit_of_measurement": "C",
     "object_id": "special_ID2"}
]}

remote_config = "remote_config.yaml" # your config file with the mqtt settings

pydevice2mqtt.DeviceBridge.update_config(devices=new_device, config_file=remote_config)

my_bridge = pydevice2mqtt.DeviceBridge(config_file=remote_config)
my_bridge.configure_devices() # add new devices in Hassio

my_bridge.loop()
```

### Update Sensor Value
```Python   
from typing import Dict               
import pydevice2mqtt


devices: Dict[str,pydevice2mqtt.RemoteDevice]   = my_bridge.get_devices()
devices[<unique_sensor_id>].set_value(123)

```             





            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pydevice2mqtt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "hassio,mqtt,homeassistent,homeautomation",
    "author": "",
    "author_email": "HighImp <AnyHighZ@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0d/6f/eb32cff7429dab5b2c69783d12651b5b650f28dab88ed3f331021e45b988/pydevice2mqtt-0.2.5.tar.gz",
    "platform": null,
    "description": "# pydevice2mqtt\n\nPython class library for device handling via MQTT. \nAll devices supports the auto discovery and configuration of Hassio\n\n## Build and Install\n### build wheel: \n\n    # from top folder: \n    pip install -e .\n    flit build\n\n### install wheel:\n       \n    pip install pydevice2mqtt\n\n## Usage\n```Python\nimport os\nimport pathlib       \nimport pydevice2mqtt\n    \n# may create a dict with the device information\nnew_device: dict = {\"ArbitrarySensor\": [\n    {\"name\": \"Sensor 1\",\n     \"device_class\": \"current\",\n     \"unit_of_measurement\": \"A\",\n     \"object_id\": \"special_ID1\"},\n    {\"name\": \"Sensor 2\",\n     \"device_class\": \"temperature\",\n     \"unit_of_measurement\": \"C\",\n     \"object_id\": \"special_ID2\"}\n]}\n\nremote_config = \"remote_config.yaml\" # your config file with the mqtt settings\n\npydevice2mqtt.DeviceBridge.update_config(devices=new_device, config_file=remote_config)\n\nmy_bridge = pydevice2mqtt.DeviceBridge(config_file=remote_config)\nmy_bridge.configure_devices() # add new devices in Hassio\n\nmy_bridge.loop()\n```\n\n### Update Sensor Value\n```Python   \nfrom typing import Dict               \nimport pydevice2mqtt\n\n\ndevices: Dict[str,pydevice2mqtt.RemoteDevice]   = my_bridge.get_devices()\ndevices[<unique_sensor_id>].set_value(123)\n\n```             \n\n\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "This project provides a simplified control of devices via MQTT. Supports the Hasso auto configuration protocol ",
    "version": "0.2.5",
    "project_urls": null,
    "split_keywords": [
        "hassio",
        "mqtt",
        "homeassistent",
        "homeautomation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "93db5006c3c006b7b2fe986f67ae7acf061706edae2844126de76ef849914114",
                "md5": "6a9eec826673bd9b10214c71efe353be",
                "sha256": "df8261b91788d15427a8237c171ffa95c94082c7a0a64b9183cb26b2612989a7"
            },
            "downloads": -1,
            "filename": "pydevice2mqtt-0.2.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6a9eec826673bd9b10214c71efe353be",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10764,
            "upload_time": "2023-06-25T19:04:17",
            "upload_time_iso_8601": "2023-06-25T19:04:17.601376Z",
            "url": "https://files.pythonhosted.org/packages/93/db/5006c3c006b7b2fe986f67ae7acf061706edae2844126de76ef849914114/pydevice2mqtt-0.2.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d6feb32cff7429dab5b2c69783d12651b5b650f28dab88ed3f331021e45b988",
                "md5": "4a714c5b2ac8faf13656c90f37fdda84",
                "sha256": "f34e3433fa3d4570e5259dff9103300e2dcc0c231a18c7e9fadfd8993ee0b93b"
            },
            "downloads": -1,
            "filename": "pydevice2mqtt-0.2.5.tar.gz",
            "has_sig": false,
            "md5_digest": "4a714c5b2ac8faf13656c90f37fdda84",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12325,
            "upload_time": "2023-06-25T19:04:18",
            "upload_time_iso_8601": "2023-06-25T19:04:18.943487Z",
            "url": "https://files.pythonhosted.org/packages/0d/6f/eb32cff7429dab5b2c69783d12651b5b650f28dab88ed3f331021e45b988/pydevice2mqtt-0.2.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-25 19:04:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pydevice2mqtt"
}
        
Elapsed time: 0.07989s