User Tools

Site Tools


home:rf_control

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
home:rf_control [2021/01/30 19:59]
derek
home:rf_control [2024/09/22 19:51] (current)
Line 56: Line 56:
   * Disconnect the serial adaptor from the PC and remove all the wiring   * Disconnect the serial adaptor from the PC and remove all the wiring
   * Switch the ON/OFF switch on the board back to ''ON'' to enable the RF again   * Switch the ON/OFF switch on the board back to ''ON'' to enable the RF again
-  * Carefully bend the led panel back into place and fit the board into the case again, screwing it in+  * Carefully bend the led panel back into place and optionally cut one of the wires to it to disable the relatively bright led 
 +  * Fit the board into the case again, screwing it in
  
 ===Create and upload ESPHome firmware=== ===Create and upload ESPHome firmware===
Line 62: Line 63:
   * Using the ESPHome addon in Home Assistant:   * Using the ESPHome addon in Home Assistant:
     * Create a new device with the name ''sonoff_rf_bridge'' and any placeholder text for the network info     * Create a new device with the name ''sonoff_rf_bridge'' and any placeholder text for the network info
-    * Enter the contents of [[github.com|GitHub Home Assistant placeholder]] into the config of the device+    * Enter the code from the [[#Notes]] section below into the config of the device
     * ''Save''     * ''Save''
     * Three dot menu on the device > ''Compile''     * Three dot menu on the device > ''Compile''
Line 71: Line 72:
       * ''Start Upgrade'' (This should complete within 60 seconds)       * ''Start Upgrade'' (This should complete within 60 seconds)
   * You should get a new device discovered notification in Home Assistant   * You should get a new device discovered notification in Home Assistant
 +  * Agree to add the RF bridge to Home Assistant
 +
 +===Learn Codes===
 +  * FIXME: learn new RF codes
  
 ====Update==== ====Update====
Line 79: Line 84:
   * [[https://tasmota.github.io/docs/devices/Sonoff-RF-Bridge-433/]]   * [[https://tasmota.github.io/docs/devices/Sonoff-RF-Bridge-433/]]
   * [[https://next.esphome.io/components/rf_bridge.html]]   * [[https://next.esphome.io/components/rf_bridge.html]]
 +  * [[https://next.esphome.io/components/cover/time_based.html]]
 +  * [[https://next.esphome.io/components/cover/template.html]]
  
 ====Notes==== ====Notes====
 +ESPHome firmware definition to allow discovery of new RF codes:
 +
 <code yaml> <code yaml>
 substitutions: substitutions:
Line 120: Line 129:
       then:       then:
         - rf_bridge.learn         - rf_bridge.learn
 +    - service: send_advanced_rf_code
 +      variables:
 +        length: int
 +        protocol: int
 +        code: string
 +      then:
 +        - rf_bridge.send_advanced_code:
 +            length: !lambda 'return length;'
 +            protocol: !lambda 'return protocol;'
 +            code: !lambda 'return code;'
 +    - service: start_advanced_sniffing
 +      then:
 +        - rf_bridge.start_advanced_sniffing
 +    - service: stop_advanced_sniffing
 +      then:
 +        - rf_bridge.stop_advanced_sniffing
  
 rf_bridge: rf_bridge:
Line 131: Line 156:
             high: !lambda 'char buffer [10];return itoa(data.high,buffer,16);'             high: !lambda 'char buffer [10];return itoa(data.high,buffer,16);'
             code: !lambda 'char buffer [10];return itoa(data.code,buffer,16);'             code: !lambda 'char buffer [10];return itoa(data.code,buffer,16);'
 +
 +  on_advanced_code_received:
 +    then:
 +      - homeassistant.event:
 +          event: esphome.rf_advanced_code_received
 +          data:
 +            length: !lambda 'char buffer [10];return itoa(data.length,buffer,16);'
 +            protocol: !lambda 'char buffer [10];return itoa(data.protocol,buffer,16);'
 +            code: !lambda 'return data.code;'
 +
 +# Turn the Wifi led on for 2 seconds when the button is pressed to show that it's working
 +output:
 +  - platform: gpio
 +    pin:
 +      number: GPIO13
 +      inverted: True
 +    id: output_wifi_led
 +light:
 +  - platform: binary
 +    id: wifi_led
 +    output: output_wifi_led
 +binary_sensor:
 +  - platform: gpio
 +    pin: GPIO00
 +    id: pairing_button
 +    on_press:
 +      then:
 +        - light.turn_on: wifi_led
 +        - delay: 2s
 +        - light.turn_off: wifi_led
 </code> </code>
home/rf_control.1612036796.txt.gz · Last modified: 2024/09/22 19:51 (external edit)