Fabian Peter Hammerle a93f94de3b pylint: enable various optional checks/extensions | 2 роки тому | |
---|---|---|
intertechno_cc1101_mqtt | 3 роки тому | |
tests | 3 роки тому | |
.dockerignore | 3 роки тому | |
.gitignore | 3 роки тому | |
.pylintrc | 2 роки тому | |
CHANGELOG.md | 3 роки тому | |
Dockerfile | 3 роки тому | |
Makefile | 3 роки тому | |
Pipfile | 3 роки тому | |
Pipfile.lock | 2 роки тому | |
README.md | 3 роки тому | |
docker-compose.yml | 3 роки тому | |
mypy.ini | 3 роки тому | |
setup.py | 3 роки тому |
MQTT client controlling Intertechno Outlets via a CC1101 Transceiver
Compatible with Home Assistant's MQTT Switch platform.
$ pip3 install --user --upgrade git+https://git.hammerle.me/fphammerle/intertechno-cc1101-mqtt
On Raspbian / Raspberry Pi OS, dependencies can optionally be installed via:
$ sudo apt-get install --no-install-recommends python3-spidev python3-paho-mqtt
$ intertechno-cc1101-mqtt --mqtt-host HOSTNAME_OR_IP_ADDRESS
Send ON
or OFF
to topic intertechno-cc1101/[ADDRESS]/[BUTTON_INDEX]/set
.
$ mosquitto_pub -h MQTT_BROKER -t intertechno-cc1101/12345678/0/set -m ON
⚠️ Support for TLS is not implemented yet. Do not connect to brokers via unprotected networks (e.g., internet, wifi network).
$ intertechno-cc1101-mqtt --mqtt-host HOSTNAME_OR_IP_ADDRESS --alias-file aliases.json
with aliases.json
:
{"some-name": {"address": 12345678, "button-index": 0},
"another-name": {"address": 12345678, "button-index": 1},
"another_address": {"address": 21420815, "button-index": 0}}
Send ON
or OFF
to topic intertechno-cc1101/[ALIAS]/set
.
$ mosquitto_pub -h MQTT_BROKER -t intertechno-cc1101/some-name/set -m ON
Home Assistant will detect devices specified in --alias-file aliases.json
automatically, if connected to the same MQTT broker
and MQTT discovery is enabled
(enabled by default since version 0.117.0).
# https://www.home-assistant.io/docs/mqtt/broker/#configuration-variables
mqtt:
broker: BROKER_HOSTNAME_OR_IP_ADDRESS
# credentials, additional options…
# https://www.home-assistant.io/integrations/switch.mqtt/#configuration-variables
switch:
- platform: mqtt
name: intertechno_smart_outlet
command_topic: intertechno-cc1101/12345678/0/set
# http://materialdesignicons.com/
icon: mdi:light-switch
$ sudo docker build -t intertechno-cc1101-mqtt .
$ sudo docker run --name intertechno_cc1101_mqtt \
--read-only --cap-drop ALL --security-opt no-new-privileges \
--device /dev/spidev0.0 intertechno-cc1101-mqtt \
intertechno-cc1101-mqtt --mqtt-host HOSTNAME_OR_IP_ADDRESS …
command
in docker-compose.yml
.sudo docker-compose up --build