From c98ac731b40b534efead7f8678c1e73bc990e1cc Mon Sep 17 00:00:00 2001 From: peshovec Date: Sat, 5 Oct 2024 01:04:01 +0300 Subject: [PATCH] [DOCS] RF Gateway receiver mode change, HA integration example to view/change the RF mode (#2072) * Update rf.md * Update home_assistant.md --- docs/integrate/home_assistant.md | 39 ++++++++++++++++++++++++++++++++ docs/use/rf.md | 12 ++++++---- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/docs/integrate/home_assistant.md b/docs/integrate/home_assistant.md index 44058cf008..da89716dea 100644 --- a/docs/integrate/home_assistant.md +++ b/docs/integrate/home_assistant.md @@ -166,6 +166,45 @@ mqtt: qos: "0" retain: true ``` +### RF gateway mode - Pilight, RF, kaku +insert an include statement in HA configuration.yaml +```bash +grep homed ./configuration.yaml +mqtt: !include homed-mqtt.yaml +``` +In the example, the included file is homed-mqtt.yaml. It provides an mqtt select entity with the ability to show and also change via dropdown - the desired mode of the RF receiver gateway. In the homed-mqtt.yaml snippet, the device section (as it is optional) is ommited, +```yaml +select: + - name: 'RF: Mode receive' + unique_id: espdevcho-rf-mode + #platform: mqtt + availability_topic: home/espdevcho/LWT # espdevcho is a particular name of the gateway, instead of the default OpenMQTTGateway + payload_available: online + payload_not_available: offline + options: + - "Pilight" + - "RF classic" + - "RF2 kaku" + state_topic: home/espdevcho/RFtoMQTT # espdevcho is a particular name of the gateway, instead of the default OpenMQTTGateway + value_template: > + {% if value_json.active == 1 %} Pilight + {% elif value_json.active == 2 %} RF classic + {% elif value_json.active == 4 %} RF2 kaku + {% endif %} + #unit_of_measurement: s + command_topic: home/espdevcho/commands/MQTTtoRF/config # espdevcho is a particular name of the gateway, instead of the default OpenMQTTGateway + command_template: > + {% set value_map = { + "Pilight": 1, + "RF classic": 2, + "RF2 kaku": 4, + } + %} + {"active":{{ value_map[value] }}} + device: + configuration_url: http://192.168.1.11/ # device section is optional. It is almost ommited in this example. Values here will update the corresponding device, if it already exist + +``` ### Mijia Thermometer BLE diff --git a/docs/use/rf.md b/docs/use/rf.md index 41990a3906..0923c86204 100644 --- a/docs/use/rf.md +++ b/docs/use/rf.md @@ -39,19 +39,23 @@ Note that with CC1101 this frequency will be used as the default sending frequen Switching of the active transceiver (RTL_433 receiver only) module is available between the RF, RF2, and (RTL_433 or Pilight) gateway modules, allowing for changing of signal decoders without redeploying the OpenMQTTGateway package. Sending a JSON message to the command topic will change the active transceiver module. -To enable the RF gateway module send a json message to the RF gateway module command subject with the key being 'active', and any value. The value at this time is ignored. +To change the RF gateway module, which will receive, send a json message to the RF gateway module command subject (home/OpenMQTTGateway/commands/MQTTtoRF/config) with the corresponding value of the key "active" -1 - PiLight -2 - RF -3 - RTL_433 +1 - PiLight
+2 - RF
+3 - RTL_433
4 - RF2 Example to receive from the RF gateway: `mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoRF/config" -m '{"active":2}'` +Example to receive from the Pilight gateway: +`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoRF/config" -m '{"active":1}'` + The active receiver can also be changed with the WebUI. The OpenMQTTGateway RFtoMQTT status message contains a key `active` which is the current active receiver module. +There is example configuration entry for Homea Assistant in the intergrations doc. ## RTL_433 device decoders