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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for hass_mqtt_devices-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b98c07ec2d4c6996e56556680752a55d0f52cf230faa8b71dc5b9cf74ad73f2a |
|
MD5 | 7734a679c83e45e1551e9eb8c55bb999 |
|
BLAKE2b-256 | c88837eaf23d90a59904aafffd7713524cc238e98f7612aa38536b783caaa08a |