### Preview Documentation Site Locally Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/participate/quick_start.md Starts a local HTTPS server to preview the documentation website. This is useful for seeing changes in real-time before deploying. ```bash ./scripts/ci.sh site --mode dev --url-prefix /dev/ --version edge --preview ``` -------------------------------- ### MQTT Publishing Patterns Source: https://github.com/1technophile/openmqttgateway/blob/development/CLAUDE.md Provides examples of MQTT publishing functions. It shows a basic publish function and a more advanced one allowing custom topics and retain flags. ```cpp pub(subjectToMQTT, data); // Basic publish pub_custom_topic(topic, data, retain); // Custom topic with retain ``` -------------------------------- ### LEDManager API: Initialization and Setup (Arduino C++) Source: https://github.com/1technophile/openmqttgateway/blob/development/lib/LEDManager/README.md This snippet details the initialization functions for the LEDManager library. It shows how to create an LEDManager instance and add LED strips, specifying the pin and the number of LEDs for each strip. ```cpp LEDManager ledManager; ledManager.addLEDStrip(int pin, int numLeds); ``` -------------------------------- ### Install Node Dependencies for Docs Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/participate/quick_start.md Installs all necessary Node.js modules required for building and developing the documentation website. This step is crucial for local documentation work. ```bash cd OpenMQTTGateway npm install ``` -------------------------------- ### Run Documentation Development Server Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/participate/quick_start.md Starts VuePress in development mode, enabling hot reloading for documentation files. Changes to markdown files are reflected instantly in the browser. ```bash npm run docs:dev ``` -------------------------------- ### Initialize and Control LEDs with LEDManager (Arduino C++) Source: https://github.com/1technophile/openmqttgateway/blob/development/lib/LEDManager/README.md A basic Arduino C++ example demonstrating the initialization and usage of the LEDManager library. It shows how to add LED strips (both addressable and non-addressable), set global brightness, and control individual LEDs with different modes like STATIC and BLINK. ```cpp #include "LEDManager.h" LEDManager ledManager; void setup() { #ifdef LED_ADDRESSABLE ledManager.addLEDStrip(5, 30); // Add addressable LED strip on pin 5 with 30 LEDs #else ledManager.addLEDStrip(5, 1); // Add non-addressable LED on pin 5 ledManager.addLEDStrip(6, 1); // Add non-addressable LED on pin 6 #endif ledManager.setBrightness(128); // Set global brightness to 50% } void loop() { #ifdef LED_ADDRESSABLE // Set all LEDs on the first strip to static green ledManager.setMode(0, -1, LEDManager::STATIC, LED_COLOR_GREEN); // Blink first 5 LEDs red for 3 times on the first strip for (int i = 0; i < 5; i++) { ledManager.setMode(0, i, LEDManager::BLINK, LED_COLOR_RED, 3); } #else // Set first LED to static green ledManager.setMode(0, 0, LEDManager::STATIC, LED_COLOR_GREEN); // Blink second strip LED red ledManager.setMode(1, 0, LEDManager::BLINK, LED_COLOR_RED, 3); #endif ledManager.update(); delay(100); } ``` -------------------------------- ### Include MQTT Configuration in Home Assistant Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/integrate/home_assistant.md This bash command demonstrates how to include an external MQTT configuration file into your Home Assistant's configuration.yaml. By using the `!include` directive, you can keep your main configuration file clean and organized, separating different MQTT setups into dedicated files. ```bash grep homed ./configuration.yaml mqtt: !include homed-mqtt.yaml ``` -------------------------------- ### Send Advanced IR Parameters via MQTT Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/use/ir.md This example demonstrates sending IR signals with advanced parameters such as bit length and repeat count using the mosquitto_pub command. It's useful for protocols like NEC where specific configurations are needed. ```bash mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"value":551489775,"protocol_name":"NEC","repeat":4,"bits":14}' ``` -------------------------------- ### Home Assistant MQTT Auto-Discovery and Manual Configuration Source: https://context7.com/1technophile/openmqttgateway/llms.txt Examples of configuring various sensors and switches in Home Assistant using MQTT auto-discovery or manual YAML configuration. This enables seamless integration of devices monitored or controlled by OpenMQTTGateway. ```yaml mqtt: binary_sensor: - unique_id: pir_living_room name: "Living Room Motion" device_class: motion state_topic: "home/+/433toMQTT/15484294" value_template: "{{ value_json.value }}" payload_on: "15484294" off_delay: 30 ``` ```yaml mqtt: binary_sensor: - name: "Front Door" state_topic: "home/OpenMQTTGateway/433toMQTT" value_template: >- {% if value_json.value == '7821834' %} {{'ON'}} {% elif value_json.value == '7821838' %} {{'OFF'}} {% else %} {{states('binary_sensor.front_door') | upper}} {% endif %} device_class: opening ``` ```yaml mqtt: sensor: - name: "Bedroom Temperature" state_topic: "home/OpenMQTTGateway/BTtoMQTT/A4C138XXXXXX" unit_of_measurement: "°C" value_template: "{{ value_json.tempc | is_defined }}" expire_after: 21600 force_update: true - name: "Bedroom Humidity" state_topic: "home/OpenMQTTGateway/BTtoMQTT/A4C138XXXXXX" unit_of_measurement: "%" value_template: "{{ value_json.hum | is_defined }}" expire_after: 21600 ``` ```yaml mqtt: switch: - name: "RF Outlet" state_topic: "home/OpenMQTTGateway/SRFBtoMQTT" command_topic: "home/OpenMQTTGateway/commands/MQTTtoSRFB" value_template: "{{ value_json.value }}" payload_on: '{"value":4546575}' payload_off: '{"value":4546572}' state_on: 4546575 state_off: 4546572 retain: true ``` ```yaml sensor: - platform: mqtt_room device_id: "AA:BB:CC:DD:EE:FF" name: "Person Location" state_topic: "home/presence" ``` -------------------------------- ### Check Git Installation Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/participate/quick_start.md Verifies if Git is installed and accessible in the terminal. This is a common tool required for all types of work within the project. ```bash git --version ``` -------------------------------- ### Clean npm Cache Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/participate/quick_start.md Clears the npm cache to resolve potential installation issues or slow downloads. This is a troubleshooting step for npm install failures. ```bash npm cache clean --force ``` -------------------------------- ### Inherit and Extend Environment Configurations Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/upload/builds.md Demonstrates how to create a specific environment that inherits settings from the base environment while adding unique dependencies and custom build flags. ```ini [com-esp] lib_deps = ${env.lib_deps} ${libraries.wifimanager} build_flags = ${env.build_flags} '-DsimpleReceiving=true' '-DZmqttDiscovery="HADiscovery"' ``` -------------------------------- ### Sensor MQTT Data Payloads Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/use/sensors.md Examples of JSON payloads published by various sensors to their respective MQTT topics. ```json home/OpenMQTTGateway/ADCtoMQTT {"value":543} home/OpenMQTTGateway/DHTtoMQTT {"tempc":21,"tempf":69.8,"hum":51} home/OpenMQTTGateway/CLIMAtoMQTT/htu {"tempc":25.34064,"tempf":77.61314,"hum":56.53052} home/OpenMQTTGateway/CLIMAtoMQTT/aht { "tempc": 27.48108, "tempf": 81.46594, "hum": 48.90614 } home/OpenMQTTGateway/CLIMAtoMQTT/ds1820/0x0000000000000000 {"tempc":27.8, "tempf":82.04, "type":"DS18B20","res":"12bit\n","addr":"0x28616411907650bc"} home/OpenMQTTGateway/HCSR501toMQTT {"presence":"false"} home/OpenMQTTGateway/RN8209toMQTT {"volt":120.34,"current":7.92,"power":954.61} home/OpenMQTTGateway/touchToMQTT {"id":0,"on":1,"value":10} ``` -------------------------------- ### Prepare Firmware and Library Artifacts Source: https://github.com/1technophile/openmqttgateway/blob/development/scripts/CI_SCRIPTS.md Packages firmware binaries and libraries from PlatformIO builds. Can optionally create a source archive if no environment is specified. Allows specifying an output directory, versioning, and cleaning the output. Lists final artifacts and their sizes. ```bash ./scripts_ci_prepare_artifacts.sh [--output ] [--version ] [--clean] [--help] ./scripts_ci_prepare_artifacts.sh [--output ] [--version ] [--clean] [--help] ``` -------------------------------- ### Receiving IR Signals Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/use/ir.md Subscribe to MQTT topics to receive decoded IR signals. Examples show raw and hexadecimal data formats. ```APIDOC ## Receiving IR Signals ### Description Subscribe to all messages with mosquitto or your MQTT client to receive decoded IR signals from devices. ### Method SUBSCRIBE ### Endpoint home/OpenMQTTGateway/IRtoMQTT ### Parameters None ### Request Example ```json home/OpenMQTTGateway/IRtoMQTT { "value": 875849879, "protocol": 7, "protocol_name": "SAMSUNG", "bits": 32, "raw": "4534,4432,612,518,614,516,616,1618,618,1616,618,512,618,1618,608,524,612,518,616,514,618,512,616,1618,616,1618,618,514,616,1618,616,514,616,514,618,512,616,1618,618,1618,618,514,610,1622,616,514,618,514,614,516,616,1618,618,512,618,512,618,1616,550,580,618,1616,612,1624,618,1616,618" } ``` ### Response #### Success Response (200) - **value** (integer) - The decoded IR signal value. - **protocol** (integer) - The protocol number. - **protocol_name** (string) - The name of the IR protocol. - **bits** (integer) - The number of bits in the signal. - **raw** (string) - The raw IR signal data. #### Response Example ```json { "value": 9938405643, "protocol": 55, "bits": 35, "hex": "0x25060090B", "protocol_name": "TECO" } ``` ### Notes - Unknown protocols are filtered by default. To see them, uncomment `#define pubIRunknownPrtcl true` in `config_IR.h`. - To receive large dumps of raw data, uncomment `DumpMode true` in `config_IR.h`. ``` -------------------------------- ### Run Quality Assurance Checks Source: https://github.com/1technophile/openmqttgateway/blob/development/scripts/CI_SCRIPTS.md Executes code formatting checks using clang-format and linting via shellcheck. Requires clang-format and shellcheck to be installed on the system. ```bash ./scripts/ci.sh qa --check --clang-format-version 11 ``` -------------------------------- ### List Available PlatformIO Environments Source: https://github.com/1technophile/openmqttgateway/blob/development/scripts/CI_SCRIPTS.md Lists the PlatformIO environments available for building firmware. It can provide a curated list by default or an exhaustive list by parsing configuration files when the --full option is used. Requires 'jq' for default operation. ```bash ./scripts/ci.sh list-env ./scripts/ci.sh list-env --full ``` -------------------------------- ### Run Full CI Pipeline Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/participate/quick_start.md Executes QA checks, builds firmware, and generates the documentation site in production mode. This command mimics the Continuous Integration process for a comprehensive project check. ```bash ./scripts/ci.sh all esp32dev-all-test --mode prod ``` -------------------------------- ### Define OpenHAB Items for MQTT Sensors Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/integrate/openhab2.md Example configuration for defining OpenHAB items in an .items file to map MQTT channels for Mi Jia and Mi Flora sensors. ```java // MI JIA Number humidity "Humidité air[%.1f %%]" {channel="mqtt:topic:dc2222e6:humidite-mijia"} Number temperature "Température[%.1f °C]" {channel="mqtt:topic:dc2222e6:temperature-mijia"} Number battery "Batterie capteur[%.1f %]" {channel="mqtt:topic:dc2222e6:batterie-mijia"} // MI FLORA Number humidity_P "Hygrométrie plante[%.1f %%]" {channel="mqtt:topic:1fb33334:humidite-miflora"} Number temperature_P "Température plante[%.1f °C]" {channel="mqtt:topic:1fb33334:temperature-miflora"} Number fertility_P "Fertilité plante[%.1f uS/cm]" {channel="mqtt:topic:1fb33334:fertilite-miflora"} Number lux_P "Luminiosité plante[%.1f lux]" {channel="mqtt:topic:1fb33334:lux-miflora"} ``` -------------------------------- ### Build Documentation Site with npm Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/participate/quick_start.md Performs a production build of the documentation website using npm. This generates the static files for deployment. ```bash npm run docs:build ``` -------------------------------- ### Build Documentation Site Locally Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/participate/quick_start.md Builds the documentation website locally using the ci.sh script. It supports various options for customization, including build mode, URL prefix, versioning, and previewing. ```bash ./scripts/ci.sh site --mode prod --url-prefix / --version 1.8.0 ``` -------------------------------- ### Enable Home Assistant Presence Publishing (MQTT) Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/use/ble.md This command enables the gateway to publish presence information to a Home Assistant MQTT topic. This allows for presence tracking within Home Assistant. ```bash mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoBT/config -m '{"hasspresence":true}' ``` -------------------------------- ### Receive and Parse Hexadecimal LoRa Data Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/use/lora.md This JSON example demonstrates how the LoRa gateway represents messages containing non-printable characters. The data is converted to hexadecimal format, indicated by the 'hex' field. This is useful for debugging or handling raw, unformatted LoRa transmissions. ```json {"rssi":-121,"snr":-11.75,"pferror":-29116,"packetSize":3,"hex":"C0FFEE"} ``` -------------------------------- ### Send Raw IR Data via MQTT Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/use/ir.md This snippet shows how to publish raw IR signal data via MQTT. It includes an example payload and discusses potential issues with large payloads, suggesting configuration changes to increase the MQTT message buffer size if necessary. ```bash mosquitto_pub -t home/OpenMQTTGateway/commands/MQTTtoIR -m '{"raw":"8850,4450,600,550,550,550,600,1600,600,550,600,500,600,500,600,550,600,500,600,1650,600,1600,600,550,600,1600,600,1650,600,1600,600,1650,600,1600,600,550,600,500,600,550,550,1650,600,500,600,550,600,500,600,550,550,1650,600,1650,550,1650,600,550,550,1650,600,1650,550,1650,600,1650,600","protocol_name":"Raw"}' ``` -------------------------------- ### Enable Home Assistant MQTT Discovery (C++) Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/upload/builds.md This configuration snippet shows the necessary C++ defines to enable Home Assistant MQTT discovery with OpenMQTTGateway. It requires `jsonPublishing` to be true and `ZmqttDiscovery` to be set to 'HADiscovery'. Additionally, the auto-discovery option must be selected within your Home Assistant MQTT integration settings. ```cpp #define jsonPublishing true #define ZmqttDiscovery "HADiscovery" ``` -------------------------------- ### Home Assistant MQTT Sensor Configuration for RTL_433 Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/integrate/home_assistant.md This YAML configuration snippet demonstrates how to set up MQTT sensors in Home Assistant for devices discovered by the RTL_433 gateway. It shows how to use wildcard topics for broader discovery and specific topics to filter by device model, subtype, and channel, ensuring robust device tracking even after battery changes. ```yaml mqtt: sensor: - state_topic: "+/+/RTL_433toMQTT/WS2032/+" - state_topic: "+/+/RTL_433toMQTT/Prologue-TH/9/1/+" ``` -------------------------------- ### Subscribe to Serial Gateway MQTT Topics Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/use/serial.md Demonstrates how to monitor all incoming messages from the Serial gateway by subscribing to the MQTT topic hierarchy. ```bash mosquitto_sub -t +/# -v ``` -------------------------------- ### Home Assistant MQTT Device Trigger and Sensor for RF Signals Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/integrate/home_assistant.md This configuration illustrates how to set up Home Assistant to handle RF signals received by the RCSwitch-based gateway. It includes examples for creating an MQTT Device Trigger to initiate actions upon receiving specific RF signals and an MQTT Sensor to log the received RF data as a sensor value. ```yaml mqtt: device_trigger: # Example configuration for MQTT Device Trigger sensor: # Example configuration for MQTT Sensor ``` -------------------------------- ### PlatformIO Build and Upload Commands Source: https://github.com/1technophile/openmqttgateway/blob/development/CLAUDE.md Common PlatformIO commands for building, listing targets, uploading code to a device, and monitoring the serial output. ```bash # List all environments pio run --list-targets # Build specific environment pio run -e esp32dev-ble # Upload to device pio run -e esp32dev-ble -t upload # Monitor serial pio device monitor ``` -------------------------------- ### Execute CI/CD Commands via ci.sh Source: https://github.com/1technophile/openmqttgateway/blob/development/scripts/CI_SCRIPTS.md The ci.sh script acts as the primary entry point for all automation tasks. It supports commands for building firmware, generating documentation, running quality assurance, and performing security scans. ```bash ./scripts/ci.sh build esp32dev-bt --version v1.8.0 --deploy-ready --output generated/artifacts ./scripts/ci.sh site --mode prod --url-prefix / ./scripts/ci.sh qa --fix --verbose ./scripts/ci.sh security --scan-type fs --generate-sbom ``` -------------------------------- ### Configure Door Sensor for Home Assistant Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/integrate/home_assistant.md This YAML configuration sets up a door sensor in Home Assistant using MQTT. It defines a binary sensor that monitors door states (open/closed) and publishes them to a specified topic. The configuration includes a state topic, a value template to parse the JSON payload, and a device class for 'opening'. An optional 'off_delay' can be set. ```yaml mqtt: binary_sensor: - name: "test" state_topic: "home/OpenMQTTGateway/433toMQTT" value_template: >- {% if value_json.value == '7821834' %} {{'ON'}} {% elif value_json.value == '7821838' %} {{'OFF'}} {% else %} {{states('binary_sensor.test') | upper}} {% endif %} qos: 0 device_class: opening ``` ```yaml mqtt: binary_sensor: - name: doorbell state_topic: 'home/OpenMQTTGateway/SRFBtoMQTT' value_template: >- {% if value_json.value == '14163857' %} {{'ON'}} {% else %} {{states('binary_sensor.doorbell') | upper}} {% endif %} off_delay: 30 device_class: 'sound' - name: light_back_sensor state_topic: 'home/OpenMQTTGateway/SRFBtoMQTT' value_template: >- {% if value_json.value == '1213858' %} {{'ON'}} {% else %} {{states('binary_sensor.light_back_sensor') | upper}} {% endif %} off_delay: 5 - name: rf_outlet_sensor state_topic: 'home/OpenMQTTGateway/SRFBtoMQTT' value_template: >- {% if value_json.value == '16766303' %} {{'ON'}} {% else %} {{states('binary_sensor.rf_outlet_sensor') | upper}} {% endif %} ``` -------------------------------- ### Generate Board Documentation from PlatformIO Source: https://github.com/1technophile/openmqttgateway/blob/development/scripts/CI_SCRIPTS.md A legacy Python script that parses platformio.ini and environments.ini files to auto-generate markdown documentation pages for specific hardware boards. ```python python3 ./scripts/generate_board_docs.py ``` -------------------------------- ### List Enabled Pilight Protocols via MQTT Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/use/rf.md Send a JSON command to request a list of currently enabled protocols on the serial interface. This helps in understanding the active configurations. The command is sent to the 'commands/MQTTtoPilight/protocols' topic. ```bash mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoPilight/protocols" -m '{"enabled":true}' ``` -------------------------------- ### Execute Complete CI/CD Pipeline Source: https://github.com/1technophile/openmqttgateway/blob/development/scripts/CI_SCRIPTS.md Runs the full pipeline including QA, build, and documentation generation. Requires a build mode (dev or prod) and supports an optional preview server. ```bash ./scripts/ci.sh all --mode dev --preview ``` -------------------------------- ### Configure OpenMQTTGateway via PlatformIO Environment Variables Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/upload/portal.md This snippet demonstrates how to set network and MQTT credentials directly within a PlatformIO environment configuration file. It uses build flags to define server addresses, authentication, and gateway identifiers during the compilation process. ```ini [env:esp32-olimex-gtw-ble] platform = ${com.esp32_platform} platform_packages = ${com.esp32_platform_packages} board = esp32-gateway board_build.partitions = min_spiffs.csv lib_deps = ${com-esp.lib_deps} ${libraries.ble} build_flags = ${com-esp.build_flags} '-DZgatewayBT="BT"' '-DLED_INFO=33' '-DLED_INFO_ON=1' '-DESP32_ETHERNET=true' '-DMQTT_SERVER="11.22.33.44"' '-DMQTT_USER="salut"' '-DMQTT_PASS="atoi"' '-DGateway_Name="OpenMQTTGateway_ESP32_OLM_GTW"' ``` -------------------------------- ### Configure LEDManager Build Flags (PlatformIO) Source: https://github.com/1technophile/openmqttgateway/blob/development/lib/LEDManager/README.md This snippet shows how to configure the LEDManager library using build flags in the platformio.ini file. It demonstrates enabling addressable LEDs, specifying power requirements, and setting timing intervals for blink and pulse effects. ```ini ; For addressable LEDs: -DLED_ADDRESSABLE=true ; For non-addressable LEDs, comment out the line above ; If the Addressable LED requires power -DLED_ADDRESSABLE_POWER=15 ; Optional timing configurations: -DBLINK_INTERVAL=500 -DPULSE_INTERVAL=30 -DFADE_AMOUNT=5 ``` -------------------------------- ### Define Base Environment in platformio.ini Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/upload/builds.md Sets up the common framework, library dependencies, and build flags shared across all hardware environments in the project. ```ini [env] framework = arduino lib_deps = ${libraries.picomqtt} ${libraries.arduinojson} ${libraries.arduinolog} build_flags = -w ; supress all warnings monitor_speed = 115200 ``` -------------------------------- ### Configure Presence Detection in OpenHAB Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/integrate/openhab2.md Configuration files for setting up BLE presence detection, including the Thing definition, Item binding, and the logic rule to update presence status. ```java // Thing file Thing mqtt:topic:omgentrance (mqtt:broker:localBroker) { Channels: Type string : blepresence "People Presence" [ stateTopic="home/home_presence/OpenMQTTGatewayEntrance"] } // Item file String OMG_BLE_Entrance "BLE Entrance Detector" { channel="mqtt:topic:omgentrance:blepresence" } Switch Presence_Keys_Rick "Rick's Keys" (People, gKeys) {expire="240s,OFF"} // Rule file rule "BLE Presence Detector" when Item OMG_BLE_Entrance received update then val String msg = (OMG_BLE_Entrance.state as StringType).toString val String id = transform("JSONPATH", "$.id", msg).toString if(id == "xx:xx:xx:xx:xx:xx") Presence_Keys_Rick.postUpdate(ON) end ``` -------------------------------- ### Configure Motion Sensor for Home Assistant Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/integrate/home_assistant.md This YAML configuration sets up a motion sensor in Home Assistant via MQTT. It defines a binary sensor that detects presence and publishes its state ('true' or 'false') to a specified topic. The configuration includes a name, state topic, and value template to interpret the 'presence' field from the JSON payload. ```yaml mqtt: binary_sensor: - name: "Bewegung_Schlafzimmer" state_topic: "home/OpenMQTTGateway1/HCSR501toMQTT" value_template: '{{ value_json["presence"] }}' payload_on: "true" payload_off: "false" ``` -------------------------------- ### Configure RF Gateway Mode in Home Assistant Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/integrate/home_assistant.md This YAML configuration defines a select entity in Home Assistant to control the RF gateway mode (Pilight, RF classic, RF2 kaku). It uses MQTT to communicate the desired mode to the gateway and receives status updates. The configuration includes options for the select entity, state and command topics, and templates to map between human-readable modes and the gateway's numerical representation. ```yaml select: - name: 'RF: Mode receive' unique_id: espdevcho-rf-mode availability_topic: home/espdevcho/LWT payload_available: online payload_not_available: offline options: - "Pilight" - "RF classic" - "RF2 kaku" state_topic: home/espdevcho/RFtoMQTT value_template: > {% if value_json.active == 1 %} Pilight {% elif value_json.active == 2 %} RF classic {% elif value_json.active == 4 %} RF2 kaku {% endif %} command_topic: home/espdevcho/commands/MQTTtoRF/config 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/ ``` -------------------------------- ### Build OpenMQTTGateway Environment Source: https://github.com/1technophile/openmqttgateway/blob/development/docs/upload/gitpod.md Command to trigger a specific build environment within the PlatformIO CLI. Replace with the target board configuration defined in environments.ini. ```bash platformio run -e ```