DIY Alarm help

Hi there

I am thinking about creating my own Home based alarm system, I want to create a nest detect style pir wifi sensor. is is better to buy sensor like this or build your own. not looking for 433mhz looking for true wirless sensors. I know you can connect standard pir sensors to audrino boards. would be goof to have list of products that can be intergrated into HA

I recently found this https://www.hadevices.com/. But its not completely updated as i know that HA can handle more devices

Hello,

I don’t catch why 433mhz are not wireless sensors. Could you explain your ideas on this ?

If you want wireless sensor I will advise to go off the shelves. Unless you are ready to spend several days digging the low power mode of microcontrollers.

Wemos D1 mini running ESPhome and a PIR sensor connected to it. Integrates perfectly into HA.

Hi

Thanks for your response.

433mhz sensors I belive require a home bridge i just want some that will communicate with HA without the need of home bridge

ok you mean by a wireless communication directly handled by your HA server isn’t it?

Yes that is correct.

so wifi
check out the suggestion I posted above

The issue with wifi is that you will not be “true” wireless due to power consumption.

WTF is ‘true wireless’ then? Do you want devices to get power from thin air? wifi IS wireless, 433MHz IS wireless. What ‘true wireless’ do you want? Explain your magical technology for the rest of us, please

Keep calm, there is no need to use familiar expression to make a discussion progressing :wink:

I think by true wireless he means no cable. And with a wemos running a pir sensor due to the power consumption you will need a power cable.
This is not the case with zigbee which runs on batteries for instance.
But I think @Yammers could describe its need a little bit more.

Well @Yammers never said he wanted it to run off battery, only mentioned that it was supposed to be ‘true wireless’ (not explaining power supply) and that he didn’t want 433MHz because it requires another radio (wanted direct HA comms). Zigbee is also going to need a radio as no HA server that I know of has a Zigbee radio in-built.

Realistically, running something like a Wemos with a 5V power supply (easy to sort out) would be the best option since it’s always online, fast to respond and can also house other sensors. Depending on the location of the device, 1 Wemos D1 mini can be used for multiple PIR’s if placed between them with some short wires to each location - now I know that takes away from ‘wireless’ but a few short wires to get many PIR’s
 Otherwise just cough up the coin for a wireless sensor sold by one of the many retail companies
 or maybe look at mysensors
 EDIT: on further inspection I don’t think they will fit the requirements anyway
 still need power other than battery I think

With all wireless there is a security factor

433 MHz or 868 MHz simple systems are easy to jam. You need a handheld walkietalkie - transmit on 433.920. It will transmit 1-5 Watts and will kill anything that transmits in the milliwatt range. You only have to transmit while you break the window or door because these sensors only transmit ONE maybe a few messages. You cannot poll the status of these sensors. If it is a PIR sensor you just pull it down and step on it while you jam it. You can buy these handheld walkietalkies cheap on ebay. The 433.920 is in the middle of a radio amateur band.

868 MHz plain signalling sensors are more exotic. It is not in a ham band so radios that can transmit in that frequency are not as common. In some regions like US the frequency used is 915 MHz. Same applies.
You can get radios that can transmit in this frequency but they are more rare. Slightly higher security but still sucks

Then we have the Z’s

They are both mesh networks
Z-wave operates at 868.42 MHz in Europe, at 908.42 MHz in the North America
Zigbee shares the 2.4 MHz band with Wifi

They have one thing in common. They have both a receiver and a transmitter so they can be polled. Not too often because that sucks the life out of the battery. But it means that if you open a window or door you have to destroy the sensor while you jam it because otherwise the open door/window state will be retransmitted and you have an alarm triggered. Zigbee is difficult to jam because the transmitters you have available are usually spreading spectrum differently than Zigbee does. Zigbee lives happily with Wifi and interference is managed somehow.

Zigbee devices are cheap. In general I would say 30 to 50% the price of equivalent Z-wave
And I personally have better experience with the reliability of Zigbee than I have with Z-wave in my house. It may be interference. It may be the instability of the OpenZWave library used by home assistant. I might have had better results using a dedicated Z-wave hub.

If I am to recommend something simple for Home Assistant and window/door sensors I would say buy a Conbee II stick for Zigbee and the cheap Xiaomi Aqara window/door sensors. They are small. They pair well with the Conbee. I have not yet seen a missed opening or closing of a window.

For my doors I chose to build a Wifi based solution where I put

  • An NFC reader (with libraries for Arduino)
  • A row of 8 “neopixel” LEDs that show the status of all windows and doors of the house and the alarm status (4 windows - 3 doors - 1 alarm status LED)
  • A Wemos D1 mini as the brain

I wrote the software myself - and it connects to HA with MQTT
Housing is 3D printed

Is that easy? No.
Is is fun to do? You bet!

I have wired two sensors to these boxes. Simple reed contacts normally open, and magnets
One detects that the door is open
The other is in side door frame with a flat magnet glued to the bolt and this detects that the door is locked. When I leave the house I can check the row of LEDs. If a window is open or a door is not locked the LED is red instead of green. And then I say “Alexa turn on the alarm system” and leave.

So this brings us to Wifi based.
Wifi based sensors are very easy to jam because you do not need to jam the radio. You bring a little portable device with a “deauther”. Wifi WPA has a known problem that allows an attacker to throw you off the network and it can continue sending false access point messages that prevents the client to connect again. You can download the software for this and you can use off the shelf hardware. You do not need to know anything. Just follow a recipe on the net.

So I know a thief can attack my door sensors. But then he also needs to attack my Zigbee motion sensors that will get him the minute he opens the door. With multiple points of protection is becomes practically impossible to prevent the trigger of the alarm.

Now finally Motion sensors.

I have two types

  • 433 MHz Sonoff types. They work great. They are not 100 % reliable because of the 433 MHz lack of reliability but the thing with Motion is that a burglar will move a round so the sensors will trigger many times and it just takes ONE to trigger.
  • Philips Hue Zigbee sensors paired with the Conbee II stick. These are my favorites. They are cheap. They last long on the battery. They report their battery status well. They are small. Good looking. And super sensitive and less likely to cause false alarms. And harder to jam because they are zigbee based. I have a Philips motion sensor in the bathroom and it still works on the original coin cell battery after a year. And I can see the battery status is still good. Batteries are a pain but when they last for a couple of years it is not bad.

I could have built D1 mini based PIR sensors. I have the bits for it. But these Philips sensors are so small and cheap it is not worth it.

If you want a system that cannot be jammed then you need wired sensors all over the place. But that we all know is a pain to install so it hides the wires. But nothing beats wires.

I hope all these words gave some inspiration of what is possible

4 Likes

What I see also in your system as an interesting architecture concept is diversity, indeed diversity of technologies make the work for burglar a lot more difficult.
If he has to bring with him a jamming system for each frequency used and think on all the details and behaviour per communication technology, he will have a hard work bypassing all the systems.
The downside of that, is we need as tinkerer to handle these diversity of technologies.

In my side I’m also mixing stuff I have 433mhz sensors and wired security devices.

Regarding jamming, I didn’t worked on that but we could make a jamming detection quite easily by pinging a 433mhz device with a custom made program.

The problem with 433 MHz is that this band is a waste basket of misc signals from baby monitors to door bells. You will probably detect many false alarms if you try to detect jamming. You can detect it but all you could use it for is debugging. You could not trigger the alarm system from a jamming detection because odds are that the interfering signal is a legitimate signal

I have a small anekdote. I am a radio amateur also (OZ1IDD) but not very active any longer as I have worked with professionel radio for 32 years (Motorola). Many years ago while I still played with radio I had a strange carrier on my UHF radio around 434 MHz and it was very strong.
So I took a hand portable and started walking down the road and the signal got weaker no matter where I walked. The signal came from my house.
So I started turning off computers, radios, TVs. Nothing helped. Finally I flipped the main circuit breaker and put the entire house dead. The signal was still there. I gave up and went to bed.
Next morning my wife put her laptop in her bag and pulled out a remote control she used to flip slides in Power Point. Guess what. It transmitted on 434 MHz and it had been squeezed against a can of makeup and had transmitted for hours until it ran out of battery.

Another anekdote is when we radio amateurs drove south to Ham radio events it was a sport to transmit 50W on 433.920 on the car deck on the ferry. Back then all car alarms and key fobs used 433.92 MHz. The scene when 8-9 cars could not be opened and the car alarms going off when people panic’ed and opened the door. There is a reason why car manufacturers introduced different solutions later for keyfobs

The learning is that 433.920 is a garbage frequency and I advice not to rely on it for mission critical stuff.
I do not use the 433 MHz sensors in my alarm system because it is so easy to transmit a false sensor code and the cheap Sonoff sensors do not even use rolling codes. But to announce that someone is entering the garden, or to signal that I have snail mail in the mailbox it is just fine because it is not the end of the world if you miss a message or get a false trigger

3 Likes

It probably depends on where you live also.

There is some commercial products that are selling this kind of functionnality (rfplayer), I don’t know if it is worth the money. But reading your experiences it seems a difficult task.

No headache after 50W of RF :slight_smile: ?

Sorry I shoukd have been a bit more clearer.

My plan would be to run them off a battery but have the communication or activation signals be sent over wifi.

I have seen videos where but you can hard wire pir alarm sensors to a system called connect. Which uses and esp2866 And wire off the shelf pirs into audrino board but these are boards are mains powered. I just like the idea of now power cables and using wifi. Dont mind using a combination of the two mains power and esp2866 etc. My idea stems from i like the goolge nest secure system and the detect sensor
So looking for diy version or similar off the shelf versiona dont want anything too big and clunky lol. Its just an idea at the moment though.

I’d go zigbee and xiaomi sensors. This is a cheap option, battery life and form factor is also excellent.

There are a few options for Zigbee, I personally use zigbee2mqtt (http://www.zigbee2mqtt.io/) but you also have these options (https://www.home-assistant.io/components/zha/)

A battery powered PIR sensor that uses WiFi. That is possible but only in special cases feasible.

Any small device using wifi still consumes a lot of power.
A small Philips PIR sensor will happily report motion for a year on a coin cell because it sends short packages of Zigbee on a mesh.

Your Wifi based box needs to do a lot more work to stay connected to a wifi network.

The only way to do it is to have the device deep sleep and only wake up when it detects motion. If you do that with an ESP8266 and a low power PIR module then it can be done. But each time the PIR sensor triggers the ESP will wake up, connect to Wifi, send its message and go back to sleep. This takes many seconds. You can shorten the time by using hardcoded IP address in the ESP to avoid the comminucation with the DHCP server (fixed IP setting in router still requires this phase and 1-2 second delay). But still the ESP will run for seconds and consume on average 80 mA with 200-300 mA spikes. As a window sensor that is opened maybe 100 times per year max this is possible. For a PIR sensor in a place noone ever comes it may also work. But inside your house where people walk around when you are home the sensor is triggered so often that even with 18650 batteries you end up recharging the batteries way more often

To calculate a power budget you can use an average consumption of 80 mA.

And let is assume you can optimize a wakeup, connect to Wifi, send message, back to sleep in 5 seconds.

We assume a good 18650 Liion cell at 3000 mAh with linear regulator LDO type running an ESP down to 3 V. Let us be optimistic and still assume that we get all 3000 mAh. That is 37.5 hours of operation.

In 5 second periods that is 27000 wake ups. It now depends on the traffic. This may be OK. The cell will self discharge, the sleep current is not zero as the PIR runs all the time and the ESP uses some microamps when sleeping. The LDO must be a low quiescent current type. But still it also consumes some power. But let us say 15000 times. That is 150 days at 100 detections per day or a year if it is only you in the house and no kids running around. And you can always have two 18650s in parallel.
The small things will count. Many PIR sensors will have a timer so they only report a new Motion after a period. A larger period will wake up the ESP less often.
If you want to have an event when Motion has not been detected for a time interval means also waking up the ESP when Motion stops. That doubles the number of wake ups. Staying awake while the PIR interval is on is a disaster for the battery time. Do not even think of that.
You need to know when Motion stops for automations. For pure burglar alarm function the trigger on is OK. But it is nice to be able to see if there is still motion in the room even in alarm applications.

It can be done. But it depends on the application. Many of the examples you find on the net where people build sensors with ESP8266 in deep sleep do not report both on and off. It takes a little more circuit to reset the ESP to wake up on both rising and falling output from the sensor and the circuit has to consume microamps current.

Because of all of this, I use zigbee motion sensors. They report on and off and run on a coin cell.

1 Like

Thanks for this - it really helped me decide a course of action that I feel comfortable with. I have aqara sensor on the way along with a conbee stick.

I do - however - also have all the items lying around for a DIY solution. How are you powering your wifi solution with the D1 mini? This was actually my first choice for my own system - but the powering of the ESP (and the length you have to go to in optimizing deep sleep etc. according to this article by Gammon: http://www.gammon.com.au/power) turned me off the idea.

I do still have a few doors where I want more than just just a open/close status though, so the D1 minis might still get some use. Are you just powering through an adapter of have you had succes in a battery-powered solution?