With Wyze recently coming out with their Wyze Sense motion and contact sensors I decided to incorporate these into my Home Assistant setup to create my own home security system (among other things). I’ve done this by creating 4 individual IFTTT applets, adding hidden input_booleans for each sensor, creating HA sensors that follow the value of the input_booleans, and then tracking IFTTT webhooks through Node-RED. Here’s how I went about it:
Setup devices in the Wyze app, naming them accordingly (i.e. kitchen_sensor) so they can flow over to HA
In IFTTT, create a new applet, selecting Wyze Motion Sensor or Contact Sensor as the trigger
For action, choose ‘Webhooks’ make a web request, setting up your URL and other fields as shown below. Note: I had to disconnect and reconnect IFTTT to get my custom webhook URL as well as remove ‘:8123’ from it to get it to work.
In Node Red, setup the following nodes: ‘events: all’, ‘switch’, and ‘call service’ as shown below. This receives the IFTTT webhook, ensures it’s a motion_sensor or contact_sensor (and allows us to expand off of the webhooks receiver later on), and then updates the associated input_boolean for the device triggered.
I hope you all find this as useful as I do. I just ordered more contact sensors and motion sensors for Wyze this morning. In all, my home security system will consist of 2 cameras, 12 contact sensors, and 5 motion sensors, with all of that only running me ~$150 from Wyze including shipping.
Also, in case you like the sensor images, here they are as well:
How did you go about doing this with out node red? Keep in mind I’m just getting started with HA, your response could go right over my head. If you could share your code and point me in the right direction I would appreciate it. I’m not much of a coder…but i’m really good at copy-paste-edit lol!!!
sorry it took me a minute. but its basically the same except the json data in the webhook from ifttt. i use it to turn on and off the input booleans made from the code above
It was easier than expected. I created a boolean, and have a webhook to trigger a automation when the sensor opens and another webhook and automation to switch it back off when the sensor closes. Much simpler than what described here but it works.
I did something even simpler. I just added a literal json message: motion and message: clear in the body of my webhooks. I have a switch node, with node red, to check if the payload (msg.payload.event.message) is either set to “motion” or “clear”.
I may set it up with an input boolean and automation, but I’m pretty happy with my simple solution.
If you’re trying to do this outside of Node RED I think this is how the automation would look. It passes as a valid configuration but I have not tested it.
@Bunnywinkles I am trying to do same automation all in HA, but can’t seem to trigger it. I know IFTTT applet is running and posting data to the webhook. But HA automation never triggers. Do you mind posting your code for automation?