Outdoor wireless motion sensor

Good guys, I also look for a solution like that. What I edited thinking about doing was take my motion sensor and make it “smart” with a shelly 1. That is, the sensor detects motion and activates the shelly which in turn would change the state to on in HA. Then just create automations with this state of shelly. Is it viable? Has anyone tried something identical?

If you want to interface to an existing motion sensor you can use these. They basically add Z-Wave to the motion sensor

1 Like

@sparkydave Thanks for the suggestion but I still don’t use z-wave. I had a preference for Wi-Fi or zigbee. Are there alternatives? Thank you very much for your attention.

For the low cost of a Aeotec Z-Stick, why not add Z-Wave to your system?

If you really want to go with wifi then I would suggest putting a Wemos D1 Mini into the PIR and wiring to a digital input on that. Program the D1 Mini with ESPhome and you are set. The issue is that you will have to provide a 5V supply, which you can get from the (asuming 12V) PIR power using a step-down power supply… but more bits to fit in the PIR and more effort than just addin Z-Wave…

1 Like

@sparkydave I was thinking something like this. As I have an outdoor focus I could use this toturial to be able to control other outdoor lights.

So are you referring to a motion sensor that is part of a light fitting?

Yes. Because I didn’t want to be implementing more z-wave technologies and at the same time taking advantage of this sensor. I think this toturial will be a good solution.

Returned to report that I excluded/included these today while working on the side of the house and they now show up correctly. openzwave must have been updated since I created this post.

Love this thread. I ended up using my guardline system that I already had. The guardline motion sensors are wireless and have a 1/4 mile range and do really well in nasty weather. Its weird because it supports multiple sensors but only has one 12v relay out for accessories. I opened the hub and realized that it has an LED per zone. I measured the voltage on that LED when it was triggered and WALLA! - 2.7 volts - perfect for the D1Mini.

Using ESPHOME, I now have four zones that talk to HA. All my sensors are extremely far from my house. It works perfect.

4 Likes

I was considering something similar.
Any chance you could post a more in-depth tutorial for accomplishing this with the Guardline (Assuming someone technically proficient, but not as familiar with ESPHOME/similar. )?

For ESPHOME the best thing I would recommend is watching DrZz videos. He has a ton of different things he does with ESPhome. https://www.youtube.com/channel/UC7G4tLa4Kt6A9e3hJ-HO8ng/videos

I got the idea by watching his video on his window opener. (I also made a chicken coop door doing the same thing) https://youtu.be/BjXUg_-tM84?t=195

When you understand ESPHome, you will understand the below code (called a sketch that you upload to the D1Mini)

esphome:
  name: guardline_hub
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: ""
  password: ""

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  password: ""

binary_sensor:
  - platform: gpio
    pin: D0
    name: "front_driveway_zone"
    filters:
      invert:
  - platform: gpio
    pin: D2
    name: "chicken_coop_zone"
    filters:
      invert:
  - platform: gpio
    pin: D5
    name: "shop_front_zone"
    filters:
      invert:
  - platform: gpio
    pin: D6
    name: "shop_rear_zone"
    filters:
      invert:

I inverted my sensors to be on instead of off, but you can remove that part.

You can power the D1Mini and your guardline hub from the same power supply and then all you have to do is connect the positive side of each LED to a programmable pin to the D1Mini. In my sketch you can see what pins I am using. I probably need to update my sketch because sometimes the ESPHome repeats the trigger a couple of times when triggered.

The great thing about ESPHome, is after you do your initial setup using USB, you can update your ESP device over the air from that point on. I absolutely love it! I send updated sketches to my chicken coop door D1Mini all the time and its 200 meters away inside a large chicken coop. Its so awesome.

I hope this helps. I hope to do a video on it when I get better at this stuff.

3 Likes

Thanks for sharing this!

I’ve been using the NC/NO contact on the Guardline receiver to trigger HA automations, but @specsix approach is way better; once I teach myself ESPHome LOL.
I know what I’m hacking this weekend! Thanks!

2 Likes

Here’s my Guardline receiver (aka hub) LED-to-GPIO hack. Above is an old, re-purp’d raspberry pi v1 Model B:

Great idea @specsix !
Mine is the “500-ft range” version of the guardline receiver/sensors. Mounted the receiver up high for better signal reception.

Pictured: Zone 4 was triggered (LED illuminated)

2 Likes

@specsix @inkylatte
On the Guardline, there are three recessed screws, which I assume are needed to get inside. Do you know what type of screw driver is needed for those screws? I have tried multiple Phillips heads with no luck.

it’s a small phillips head screwdriver. There’s a trick to getting the cover off: there’s a 4th recessed screw. i’ve written notes about that and other details in an article here

I was able to get it apart. it turns out I was engaging the screws and they backed out, but they would not pull out of the cavity, and the clamshell would not separate easily. So it seemed like they were not turning.

In your RPi implementation, is the RPi also running hour HASS?

I can program a D1 Mini and power it from the Guardline RX, but am interested in how my HASS RPi might be programmed to pick up those GPIOs. This would be a new challenge for me.
maybe this page on rpi_gpio? any others resources?

I’ve dedicated a raspian RPi for this (My HA machine is a laptop-server).
i wrote a python script that runs as a systemd service on a filesystem that’s mounted read-only, so I don’t have to worry about SD card corruption.
When the gpio pin goes high, the script sends a ON message to my mqtt broker.
I wasn’t using esphome when i built it. If i were to do it today, i would use a nodemcu on gpio pins and esphome. Then i’d get binary sensors in HA with no fuss, no code.
And the nodemcu is $4, vs. my RPi
But the advantage of using a Pi: I have hard-wired ethernet cat5 cable instead of wifi, which i prefer for reliability.

Thanks @inkylatte and @specsix
I got mine up and running. I am not good a soldering wires onto the nubs of thru-holes pins, so I removed the LEDs and soldered wires into the thru-holes. This allowed me to put a 1.8k ohm resistor across the LED+ to ground wire, resulting in ~3V to the RPi when a zone goes off.

This bit of code in my config file worked perfectly

binary_sensor:
  - platform: rpi_gpio
    ports:
      17: Zone1   #pin 11  Yellow
      27: Zone3   #pin 13  White
      18: Zone4   #pin 12  Red
      22: Zone2   #pin 15  Grey

Nice! that’s another way to do it and on your Pi running Home Assistant :+1: