Using 433mhz sender and receiver

I have a fresh installation of home assistant running on a Raspbian image.

It’s installed on my rip 3.
It’s working well. I have follow the installation guide on the web site using the virtual environment but
I have an issue to use my remote and my plug 433mhz.
In a terminal I can send and receive code. It’s ok.
I use rfsniffer and codesend command included in rpi_utils tools.

In my configuration.yaml I have added those lines :

platform: rpi_rf
gpio: 26
code_on: 16762196
code_off: 16762193

Pluga appears on my homepage of home assistant but when i use it my plug don’t switch off/on.
It’s the same GPIO port and the same code as the terminal command line I have use just before.
If anyone can help me!
Thanks a lot and sorry for my English.

This topic would be better off in the Configuration category, it’s not an installation question.

I have move the post

Have you tried adding the pulse length and protocol to that config?

Here is a screenshot of my old code

Thanks for your answer.
I have added protocole and pulselenght parameters, reboot home assistant but it doesn’t work.

If you have other idea I can try it.
Thanks in advance


Do you have an antenna on the 433 transmitter? How far are you between the transmitter and the device ?

Do you have any errors in the logs?

Transmitter and receiver are very closed. Around 5 cm.
If I use rpiutils tools it works nice.
It’s work at around 6-7 meters in my house.
But nothing with home assistant.
Where can I see the log file?
In developers tools on the left, I have no new issue.

it is a while ago for me that i set it up. But i can remember it had something to do with GPIO out permissions for the homeassistant user which had to be granted to these pinout.

Hope it helps

This are some links i still had which helped me to get things running:

this one you may need to translate:

Thanks for your answer.
I have read all the topic and try again but i face the same issue.
GPIO is exported as describe…
I dont understand what is wrong.
Is there a command line to launch home assistant with debug information.
Just to see if there is no probleme?
Thanks a lot

I created myself a little script starting of logging:

homeassistant@homeassistant:~$ nano
sudo journalctl -f -u [email protected]
homeassistant@homeassistant:~$ chmod +x
homeassistant@homeassistant:~$ sh

This would give a nice detailed output. Maybe there is even more info but this helps me most of the times

I hhave done it.
Here is the result :slightly_smiling_face:

pi@pi:~ $ sh
– Logs begin at Sun 2019-10-27 14:40:18 CET. –
oct. 27 14:46:33 pi hass[588]: 2019-10-27 14:46:33 INFO (SyncWorker_14) [homeassistant.components.rpi_rf.switch] Sending code(s): [4281617]
oct. 27 14:47:30 pi hass[588]: 2019-10-27 14:47:30 INFO (SyncWorker_7) [homeassistant.components.rpi_rf.switch] Sending code(s): [4281620]
oct. 27 14:47:32 pi hass[588]: 2019-10-27 14:47:32 INFO (SyncWorker_2) [homeassistant.components.rpi_rf.switch] Sending code(s): [4281617]
oct. 27 14:48:22 pi hass[588]: 2019-10-27 14:48:22 INFO (SyncWorker_17) [homeassistant.components.rpi_rf.switch] Sending code(s): [4281620]
oct. 27 14:48:24 pi hass[588]: 2019-10-27 14:48:24 INFO (SyncWorker_4) [homeassistant.components.rpi_rf.switch] Sending code(s): [4281617]
oct. 27 15:44:32 pi hass[588]: 2019-10-27 15:44:32 INFO (MainThread) [homeassistant.components.updater] Submitted analytics to Home Assistant servers. Information submitted includes {}
oct. 27 15:44:32 pi hass[588]: 2019-10-27 15:44:32 INFO (MainThread) [homeassistant.components.updater] You are on the latest version (0.100.3) of Home Assistant
oct. 27 16:39:07 pi hass[588]: 2019-10-27 16:39:07 INFO (SyncWorker_3) [homeassistant.components.rpi_rf.switch] Sending code(s): [4281620]
oct. 27 16:39:09 pi hass[588]: 2019-10-27 16:39:09 INFO (SyncWorker_5) [homeassistant.components.rpi_rf.switch] Sending code(s): [4281617]
oct. 27 16:41:10 pi hass[588]: 2019-10-27 16:41:10 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1730437680] Connection closed by client

The codes being sent are different than your set up “ 4281620” , are you sure you are using the correct switch when trying to send the codes?

I have two set of plug/remote and I use the last.
It’s the good code.
I will send the configuration file tomorrow.

My configuration.yaml below :slightly_smiling_face:

# Configure a default setup of Home Assistant (frontend, api, etc)

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url:

# Example configuration.yaml entry
  - platform: rpi_rf
    gpio: 26
        protocol: 1
        pulselength: 306
        code_on: 4281617
        code_off: 4281620

# Text to speech
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

Any ideas ?

Are these the codes you sniffed using a receiver? My 433 on/off codes are usually 8 digits apart as per my screenshot above.

The protocol and pulse length must match what you sniffed and not copied from someone else’s config.

I would also double check that you are using the correct gpio pins.

Thanks for your answer.
I use the receiver on GPIO 22 and
the sender on GPIO26.

When i use my remote, I found the code
with rfsniffer command line.
This tools give me only the code received, not protocole or pulselenght.
It’s working very well and quit fast.

After that, I use codesend command line with the code received just after.
It’s ok, my electric plug switch between on/off.
I just send only the code.
So We can say that, codes are good. Sender and receiver works well on GPIO.

But On home assistant, i use the configuration file describe just under and my plug doesn’t work…

Just for information, the command line i use to send my code is
./codesend 4281617

I have not try with :
rpi-rf_send 4281617

I think you need to sniff the codes again to get the protocol and pulse length. I used Here to get mine