Skip to main content

No project description provided

Project description

hass-mqtt-devices

A python 3 module that takes advantage of Home Assistant's MQTT discovery protocol to create sensors without having to define anything on the HA side.

Supported Types

Binary Sensors

Usage

from hass_mqtt_devices.sensors import BinarySensor

# Create a settings dictionary
#
# Mandatory Keys:
#  mqtt_server
#  mqtt_prefix - defaults to homeassistant
#  mqtt_user
#  mqtt_password
#  device_id
#  device_name
#  device_class
#
# Optional Keys:
#  payload_off
#  payload_on
#  unique_id

configd = {
    "mqtt_server": "mqtt.example.com",
    "mqtt_prefix": "homeassistant",
    "mqtt_user": "mqtt_user",
    "mqtt_password": "mqtt_password",
    "device_id": "device_id",
    "device_name":"MySensor",
    "device_class":"motion",
}
mysensor = BinarySensor(settings=configd)
mysensor.on()
mysensor.off()

Scripts Provided

hass_mqtt_devices creates the following helper scripts you can use in your own shell scripts.

  • ham-create-binary-sensor - Lets you create a binary sensor and set its state

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hass_mqtt_devices-0.1.0.tar.gz (9.6 kB view hashes)

Uploaded Source

Built Distribution

hass_mqtt_devices-0.1.0-py3-none-any.whl (11.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page