This shows you the differences between two versions of the page.
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 '' | * Switch the ON/OFF switch on the board back to '' | ||
- | * 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 '' | * Create a new device with the name '' | ||
- | * 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 |
* '' | * '' | ||
* Three dot menu on the device > '' | * Three dot menu on the device > '' | ||
Line 71: | Line 72: | ||
* '' | * '' | ||
* 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:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
====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 ' | ||
+ | protocol: !lambda ' | ||
+ | code: !lambda ' | ||
+ | - 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, | high: !lambda 'char buffer [10];return itoa(data.high, | ||
code: !lambda 'char buffer [10];return itoa(data.code, | code: !lambda 'char buffer [10];return itoa(data.code, | ||
+ | |||
+ | on_advanced_code_received: | ||
+ | then: | ||
+ | - homeassistant.event: | ||
+ | event: esphome.rf_advanced_code_received | ||
+ | data: | ||
+ | length: !lambda 'char buffer [10];return itoa(data.length, | ||
+ | protocol: !lambda 'char buffer [10];return itoa(data.protocol, | ||
+ | code: !lambda ' | ||
+ | |||
+ | # 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: | ||
+ | - delay: 2s | ||
+ | - light.turn_off: | ||
</ | </ |