Motion sensor - Shelly connectivity

Hi

Question… I want to have a smart motion sensor that can interact with Shelly via HA. I have seen most of the projects have a sensor wired to the Shelly relay but I want it to be wireless. Is that possible?

If so, do I need any extra hardware apart from Shelly, the rasp pi that runs HA, and the motion sensor?

How is the connectivity done between the sensor and HA? Via WiFI?

Thanks

I also just bought 2 Shelly Motion sensors and would like to hook them up to the HA. The Shelly Integration only shows the tracking entities. That can’t be good. Who knows what I’m doing wrong? Or has the solution?

After reading through this link by “the-hook-up” and watching the video on this page, I decided to just use the rest API “binary_sensor”. This way I have HA send a “get” request to my “shelly-motion-sensor” every 5 seconds to get the status of the motion sensor. Its easily displayed in HA after you paste the below yaml into your config and restart HA.

I have included my yaml for the binary_sensor. All you have to do is just change the ip address to the correct ip address of your “shelly-motion-sensor”.

binary_sensor: ...
- platform: rest
  resource: http://192.168.1.99/status
  name: shelly motion
  value_template: '{{ value_json.sensor["motion"]}}'
  scan_interval: 5
  device_class: motion

A quote from his page, “When I’m testing out my commands for a REST API, I like to use the chrome addon “advanced rest client” or ARC.”

To use it just paste this link https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo/related into your chrome browser and click “Launch app” in the top right corner. After you launch the app you can have a look at the retured “js” to include any thing else you might want to as a sensor as-well.

To do this, just set the mode to “GET” then set the url to "http://your-shelly-motion-sensor-ip-address/status. example http://192.168.33.1/status the video linked above explains it all. You can easily set it up to tell you the illumination, rssi and battery percentage info as-well. PS I turned off the cloud crap as-well using the ip address web interface of the shelly so it doesn’t even phone home.

Here are a few more sensors i made using this method. But in this case these yaml example are placed under the sensor section in your HA config not the binary_sensor section like the example above.

sensor:...

- platform: rest
  resource: http://192.168.1.99/status
  name: shelly motion
  value_template: '{{ value_json.lux["value"]}}'
  scan_interval: 5
  device_class: illuminance

- platform: rest
  resource: http://192.168.1.99/status
  name: shelly motion
  value_template: '{{ value_json.bat["value"]}}'
  scan_interval: 5
  device_class: battery

You can find the documentation for using the rest api at this link. https://www.home-assistant.io/integrations/rest/

To answer your question the simplest way. “Yes” via wifi. atleast in the case of you owning a Shelly Motion Sensor, as it connects via wifi.
But in the interest of making this user friendly and intuitive. The answer to your question depends on the motion sensor you plan to use.

First chose one and connect it to HA. there are latterly hundereds of models with lots of different connection methods.

In my case I set up the esphome add-on years ago. I used that to flash an esp32 dev_board with the remote_receiver component. This device is uses a 433mhz rf receiver to listen for my 433mhz rf motion sensors. .
After that’s all setup and working, you can have HA use the state of theses sensors (in this case binary_sensors) to (triger/ toggle/ turn_on/ turn_off) anything you want, even shelly devices like shelly 1,2 or 2.5

Hey there,

sorry, edited my entire post

I found out how to get the Shelly Motion Sensor to update it’s state to Home Assistant via another topic on this forums:

In short:

  • Enter the local ip of your home assistant server with port under Internet & security > COIOT and don’t forget to enable COIOT.
  • Reboot the motionsensor
  • I restarted HomeAssistant to be certain

After these steps the motionsensor started updating it’s states without needing the RESTapi workaround.

1 Like

i Recon This. After loosing all my Hair and 3 days later I was able to make them work!

1 Like

Hi,

I have everything working but randomly my sensors tend to brick or drop offline. I have to reset them and do it all again. I’m not talking about once in a month or so but almost every day.
I have 7 sensors and they all have the same problem.
I hope and pray that Shelly will come with a new FW soon to solve this.

At this moment I don’t recommend to buy Shelly Motion.

I have about 30 motion sensor from Shelly. And only a select few do have issues . Still didn’t figure out why …

Im having problems with new Motion 2 by Shelly. I connected 1 to my home network

I can see it if i search for it with the IP adress of the device.
colot is also activated. with the IP Adress of my Home Assistant (Found in the TP DECO APP)

But i cant find it in HA


its just not discoverble…

I have no clue what to do…