Skip to content

Home Assistant Raspberry Pi RF Transmitter (GPIO) Integration

License

Notifications You must be signed in to change notification settings

flavioxavier/rpi_rf_transmitter

 
 

Repository files navigation

Home Assistant Raspberry Pi RF Transmiter custom integration

**This is a spin-off rpi_gpio for sending RF raw codes (similar to thoses generated by esphome rf receiver) using a RF transmitter connected to the Raspberry Pi

Installation

HACS

The recommend way to install rpi_rf_transmitter is through HACS.

Manual installation

Copy the rpi_rf_transmitter folder and all of its contents into your Home Assistant's custom_components folder. This folder is usually inside your /config folder. If you are running Hass.io, use SAMBA to copy the folder over. You may need to create the custom_components folder and then copy the rpi_rf_transmitter folder and all of its contents into it.

Usage

The rpi_rf_transmitter platform will be initialized using the path to the gpio chip. When path is not in the config /dev/gpiochip[0-5] are tested for a gpiodevice having pinctrl, in sequence [0,4,1,2,3,5]. So with a raspberry pi you should be OK to leave the path empty.

Raspberry Pi GPIO Device
RPi3, RPi4 /dev/gpiochip0
RPi5 /dev/gpiochip4
# setup gpiod chip; mostly not required
rpi_rf_transmitter:
  path: '/dev/gpiochip0'

Options

Key Required Default Type Description
gpiod only for path - - gpiod platform config and initialization, only required when you need to specify a specific gpiodevice path (see path)
path no discovered string path to gpio device, if not set auto discovered
gpio yes 17 string GPIO pin used by the transmitter

Button

The rpi_rf_transmitter switch platform allows you to control the GPIOs of your Raspberry Pi.

Configuration

To use your Raspberry Pi's GPIO in your installation, add the following to your configuration.yaml file:

# Basic configuration.yaml entry
switch:
  - platform: rpi_rf_transmitter
    switches:
      - port: 11
        name: "Fan Office"
      - port: 12
        name: "Light Desk"
# Full configuration.yaml entry
switch:
  - platform: rpi_rf_transmitter
    switches:
      - port: 11
        name: "Fan Office"
        unique_id: "fan_office_switch_port_11"
        persistent: true
      - port: 12
        name: "Light Desk"
        unique_id: "light_desk_switch_port_12"
        invert_logic: true

Options

Key Required Default Type Description
switches yes list List of switch IO ports (BCM mode pin numbers)
name yes string The name for the switch entity
port yes integer the GPIO port to be used
unique_id no string An ID that uniquely identifies the switch. Set this to a unique value to allow customization through the UI, auto generated when not set manually in config
invert_logic no false boolean If true, inverts the output logic to ACTIVE LOW
persistent no false boolean If true, the switch state will be persistent in HA and will be restored if HA restart / crash
pull_mode no AS_IS string Type of internal pull resistor to use: UP - pull-up resistor, DOWN - pull-down resistor, AS-IS no change
drive no PUSH_PULL string control drive configuration of the GPIO, determines how the line behaves when it is set to output mode; PUSH_PULL, GPIO line can both source and sink current, can actively drive the line to both high and low states. OPEN-DRAIN, GPPIO can only sink current (drive the line to low) and is otherwise left floating, and OPEN-SOURCE the reverse.

For more details about the GPIO layout, visit the Wikipedia article about the Raspberry Pi.

A common question is what does Port refer to, this number is the actual GPIO #, not the pin #. For example, if you have a relay connected to pin 11 its GPIO # is 17.

# Basic configuration.yaml entry
switch:
  - platform: rpi_rf_transmitter
    switches:
      - port: 17
        name: "Speaker Relay"

About

Home Assistant Raspberry Pi RF Transmitter (GPIO) Integration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%