Can Home Assistant Listen to 433MHz Remotes?

does anybody know how to sniff RF codes on Hass.io?

You could always use an Input_Boolean switch that is triggered by the pressing of the doorbell. Then, write an automation that says “anytime the input_boolean is turned on, notify me, delay 15-30 seconds, then turn it off”. That way, the switch will automatically be turned off after the delay time. This delay allows for the person at the door to press the button multiple times without you being notified for each button press. My example uses Pilight as the service that receives the RF.

NOTE: I haven’t personally tested this myself, but it’s modeled off a working setup that I currently use for a different fuction. This is just an attempt to guide you in the right direction.

Input Boolean Switch:

input_boolean:
  front_doorbell:
    name: Front Doorbell
    initial: off
    icon: mdi:glassdoor

automations/front_doorbell_pressed.yaml

alias: "front_doorbell_pressed"
trigger:
  platform: event
  event_type: pilight_received
  event_data:
    protocol: ev1527
    uuid: 0000-b8-27-eb-4ffabe
    unitcode: 879842
    state: opened
action:
  - service: homeassistant.turn_on
    entity_id: input_boolean.front_doorbell

automations/front_doorbell_notification.yaml

alias: "front_doorbell_notification"
trigger:
  platform: state
  entity_id: input_boolean.front_doorbell
  from: 'off'
  to: 'on'
action:
  - service: notify.ios_iphone
    data:
      title: "Check Front Door"
      message: "Front Doorbell Pressed"
  - delay: '00:00:30'
  - service: homeassistant.turn_off
    entity_id: input_boolean.front_doorbell

Be sure to update the notify section with your notify commands. If you don’t use Pilight, change the trigger section of the “front_doorbell_pressed” automation to match whatever RF receiver setup/system you are using.

2 Likes

You really should break that out into a separate thread in the Hass.io section. You’ll have better luck there getting a response.

Hello Jeremy, please do you think pilight will work at raspberry pi3 with latest Hassbian? Or there will be neccesarry to change kernel? Or is there some pilight beta which could be used without kernel change?

And some manual how to install and configure pilight on hassbian or working config files?

Thank you very much.

I’m not sure if it’s possible to run Pilight on Hassbian or not, mainly because I’m not running Hassbian. You should create a thread in the Hassbian section asking for help installing Pilight. I do know that the latest version of Pilight works on Raspbian Stretch, which is what I am running.

As for configuration files, search for my other threads about Pilight. I have posted many different configurations in those threads.

Here: RPi RF Receiver addon

So i’m finally trying to set this up, but i’m a bit stuck about here from your post above:

In Pilight, you must first setup Pilight to listen to ALL protocols. This is documented in the manual install of Pilight, so I’m not going to go into detail on that.

Where do i do this? I can’t find anything about it. And where will the codes show up? I tried running the pilight-receive command in terminal, but nothing happens. I suppose the inputs should show on the next lines or be added to /etc/pilight/config.json. Maybe because i haven’t set it up to listen to ALL protocols?

NOTE: If you are up to date on your firmware on the Raspberry PI, you’ll need to use the Development Branch of Pilight. I’ve written another article on that, so I’m not going into detail on that either.

I saw this and found your other post. I started to uninstall, but i got an error message dpkg: error processing package pilight (--remove). I’ve tried apt-get remove/purge pilight and even apt --fix-broken install, but now i’m seem unable to both remove and install it. It also seems like the current latest release is a stable version, so maybe that procedure was outdated?

Just BTW, I was easily able to pick up the codes from my doorbell with BRUH’s rfrx.py script. However, I was not able to pick up the codes from my E:ZO smoke detectors which is a popular type around here. They specify that it uses 433.92MHz wireless communication.

If you are not compiling it it will listen to all anyway. When compiling you get options of which devices/protocols you want to listen for.

The latest version pilight 8 should just install.

Whether you can see the smoke detectors depends on the protocol as well as being sent at 433mhz, if for instance they are manchester encoded the normal python scripts can’t pick them up as they don’t do manchester decoding, pilight does however so it sees most things :slight_smile:

Well it did install initially, but when i tried to uninstall it for a development branch, that’s when things went wrong. I’m sure i will find a way to reinstall it though.

However, back to where i got before i tried to uninstall, i ran the commands service pilight start followed by pilight-receive. The terminal just jumped to the next line and i pushed the doorbell button multiple times, long presses and close to the receiver etc. Nothing showed up in the terminal. Maybe i have to define the GPIO pin for the rx module somewhere? Only thought about that now. But i don’t know where to look if that’s not the place to look for input.

You have to setup the config.json as per the pilight docs…

Here’s an example of mine…

{
	"devices": {
		"pibedroompir": {
			"protocol": [ "kaku_switch_old" ],
			"id": [{
				"id": 31,
				"unit": 1
			}],
			"state": "on"
		},
		"pilivingroompir": {
			"protocol": [ "kaku_switch_old" ],
			"id": [{
				"id": 30,
				"unit": 15
			}],
			"state": "on"
		},
		"pihallpir": {
			"protocol": [ "kaku_switch_old" ],
			"id": [{
				"id": 23,
				"unit": 5
			}],
			"state": "on"
		},
		"pikitchenpir": {
			"protocol": [ "kaku_switch_old" ],
			"id": [{
				"id": 31,
				"unit": 0
			}],
			"state": "on"
		}
	},
	"rules": {},
	"gui": {
		"pibedroompir": {
			"name": "bedroompir",
			"group": [ "bedroom" ],
			"media": [ "web" ],
			"readonly": 0
		},
		"pilivingroompir": {
			"name": "livingroompir",
			"group": [ "livingroom" ],
			"media": [ "web" ],
			"readonly": 0
		},
		"pihallpir": {
			"name": "hallpir",
			"group": [ "hall" ],
			"media": [ "web" ],
			"readonly": 0
		},
		"pikitchenpir": {
			"name": "kitchenpir",
			"group": [ "kitchen" ],
			"media": [ "web" ],
			"readonly": 0
                 }
	}'
	"settings": {
		"log-level": 6,
		"pid-file": "/var/run/pilight.pid",
		"log-file": "/var/log/pilight.log",
		"port": 5000,
		"webserver-enable": 1,
		"webserver-http-port": 5001,
		"webserver-cache": 1,
		"webserver-root": "/usr/local/share/pilight/webgui",
		"standalone": 1,
		"gpio-platform": "raspberrypi3"
	},
	"hardware": {
		"433gpio": {
			"sender": 0,
			"receiver": 1
		}
	},
	"registry": {
		"pilight": {
			"firmware": {
				"version": 20976,
				"lpf": 556850,
				"hpf": 219750
			},
			"version": {
				"current": "8.0.3"
			}
		},
		"webgui": {
			"tabs": 3
		},
		"webserver": {
			"ssl": {
				"certificate": {
					"secure": 0,
					"location": "/etc/pilight/pilight.pem"
				}
			}
		}
	}
}

Couple of things with this file :-

  1. You can’t edit it while the daemon is running as it will overwrite it when you save it
  2. it’s located in /etc/pilight

The hardware section has to be setup, however this is correct for the the pins as per the docs for plugging the hardware pilight suggests, so if you have done the same it should be OK, but do check it.
The webgui needs setting up to if you are using it.

1 Like

Yes, i found that file, but there wasn’t much in there, just some basic settings, maybe 5-6 lines. Should the devices i triggered be generated and listed in there? They weren’t. I have no idea which protocol i should use for my devices if i tried to set it up manually.

Yeps just the place holder, you need to add your devices and web gui bits and the hardware.

When you get pilight-receive working it will tell you what it finds, I suggest you pipe the output to a file.

OK, just to be clear, pilight-receive should display input in the terminal as they are triggered?

EDIT: Do i need to configure GPIO or something like that first?

Yep provided the pilight daemon is running…

ps -aux to find out

Well like I said the config.json has to be setup (without the daemon running), then run the daemon and finally run pilight-receive.

You can can check if the pilight is working by checking the log or by running pilight via the command line …

pilight log

/var/log/pilight.log

pilight-daemon -D in the terminal to spot config issues

Have finally got around to adding my doorbell to HA using an old 433 remote control which I stripped down, shorted a switch to send a specific code and then wired it to the ring circuit of my bell. Thanks to @jeremyowens for his code above and @1technophile for his excellent 433 to mqtt code that I have running in a NodeMCU.

Some pictures of the final build

3 Likes

Out of curiosity it seems this RF to wifi hub is capable of doing it without any workarounds. Have folks used it? Where does it fall short compared with what home assistant has for RF support. https://www.amazon.com/dp/B076H8648D/ref=cm_sw_r_cp_apa_c6opAbTPF2CG8

This looks more like a standard transmitter like the Broadlink. I can’t find any information about receiving signals on the page.

If you want off the shelf solution you have the sonoff rf bridge also
https://m.banggood.com/fr/SONOFF-RF-Bridge-WiFi-433-MHz-Replacement-Smart-Home-Automation-Universal-Switch-p-1179900.html

for less than 15euros it does the job for basics 433mhz protocols like the ones listed here :

Openmqttgateway can be flashed into it as espurna as tasmota.
With Openmqttgateway it listen constantly signals and send on demand. With the others I don’t know.

1 Like

I’ve received my sonoff rf bridge, I need to remove the plastic casing but haven’t yet found any specific advice on how to remove it. Looks like I need to get something sharp underneath the top cover and prise if off. Any advice?
Cheers

Yes, with a plate screw driver or a knife you should be able by passing on the different side to make the top plate upper and remove it