Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VirtualWire / RadioHead RH_ASK Protocol #4954

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from

Conversation

Mat931
Copy link
Contributor

@Mat931 Mat931 commented Jun 15, 2023

What does this implement/fix?

This PR adds support for transmitting and receiving VirtualWire / RH_ASK messages.
It can be used to send messages between Arduino and ESPHome devices via 433MHz / 868MHz / infrared / wire / etc.
This is a complete re-write of the protocol using the ESPHome remote_receiver and remote_transmitter.

Requires #4798

Transmitter documentation
Receiver documentation

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes esphome/esphome-core#160

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#3022

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040

Example entry for config.yaml:

# Example config.yaml
external_components:
  - source: github://pr#4954
    components: [remote_base]
    refresh: always

remote_receiver:
  filter: 15us
  pin:
    number: 26
    mode:
      input: True
      pullup: True
    inverted: False
  dump: virtualwire
  on_virtualwire:
    then:

remote_transmitter:
  pin: 25
  carrier_duty_percent: 100

binary_sensor:
  - platform: gpio
    pin:
      number: 0
      inverted: true
    id: test
    filters:
      - delayed_on_off: 100ms
    on_press:
      - remote_transmitter.transmit_virtualwire:
          data: [0x00]
          speed: 2000

  - platform: remote_receiver
    name: "RX Test"
    virtualwire:
      data: [0x00]
      speed: 2000
    filters:
      delayed_off: 1s

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@Mat931 Mat931 marked this pull request as ready for review June 16, 2023 09:48
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.14%. Comparing base (4d8b5ed) to head (a5229a4).
Report is 603 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4954      +/-   ##
==========================================
+ Coverage   53.70%   54.14%   +0.43%     
==========================================
  Files          50       50              
  Lines        9408     9594     +186     
  Branches     1654     1691      +37     
==========================================
+ Hits         5053     5195     +142     
- Misses       4056     4073      +17     
- Partials      299      326      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Sensor - how to access to Remote receiver or I2C component
2 participants