Help a newbie with Rpi-RF, Hassbian, setting up Switches appropriately

Hello, All.

This is my first post and I only started with HA last week. I am weakly skilled compared to you guys, so any help is appreciated.

I had seen the Bruh video about setting Etekcity Wireless Remote Control Plug Electrical Outlet and the Superheterodyne RF Link transmitter and receiver. I had previously given up on Hass.io after being unable to get Rpi-Rf to work correctly and getting errors, so I installed Hasspian.

I am now happily running Hasspian, and have successfully set up the Switches in HA using the Raspberry Pi RF Switch.

My next adventure was trying to set up my older ceiling fans with RF transmitters. I had a few of these in the house, so I used them and got them working fine with the included remote, PECHAM Universal Wireless Kit for Ceiling Fan. My problem is that I haven’t been able to set the switches up the way I want in HA probably because I’m stupid, which is why I’ve come here.

EtekcityRemote_
The Etekcity Remote have distinct ON and OFF which send separate RF signals, so it’s easy to set up the Switches in configuration.yaml.
switch:
- platform: rpi_rf
gpio: 17
switches:
Outlet1:
code_on: 1119539
code_off: 1119548
protocol: 1
pulselength: 200


However, the Pecham remote does use the buttons the same way.

  1. The ON/OFF sends the same signal on each press.
  2. The Fan has 4 buttons, set up as Low, Medium, High, Off.

So, I’m confused as to how to set this up using the Raspberry Pi RF Switch instructions for the configuration.yaml. This isn’t a problem for the Light since I can just configure the configuration.yaml to use the same code for ON and OFFL

Bedroom Overhead Light:
code_on: 8965221
code_off: 8965221
protocol: 1
pulselength: 360

But for the FAN settings, it would seem like for the FAN settings, I need buttons that are more like Momentary Switches that then are Disable if a competing Switch is pressed, I guess an exclusion. For example:

Send “Fan Medium” RF signal ON. When I want high, I send “Fan High” Signal ON, which then also changes the switch of Fan Medium back to the OFF position.

Does this made sense?

Is there a better way to do this that I’m not seeing. As I said, Ii’m very new to this, and enjoy working out this stuff, though obviously I’m woefully not up to the task. Can you guys help? :slight_smile:

I suggest you represent the different levels of the fan as an input select or input number with the slider option.

When the user changes the front end, it will trigger an event you can use to run an automation to send the appropriate value to the RF.

I tried using the input select, but was unsuccessull. Can someone help me with this. The automations and the the input select are available on my overview page, but they do not do anything. The Switches that I’ve set up all work successfully.

I feel like this is a syntax issue, but I haven’t worked up out yet.

# Define our dropdown list
input_select:
  master_fan:
    name: Master Bedroom Fan Speed
    options:
      - "Off"
      - "Low"
      - "Medium"
      - "High"
    #initial: Off

automation:
  # If you select "Off", Send On for Fan_Off/Stop RF, Send Off for Fan_Low, Fa_Medium, Fan_High
  - alias: Master_Fan_Off
    trigger:
      platform: state
      entity_id: input_select.master_fan
      to: "Off"
    action:
      service: switch.turn_on
      data:
        entity_id: switch.bedroom_fan_off
      service: switch.turn_off
      data:
        entity_id: switch.bedroom_fan_low, switch.bedroom_fan_medium, switch.bedroom_fan_high

  - alias: Master_Fan_Low
    trigger:
      platform: state
      entity_id: input_select.master_fan
      to: "Low"
    action:
      service: switch.turn_on
      data:
        entity_id: switch.bedroom_fan_low
      service: switch.turn_off
      data:
        entity_id: switch.bedroom_fan_off, switch.bedroom_fan_medium, switch.bedroom_fan_high

  - alias: Master_Fan_Medium
    trigger:
      platform: state
      entity_id: input_select.master_fan
      to: "Medium"
    action:
      service: switch.turn_on
      data:
        entity_id: switch.bedroom_fan_medium
      service: switch.turn_off
      data:
        entity_id: switch.bedroom_fan_low, switch.bedroom_fan_off, switch.bedroom_fan_high

  - alias: Master_Fan_High
    trigger:
      platform: state
      entity_id: input_select.master_fan
      to: "High"
    action:
      service: switch.turn_on
      data:
        entity_id: switch.bedroom_fan_high
      service: switch.turn_off
      data:
        entity_id: switch.bedroom_fan_low, switch.bedroom_fan_medium, switch.bedroom_fan_off