ESP8266 + RF Transmitter & Reciever

Hello,

i now tried for hours to make following happend:
I have some 433mhz controlled outlets which i want to controll with home assistant and the original remote.
i order to do this i have a working recieve & transmitt unit. Codes are working BUT:

that god da** switch wont behave how i wanted to. however i write my code it wont stay on when i click on on.

This is how i wish it worked:
Clicking on Dashboard on Toggle Switch -> Switch stays on, because i clicked on it and RF Code will transmitted.
Clicking on my original remote a code for on or off will also toggle the switch on dashboard when recieved dashboard icon.

my code gore so far:

remote_transmitter:
  pin: D7
  # RF uses a 100% carrier signal
  carrier_duty_percent: 100%

remote_receiver:
   pin: D6
   dump:
   - rc_switch
   filter: 100us
   idle: 4ms
   
binary_sensor:
  - platform: status
    name: "RF Bridge Status"

  - platform: remote_receiver
    name: "A45 On"
    internal: yes
    rc_switch_raw:
      code: '000000010100010101010001'
      protocol: 1
    filters:
      - delayed_off: 500ms
    on_press:
      - binary_sensor.template.publish:
          id: a45State
          state: ON
      - switch.turn_on: a45Switch
    #on_state:
    #  - switch.turn_on: a45State

  - platform: remote_receiver
    name: "A45 Off"
    internal: yes
    rc_switch_raw:
      code: '000000010100010101010100'
      protocol: 1
    filters:
      - delayed_off: 500ms
    on_press:
      - binary_sensor.template.publish:
          id: a45State
          state: OFF
      - switch.turn_off: a45Switch
    #on_state:
    #  - switch.turn_off: a45State
      
  - platform: template
    name: "A45 State"
    device_class: power
    id: a45State


switch:
  - platform: template
    name: "45 A Switch"
    id: a45Switch
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '000000010100010101010001'
          protocol: 1
          repeat: 
            times: 3
            wait_time: 50ms
    turn_off_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '000000010100010101010100'
          protocol: 1
          repeat: 
            times: 3
            wait_time: 50ms

im absolutly a beginner with this.

BR Daniel

nobody? :frowning:

still need help with this :frowning:

I have this set up and working, unfortunately I lost my server hard drive a while back and therefore the ESPhome config along with it.

in order to make the hass front end switch stay on when you switch it on and vica versa you need to use optimistic state in the config

switch:
  - platform: template
    name: RF Power Button
    optimistic: true
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '000101010101010111000011'
    turn_off_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '000101010101010111001100'

with regards using your original RF remote and having that change the switch state in hass, because the RF plug has only one way communication and hass cannot know the actual state of the plug, what I would do is use the node to retransmit the signal that has been picked up by the receiver in someway, sadly I don’t know how to write the yaml for this but it wouldn’t be too hard.

hi, i don’t try this switch but my carrier duty cicle is in 50% for rf transmit
please don’t hate me for revive this thread an sorry for my english
thanks