Commit graph

95 commits

Author SHA1 Message Date
Mark Atwood
7ceeccb5ab Change rtl_433_mqtt_hass.py to add supercap_V key 2024-08-12 10:58:52 +02:00
Greg Troxel
aed3b6ff20
examples: Add dup filtering to mqtt_relay ()
Keep information about the previous value sent.  If it's been 5
seconds, or new value is different (ignoring keys like snr and
frequency), then send it.  Otherwise, just don't.  This causes bursts
of e.g. 4 transmissions to result in one MQTT message, on the theory
that the 4 transmissions are not actually 4 messags, but a strategy to
transmit one message more reliably.

Define a new configuration option to enable duplicate filtering, and
default it to True.

Steal logging config from mqtt_filter.py, and add a configuration
option DEBUG that if True results in debug logging instead of info.
2024-08-09 19:03:35 -04:00
Christian W. Zuckschwerdt
5b893f3e10
Add open in browser script () 2024-08-01 19:59:11 +02:00
Greg Troxel
d3975a47c6
examples: Add ability for mqtt_relay to use a config file ()
This commit adds the ability to read config values from
rtl_433_mqtt_relay.yaml (overriding defaults).  This read is skipped
if the yaml module can't be loaded or the config file can't be read,
so those without PyYAML or a config file see no change.

Those with a config file can set parameters for address/port to listen
for json-in-sylog, MQTT credentials, whether to post individual
values, a json dictionary, or both.

While rudimentary, this is a huge functional improvement, allowing
those using TLS and broker passwords (as arguably all should be) to
use the script without modifying it.
2024-07-30 19:26:58 -04:00
Christian W. Zuckschwerdt
1ab32ec511 Add MQTT dedup republish filter example (closes ) 2024-07-30 21:22:29 +02:00
Greg Troxel
ea7e7329b1
examples: Change mqtt_relay to always use id in topic () ()
Previously, this example program appended /channel if present, and if
not present and id was present, appended /id.  Typically channel is
from an A/B/C switch on the device or fixed for kind of device, and id
is from a 16 bit or larger space, sometimes static, and sometimes
random on powerup.  Using only channel is bad if 1) one has more than
one device, or more than 3 if A/B/C or 2) one's neighbor gets such a
device.  Because it is essentially impossible to rule out point 2, id
should always be used.
2024-07-29 13:04:53 -04:00
Greg Troxel
367378fabe
examples: Improve mqtt_relay to make individual and json topics optional ()
Add variables to control publishing individual topics and the json
topic.  Default both to on, so that there is no behavior change.

This eases use now, as one's local diff is cleaner.  It is also on the
path to reading these variables from a config file.
2024-06-23 07:25:23 -04:00
Bruno OCTAU
c187c303fd
Add support for ThermoPro TP829b and Improve rtl_433_mqtt_hass.py ()
* Add support for ThermoPro TP829b and Improve rtl_433_mqtt_hass.py

* Improve DATA_COND with int values instead of float

* Fix Sensor ID, Add Display Unit and Flags and reduce preamble
2024-06-23 13:09:27 +02:00
Greg Troxel
a88bc3b9d4
examples: Remove obsolete sigrok example scripts ()
Per a comment in  these are no longer necessary.
2024-06-21 21:51:15 +02:00
Greg Troxel
432edcdd82
examples: Improve README by describing scripts ()
Expand description of the directory, making it clearer that some
programs have production use.

Declare that python scripts are python3.  It's clear that nobody is
trying to use them with python 2.7, and if they did, we would tell
them not to.

List the scripts with a one-line description, sorting them into
production (none yet), generally usable, and true examples.  Leave
some uncategorized.
2024-06-21 15:35:01 -04:00
Christian W. Zuckschwerdt
7f60fff419 Fix rain_rate_in_h template in HA script () 2024-05-31 11:02:16 +02:00
Ben Winslow
8be3ef1507
Add HA script compat for paho-mqtt 2.0.0 via legacy callback API () 2024-05-02 20:24:58 +02:00
Christian W. Zuckschwerdt
376ca519ff
Change HA script power to energy and UV index to float ()
Closes 
2024-04-26 14:51:44 +02:00
Tucker Kern
9064ccd097
Change a HA script device trigger to avoid duplicate trigger ()
In HA2024.2, device triggers are now identified as `f"{device_id}_{trigger_type}_{trigger_subtype}"`, so each trigger must have a unique type/subtype combination per device.
2024-04-09 12:04:52 +02:00
David M. Zendzian
693cf766b7
Added contact_open reed_open mappings to rtl_433_mqtt_hass.py () 2024-03-26 11:53:57 +01:00
Christian W. Zuckschwerdt
68d7b81dfe minor: Fix unexpected chars in scripts/docs 2024-02-10 14:18:19 +01:00
Christian W. Zuckschwerdt
2122cc2670 Add HTTP cmd API examples 2024-02-01 09:37:03 +01:00
Ian Evans
fe439627fe
Fix rtl_433_mqtt_hass.py rain_in value template () 2024-01-22 22:40:42 +01:00
MDW
7813a6afa5
minor: Fix end of line and end of file whitespaces () 2024-01-04 11:53:24 +01:00
Chris Romp
e1699163e9
Add Ecowitt air quality sensors to rtl_433_mqtt_hass.py () 2024-01-02 17:30:31 +01:00
mailaenderli
8950dc4182
Change rtl_433_mqtt_hass.py to support storm_dist_km from WH31L () 2023-12-05 20:40:53 +01:00
MDW
62783813eb
minor: Fix trailing whitespace as seen in () 2023-11-29 20:57:32 +01:00
Mark Atwood
ca2d9b7bf6 Change rtl_433_mqtt_hass.py to use moisture class ()
Moisture should be "moisture" class, not "humidity" class.
2023-11-28 11:49:36 +01:00
Mark Atwood
6487f1cc06 Change rtl_433_mqtt_hass.py to add battery_mV ()
In addition to battery_ok, many devices also surface the measured battery voltage.
2023-11-28 11:49:30 +01:00
benklop
8535ba24f6
Fix logging message in HA script () 2023-10-27 12:26:51 +02:00
Christian W. Zuckschwerdt
a46004984a minor: typos in php example 2023-10-24 11:20:42 +02:00
Christian W. Zuckschwerdt
abb0bc7bae Add php example stream script (closes )
Co-authored-by: AutomGuy <AutomGuy@users.noreply.github.com>
2023-10-24 10:21:48 +02:00
kcpants
945bc658cb
Add support for discovering Govee water sensors to rtl_433_mqtt_hass () 2023-10-15 08:03:13 -04:00
aquaticus
36f6418436
minor: Remove deprecated newmodel from HA script docs () 2023-09-19 21:31:40 +02:00
chpego
a6fb96c7bb
Improve HA script with current class () 2023-09-19 12:19:16 +02:00
chpego
582af76957
Improve handling of units within HA UI ()
Fix the unit of measurement of illuminance
2023-09-18 14:06:35 +02:00
Luke Milius
70d84d01e1
Improve HA script with detailed units () 2023-08-21 12:41:19 +02:00
Adam Jacques
4f152360b1
Fix HA script allow list id typo () 2023-08-16 09:20:03 +02:00
Kevin Read
9e0fb41e4c
Fix HA script remove device name from entities ()
* Fixes : Remove device name from entity name, use more readable entity names
* Remove changes that slipped in from  https://github.com/merbanan/rtl_433/pull/2593
2023-08-11 14:33:32 +02:00
Kevin Read
ce794d7848
Fix HA script topics () 2023-08-11 13:50:52 +02:00
dforsi
21be644d2e
Fix various spelling ()
Fixed with:
codespell --ignore-words-list=als,ans,ba,bu,fo,hass,hist,hsa,nd,produkt,proove,te,temperatur,toke,tthe,ue --skip=AUTHORS,CHANGELOG.md,mongoose.* --summary --interactive 2 --write-changes
and manual edits.
2023-07-28 10:16:47 +02:00
noahwilliamsson
d20beca213
Add humidity_1, humidity_2 to rtl_433_mqtt_hass ()
This adds support for publishing `humidity_1` and `humidity_2`, similar to how `temperature{,_1,_2}` are handled.  Useful for Acurite 00275RM and Telldus FT0385R.
2023-07-15 00:06:49 +02:00
noahwilliamsson
2cb87ce708
Add timestamp to logs in rtl_433_mqtt_hass ()
Prefix log entries with a timestamp to make it easier to determine when an event happened.
2023-07-15 00:05:29 +02:00
DigiH
37b804c734
Fix HASS script rain_rate_mm_h typo () 2023-07-14 18:15:31 +02:00
Tucker Kern
cb8e89533a
docs: Fix bad URL in rtl_433_mqtt_hass.py ()
Fix duplicate "http://" in URL
2023-07-06 11:26:11 +02:00
Kevin Read
128755c688 Change rtl_433_mqtt_hass to enable passing custom topics (PR ) 2023-03-30 11:19:10 +02:00
stevieg2123
e37fc5dd38
Add ESIC/SCMplus fields to rtl_433_mqtt_hass ()
Adding power meter energy/current/voltage values, as well as consumption from SCMplus meters (water/gas)
2023-01-21 20:43:55 +01:00
Andrew Berry
7ed902ece4
Add links to mqtt device automation docs 2022-10-26 08:53:04 -04:00
Andrew Berry
7323220bc7
Publish secret knocks as device automations 2022-10-26 08:53:04 -04:00
Andrew Berry
c8a36fef8f
Add time, channel, and button device automation triggers 2022-10-26 08:53:04 -04:00
Johannes Wagner
5f76eae6f6
Change rtl_433_mqtt_hass rain value template round to two digits ()
Co-authored-by: Johannes Wagner <johannes.wagner@justadd.ai>
2022-10-21 20:43:32 +02:00
Johannes Wagner
8355088458
Change rtl_433_mqtt_hass value templates round to one digit () 2022-10-20 10:58:40 +02:00
Christian W. Zuckschwerdt
315b98b104 minor: Fix rtl_433_mqtt_hass for events without id 2022-08-22 12:33:28 +02:00
Greg Troxel
9d2e0b7fdc
Merge pull request from gdt/feat-mqtt
examples: Revise comments near the MQTT relay example, and support MQTT authentication
2022-07-28 14:52:00 -04:00
Christian W. Zuckschwerdt
687fe8e438 Add HTTP API example scripts 2022-07-28 18:51:26 +02:00