A Python package for processing RFXtrx data with MQTT support and automation integration.
Project description
RFXtrx-mqtt - Process & Automate RFXtrx Data with MQTT
rfxtrx-mqtt is a Python package that processes and decodes RFXtrx data from a serial device, converting it into JSON. It supports MQTT for seamless integration with home automation platforms like OpenHAB and Home Assistant.
🔧 Features
✅ Decodes RFXtrx data into JSON format
✅ Supports multiple device types (Lighting, Temperature, Humidity, Security, Blinds, etc.)
✅ Command-line interface (rfxtrx CLI)
✅ Flexible callback functions for real-time data processing
✅ Configurable serial device parameters
✅ Built-in MQTT support for automation platforms
📦 Installation
Install via PyPI
pip install -r requirements.txt
Install from GitHub (Development Version)
git clone https://github.com/FredrikBlix/rfxtrx-mqtt.git
cd rfxtrx-mqtt
pip install -r requirements.txt
🚀 Usage
🔹 Running the rfx-dump Command
rfx-dump --help
✅ Example: Read from /dev/ttyUSB0 (default settings)
rfx-dump
✅ Example: Specify device and baud rate
rfx-dump --device /dev/ttyUSB1 --baudrate 115200
✅ Example: Publish RFXtrx data to MQTT
rfx-mqtt --device /dev/ttyUSB0 --mqtt-host localhost --mqtt-port 1883 --mqtt-topic rfxtrx
✅ Example: Subscribe to MQTT topic
rfx-mqtt-sub --mqtt-host localhost --mqtt-topic rfxtrx/#
✅ Example: Manually publish MQTT message
rfx-mqtt-pub --mqtt-host localhost --mqtt-topic rfxtrx --data '{"device_id": "1a41", "unit_code": 1, "command": "On"}'
🏠 Home Automation Integration
Home Assistant
To integrate rfx-mqtt with Home Assistant, configure an MQTT sensor in configuration.yaml:
mqtt:
sensor:
- name: "RFXtrx Lighting Sensor"
state_topic: "rfxtrx/Lighting1"
value_template: "{{ value_json.command }}"
Restart Home Assistant after adding this configuration.
OpenHAB
To integrate rfx-mqtt with OpenHAB, use the MQTT binding and add the following to mqtt.things:
Thing mqtt:topic:rfxtrx "RFXtrx" {
Channels:
Type string : lighting1 "Lighting1 Command" [ stateTopic="rfxtrx/Lighting1" ]
}
Then, define an Item in mqtt.items:
String RFXtrx_Lighting "RFXtrx Light" {channel="mqtt:topic:rfxtrx:lighting1"}
Restart OpenHAB after making these changes.
📜 License
This project is licensed under the MIT License. See the LICENSE file for details.
🤝 Contributing
We welcome contributions! To get started:
- Fork the repository on GitHub
- Clone your forked repo
git clone https://github.com/YOUR_USERNAME/rfx-mqtt.git cd rfx-mqtt
- Create a feature branch
git checkout -b feature-name
- Make your changes, commit, and push
git add . git commit -m "Added new feature" git push origin feature-name
- Submit a pull request! 🎉
🚀 Thank you for using rfx-mqtt! If you find this project useful, give it a ⭐ on GitHub!
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rfxtrx_mqtt-0.0.post1.dev1.tar.gz.
File metadata
- Download URL: rfxtrx_mqtt-0.0.post1.dev1.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
367e7cae34b568fe06a6b667e1d1e791b06fd5ced412948d3ef5eda9897d4a03
|
|
| MD5 |
654070cee5e4640809baf6bfd70e13f5
|
|
| BLAKE2b-256 |
5f91436bc332a02c2b9d72f6a16647cd5434bad5704d71dbec5d29b19693f876
|
Provenance
The following attestation bundles were made for rfxtrx_mqtt-0.0.post1.dev1.tar.gz:
Publisher:
publish-to-pypi.yml on FredrikBlix/rfxtrx-mqtt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rfxtrx_mqtt-0.0.post1.dev1.tar.gz -
Subject digest:
367e7cae34b568fe06a6b667e1d1e791b06fd5ced412948d3ef5eda9897d4a03 - Sigstore transparency entry: 174195267
- Sigstore integration time:
-
Permalink:
FredrikBlix/rfxtrx-mqtt@df15167de8384edf638d14931c55d9d02e05b8ce -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FredrikBlix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@df15167de8384edf638d14931c55d9d02e05b8ce -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file rfxtrx_mqtt-0.0.post1.dev1-py3-none-any.whl.
File metadata
- Download URL: rfxtrx_mqtt-0.0.post1.dev1-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e88bb4a750c2b95d4ac5090de94d7a1f28db2532f779230225847c14aae7f36
|
|
| MD5 |
63853b47fd871d2da4eebe9cb2a0d3d2
|
|
| BLAKE2b-256 |
ae7b2c5a9d7561ac83a744ba8619d1938910bbe460f816d5e2702c05be8de408
|
Provenance
The following attestation bundles were made for rfxtrx_mqtt-0.0.post1.dev1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on FredrikBlix/rfxtrx-mqtt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rfxtrx_mqtt-0.0.post1.dev1-py3-none-any.whl -
Subject digest:
7e88bb4a750c2b95d4ac5090de94d7a1f28db2532f779230225847c14aae7f36 - Sigstore transparency entry: 174195269
- Sigstore integration time:
-
Permalink:
FredrikBlix/rfxtrx-mqtt@df15167de8384edf638d14931c55d9d02e05b8ce -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FredrikBlix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@df15167de8384edf638d14931c55d9d02e05b8ce -
Trigger Event:
workflow_dispatch
-
Statement type: