Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs authored Oct 8, 2023
2 parents d0a0d23 + 7a836e3 commit ef08c90
Show file tree
Hide file tree
Showing 76 changed files with 539 additions and 454 deletions.
47 changes: 21 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ jobs:
echo "RELEASE_NAME=Pre-Release ${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "PRERELEASE=true" >> $GITHUB_ENV
./.deploy/gen_nightly_info.sh
- uses: actions/create-release@v1
- uses: softprops/action-gh-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ env.RELEASE_NAME }}
name: ${{ env.RELEASE_NAME }}
body_path: RELEASEINFO.md
#draft: true
prerelease: ${{ env.PRERELEASE }}
Expand All @@ -86,24 +86,20 @@ jobs:
run: ./do_build.sh
- name: "Sysroot Build with Mingw-w64"
run: ./do_sysroot.sh
- uses: actions/upload-release-asset@v1
- name: "Upload Release Asset"
if: matrix.arch == 'x86-64'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release_job.outputs.upload_url }}
asset_path: rtl_433-win-x64.zip
asset_name: rtl_433-win-x64-${{ needs.release_job.outputs.release_version }}.zip
asset_content_type: application/zip
- uses: actions/upload-release-asset@v1
run: |
mv rtl_433-win-x64.zip rtl_433-win-x64-${{ needs.release_job.outputs.release_version }}.zip
gh release upload ${{ needs.release_job.outputs.release_version }} rtl_433-win-x64-${{ needs.release_job.outputs.release_version }}.zip
- name: "Upload Release Asset"
if: matrix.arch == 'x86-64'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release_job.outputs.upload_url }}
asset_path: rtl_433-win-x32.zip
asset_name: rtl_433-win-x32-${{ needs.release_job.outputs.release_version }}.zip
asset_content_type: application/zip
run: |
mv rtl_433-win-x32.zip rtl_433-win-x32-${{ needs.release_job.outputs.release_version }}.zip
gh release upload ${{ needs.release_job.outputs.release_version }} rtl_433-win-x32-${{ needs.release_job.outputs.release_version }}.zip
build_msvc_job:
needs: [downloads_job, release_job]
Expand Down Expand Up @@ -210,15 +206,17 @@ jobs:
cp rtl_433/.deploy/WINDOWS-MSVC.txt dist/README.txt
ls -al dist
7z a rtl_433-win-msvc-x64.zip ./dist/*
- uses: actions/upload-release-asset@v1
- name: "Upload Release Asset"
if: matrix.os == 'windows-2019' && matrix.platform == 'x64'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release_job.outputs.upload_url }}
asset_path: ${{ runner.workspace }}/rtl_433-win-msvc-x64.zip
asset_name: rtl_433-win-msvc-x64-${{ needs.release_job.outputs.release_version }}.zip
asset_content_type: application/zip
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
shell: bash
working-directory: ${{ runner.workspace }}
run: |
mv rtl_433-win-msvc-x64.zip rtl_433-win-msvc-x64-${{ needs.release_job.outputs.release_version }}.zip
gh release upload ${{ needs.release_job.outputs.release_version }} rtl_433-win-msvc-x64-${{ needs.release_job.outputs.release_version }}.zip
build_linux_job:
strategy:
Expand Down Expand Up @@ -346,11 +344,8 @@ jobs:
--url https://triq.org/
ls -al
ls -al "${PWD}/dist"
- uses: actions/upload-release-asset@v1
- name: "Upload Release Asset"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release_job.outputs.upload_url }}
asset_path: rtl433_${{ needs.release_job.outputs.release_version }}-1${{ matrix.distro }}_${{ matrix.arch }}.deb
asset_name: rtl433_${{ needs.release_job.outputs.release_version }}-1${{ matrix.distro }}_${{ matrix.arch }}.deb
asset_content_type: application/vnd.debian.binary-package
run: |
gh release upload ${{ needs.release_job.outputs.release_version }} rtl433_${{ needs.release_job.outputs.release_version }}-1${{ matrix.distro }}_${{ matrix.arch }}.deb
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ See [CONTRIBUTING.md](./docs/CONTRIBUTING.md).

```
A "rtl_433.conf" file is searched in "./", XDG_CONFIG_HOME e.g. "$HOME/.config/rtl_433/",
"/usr/local/etc/rtl_433/", "/etc/rtl_433/", then command line args will be parsed in order.
= General options =
[-V] Output the version string and exit
[-v] Increase verbosity (can be used multiple times).
Expand Down Expand Up @@ -283,7 +285,7 @@ See [CONTRIBUTING.md](./docs/CONTRIBUTING.md).
[197] Acurite Grill/Meat Thermometer 01185M
[198]* EnOcean ERP1
[199] Linear Megacode Garage/Gate Remotes
[200]* Auriol 4-LD5661 temperature/rain sensor
[200]* Auriol 4-LD5661/4-LD5972/4-LD6313 temperature/rain sensors
[201] Unbranded SolarTPMS for trucks
[202] Funkbus / Instafunk (Berker, Gira, Jung)
[203] Porsche Boxster/Cayman TPMS
Expand Down
2 changes: 1 addition & 1 deletion conf/HeatmiserPRT-W.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# The thermostats all transmit on or around 869.01Mhz

# I run the conf file from the command line with:
#rtl_433 -Y classic -R 0 -c /home/russ/.config/rtl_433/HeatmiserPRT-W.conf -f 869.01Mhz -M newmodel
#rtl_433 -Y classic -R 0 -c /home/russ/.config/rtl_433/HeatmiserPRT-W.conf -f 869.01M

# You will need to change the prettified channel codes to match your thermostat's output.

Expand Down
2 changes: 1 addition & 1 deletion conf/SalusRT300RF.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# listen on 868.286Mhz
# rtl_433 -Y classic -R 0 -X "name=SalusRT300RF, m=FSK_PCM, s=833, l=833, r=16000, preamble={24}0xaaaaaa,get=@0:{16}:Thermostat ID, get=@28:{4}:heat:[1:ON 2:OFF]" -f 868.286Mhz -F "mqtt://192.168.1.150,retain=1,devices=sensors/rtl_433/P[protocol]/C[channel]"
# Run with:
#rtl_433 -Y classic -R 0 -c /home/russ/.config/rtl_433/SalusRT300RF.conf -f 868.286Mhz -M newmodel
#rtl_433 -Y classic -R 0 -c /home/russ/.config/rtl_433/SalusRT300RF.conf -f 868.286M

# Report iso time:
report_meta time:iso
Expand Down
2 changes: 1 addition & 1 deletion conf/rtl_433.example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ stop_after_successful_events false
protocol 197 # Acurite Grill/Meat Thermometer 01185M
# protocol 198 # EnOcean ERP1
protocol 199 # Linear Megacode Garage/Gate Remotes
# protocol 200 # Auriol 4-LD5661 temperature/rain sensor
# protocol 200 # Auriol 4-LD5661/4-LD5972/4-LD6313 temperature/rain sensors
protocol 201 # Unbranded SolarTPMS for trucks
protocol 202 # Funkbus / Instafunk (Berker, Gira, Jung)
protocol 203 # Porsche Boxster/Cayman TPMS
Expand Down
3 changes: 3 additions & 0 deletions docs/LINKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@

- [rtl_snr](https://github.com/hdtodd/rtl_snr):
snr is a pair of equivalent C and Python programs that catalog and analyze signal-to-noise ratios from devices seen by RTL_SDR dongles and logged in JSON format by rtl_433.

- [rtl_sdr driver](https://f-droid.org/en/packages/marto.rtl_tcp_andro/):
rtl_sdr driver is a port of rtl_tcp to Android. See also the [source code](https://github.com/signalwareltd/rtl_tcp_andro-).
42 changes: 29 additions & 13 deletions examples/rtl_433_mqtt_hass.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""

AP_EPILOG="""
It is strongly recommended to run rtl_433 with "-C si" and "-M newmodel".
It is strongly recommended to run rtl_433 with "-C si".
This script requires rtl_433 to publish both event messages and device
messages. If you've changed the device topic in rtl_433, use the same device
topic with the "-T" parameter.
Expand Down Expand Up @@ -264,6 +264,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ value|float }}",
Expand All @@ -275,6 +276,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ value|float }}",
Expand All @@ -286,6 +288,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Speed",
"unit_of_measurement": "mi/h",
"value_template": "{{ value|float }}",
Expand All @@ -297,6 +300,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Average",
"unit_of_measurement": "km/h",
"value_template": "{{ (float(value|float) * 3.6) | round(2) }}",
Expand All @@ -308,6 +312,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ float(value|float) * 3.6 }}",
Expand All @@ -319,6 +324,7 @@
"device_type": "sensor",
"object_suffix": "GS",
"config": {
"device_class": "wind_speed",
"name": "Gust Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ value|float }}",
Expand All @@ -330,6 +336,7 @@
"device_type": "sensor",
"object_suffix": "GS",
"config": {
"device_class": "wind_speed",
"name": "Wind max speed",
"unit_of_measurement": "km/h",
"value_template": "{{ value|float }}",
Expand All @@ -341,6 +348,7 @@
"device_type": "sensor",
"object_suffix": "GS",
"config": {
"device_class": "wind_speed",
"name": "Wind max",
"unit_of_measurement": "km/h",
"value_template": "{{ (float(value|float) * 3.6) | round(2) }}",
Expand All @@ -352,6 +360,7 @@
"device_type": "sensor",
"object_suffix": "GS",
"config": {
"device_class": "wind_speed",
"name": "Gust Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ float(value|float) * 3.6 }}",
Expand All @@ -374,6 +383,7 @@
"device_type": "sensor",
"object_suffix": "RT",
"config": {
"device_class": "precipitation",
"name": "Rain Total",
"unit_of_measurement": "mm",
"value_template": "{{ value|float|round(2) }}",
Expand All @@ -385,6 +395,7 @@
"device_type": "sensor",
"object_suffix": "RR",
"config": {
"device_class": "precipitation_intensity",
"name": "Rain Rate",
"unit_of_measurement": "mm/h",
"value_template": "{{ value|float }}",
Expand All @@ -396,6 +407,7 @@
"device_type": "sensor",
"object_suffix": "RT",
"config": {
"device_class": "precipitation",
"name": "Rain Total",
"unit_of_measurement": "mm",
"value_template": "{{ (float(value|float) * 25.4) | round(2) }}",
Expand All @@ -407,6 +419,7 @@
"device_type": "sensor",
"object_suffix": "RR",
"config": {
"device_class": "precipitation_intensity",
"name": "Rain Rate",
"unit_of_measurement": "mm/h",
"value_template": "{{ (float(value|float) * 25.4) | round(2) }}",
Expand Down Expand Up @@ -513,7 +526,7 @@
"device_type": "sensor",
"object_suffix": "A",
"config": {
"device_class": "power",
"device_class": "current",
"name": "Current",
"unit_of_measurement": "A",
"value_template": "{{ value|float }}",
Expand All @@ -537,8 +550,9 @@
"device_type": "sensor",
"object_suffix": "lux",
"config": {
"device_class": "illuminance",
"name": "Outside Luminance",
"unit_of_measurement": "lux",
"unit_of_measurement": "lx",
"value_template": "{{ value|int }}",
"state_class": "measurement"
}
Expand All @@ -547,8 +561,9 @@
"device_type": "sensor",
"object_suffix": "lux",
"config": {
"device_class": "illuminance",
"name": "Outside Luminance",
"unit_of_measurement": "lux",
"unit_of_measurement": "lx",
"value_template": "{{ value|int }}",
"state_class": "measurement"
}
Expand Down Expand Up @@ -720,7 +735,7 @@ def sanitize(text):
.replace(".", "_")
.replace("&", ""))

def rtl_433_device_info(data):
def rtl_433_device_info(data, topic_prefix):
"""Return rtl_433 device topic to subscribe to for a data element, based on the
rtl_433 device topic argument, as well as the device identifier"""

Expand All @@ -745,10 +760,10 @@ def rtl_433_device_info(data):

path = ''.join(list(filter(lambda item: item, path_elements)))
id = '-'.join(id_elements)
return (path, id)
return (f"{topic_prefix}/{path}", id)


def publish_config(mqttc, topic, model, object_id, mapping, value=None):
def publish_config(mqttc, topic, model, object_id, mapping, key=None):
"""Publish Home Assistant auto discovery data."""
global discovery_timeouts

Expand Down Expand Up @@ -776,9 +791,10 @@ def publish_config(mqttc, topic, model, object_id, mapping, value=None):
config["topic"] = topic
config["platform"] = 'mqtt'
else:
readable_name = mapping["config"]["name"] if "name" in mapping["config"] else key
config["state_topic"] = topic
config["unique_id"] = object_name
config["name"] = object_name
config["name"] = readable_name
config["device"] = { "identifiers": [object_id], "name": object_id, "model": model, "manufacturer": "rtl_433" }

if args.force_update:
Expand All @@ -793,7 +809,7 @@ def publish_config(mqttc, topic, model, object_id, mapping, value=None):

return True

def bridge_event_to_hass(mqttc, topicprefix, data):
def bridge_event_to_hass(mqttc, topic_prefix, data):
"""Translate some rtl_433 sensor data to Home Assistant auto discovery."""

if "model" not in data:
Expand All @@ -806,13 +822,13 @@ def bridge_event_to_hass(mqttc, topicprefix, data):
skipped_keys = []
published_keys = []

base_topic, device_id = rtl_433_device_info(data)
base_topic, device_id = rtl_433_device_info(data, topic_prefix)
if not device_id:
# no unique device identifier
logging.warning("No suitable identifier found for model: ", model)
return

if args.ids and id in data and data.get("id") not in args.ids:
if args.ids and "id" in data and data.get("id") not in args.ids:
# not in the safe list
logging.debug("Device (%s) is not in the desired list of device ids: [%s]" % (data["id"], ids))
return
Expand All @@ -822,7 +838,7 @@ def bridge_event_to_hass(mqttc, topicprefix, data):
if key in mappings:
# topic = "/".join([topicprefix,"devices",model,instance,key])
topic = "/".join([base_topic, key])
if publish_config(mqttc, topic, model, device_id, mappings[key]):
if publish_config(mqttc, topic, model, device_id, mappings[key], key):
published_keys.append(key)
else:
if key not in SKIP_KEYS:
Expand All @@ -831,7 +847,7 @@ def bridge_event_to_hass(mqttc, topicprefix, data):
if "secret_knock" in data.keys():
for m in secret_knock_mappings:
topic = "/".join([base_topic, "secret_knock"])
if publish_config(mqttc, topic, model, device_id, m):
if publish_config(mqttc, topic, model, device_id, m, "secret_knock"):
published_keys.append("secret_knock")

if published_keys:
Expand Down
8 changes: 4 additions & 4 deletions include/term_ctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ int term_printf(void *ctx, _Printf_format_string_ const char *format, ...)
* "quoted"
* 'quoted'
*/
int term_help_printf(_Printf_format_string_ char const *format, ...)
int term_help_fprintf(FILE *fp, _Printf_format_string_ char const *format, ...)
#if defined(__GNUC__) || defined(__clang__)
__attribute__((format(printf, 1, 2)))
__attribute__((format(printf, 2, 3)))
#endif
;

Expand All @@ -108,10 +108,10 @@ int term_help_printf(_Printf_format_string_ char const *format, ...)
int term_puts(void *ctx, const char *buf);

/**
* Like 'term_help_printf()', but no var-arg format.
* Like 'term_help_fprintf()', but no var-arg format.
* Simply takes a 0-terminated buffer.
*/
int term_help_puts(void *ctx, const char *buf);
int term_help_fputs(void *ctx, const char *buf, FILE *fp);

/**
* Change the default color map.
Expand Down
4 changes: 4 additions & 0 deletions man/man1/rtl_433.1
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ PlutoSDR, HackRF One (using SoapySDR drivers), as well as SoapyRemote.
A summary of options is included below.
Detailed information on some options follows.
.\" body


A "rtl_433.conf" file is searched in "./", XDG_CONFIG_HOME e.g. "$HOME/.config/rtl_433/",
"/usr/local/etc/rtl_433/", "/etc/rtl_433/", then command line args will be parsed in order.
.SS "General options"
.TP
[ \fB\-V\fI\fP ]
Expand Down
Loading

0 comments on commit ef08c90

Please sign in to comment.