Background:
2 Sonoff Wifi relays to switch the lights on in the garage
1 Raspberry Pi running as a security camera in the garage with motion detection
I've got them working independently but what I'd like to do is turn the lights on if the camera detects motion. I can run a Python script when the camera detects motion but there's no API or anything to talk to the Sonoff relays.
I've been trying to get my head round webhooks for IFTTT but I'm not sure if I'm barking up the wrong tree. I know IFTTT works with Sonoff so I can do something like turning the relays on at sunset.
What I want to do is:
if raspberrypi calls IFTTT
turn sonoff relay on
I've read several tutorials but I just can't get my head round how this all fits together.
Any ideas gratefully received.
As usual, I spend many, many hours trawling through articles and tutorials only to find that I'm no further forward. I then spend 5 minutes doing the thing that I thought would never work and I'm proved wrong.
If anyone else is interested:
When asked for the "if" bit on IFTTT, search for webhooks and follow the instructions. For the "then" bit, search for ewelink (not Sonoff) and choose the one that suits your circumstances.
You'll end up with something like this:
curl -X POST https://maker.ifttt.com/trigger/garage_motion_detected/with/key/{your_key_goes_here}
Works a treat!
Related
Sorry if I do something wrong, I'm new to this website. I was directed here after asking the following question to google support.
I've downloaded the google assistant onto my raspberry pi and I'm following the instructions as found on your services pages (https://developers.google.com/assistant/sdk/guides/service/python). I've made it to the part where its walking you through turning on an LED wired to your raspberry pi. I activated the "oneoff" trait but it doesn't appear like its working. When I ask my google assistant on my raspberry pi "Turn on" (as the instructions say) it responds, "Sorry, power controls is not yet supported. I've also tried asking it "turn on light". and it responds "The Adjutant isn't available. You might want to try setting it up again." (Adjutant is the name of my project). I've been trying to find the root of the problem, but I have been unsuccessful. I would be much appreciative if you could help me resolve the issue. Let me know if there is any other information that you will need to know to understand the issue. I'm using a raspberry pi 3B
I've gone through the steps again to see if I missed an important step, but I didn't see one. I've looked though other support pages, and searched other tutorials, but they were either outdated, or I didn't fully grasp the content.
Thanks a Ton for your help!
Cody
I have purchased a Ticwatch which is running Android wear OS. I want to read the heart beart data from the device over bluetooth using raspberry pi. I found no resources to do so. But I found a tutorial to do so using Polar H7. Link below:
https://github.com/danielfppps/hbpimon
But the same thing is not doing anything with Ticwatch wear OS.
Can anyone even tell me if this is even possible ?
I haven't done this myself - it's quite likely that nobody has, it's a real corner case - but I have no doubt that it's doable.
Getting the heart rate data on Wear is pretty easy; there's an API to do just that. Here's a SO Q&A with some basic code to do so: How to read Heart rate from Android Wear
Transferring that data to your RasPi is going to be more work, but it's still eminently possible. Both devices support a full Bluetooth stack, but there's no simple API for this, so you'll have to build this piece more-or-less from scratch. On the Android side, a good starting point is Google's Bluetooth Chat sample: https://github.com/googlesamples/android-BluetoothChat
In summary: Anything's possible. Many things are difficult.
I ended up creating my own app on Wear OS. Thanks for all help.
I want to preface this by saying I am learning Raspberry Pi. This is my first real hands on experience. A project I am working on requires our PI-3 to be connected to the internet via a SIM.
We are using the SIM800 Board (https://www.modmypi.com/raspberry-pi/communication-1068/raspberry-pi-sim800-gsm-breakout-board) and a T-Mobile SIM. Please note that the SIM is already activated.
I followed along with this tutorial and used SAKIS3G: https://www.modmypi.com/blog/how-to-connect-your-raspberry-pi-to-a-3g-network. Everything works until the final selection "custom TTY..."
I receive the following error box: "Device did not report GSM capabilities. You can skip this by adding --noprobe command line switch." I have searched high and low for solutions, but there is very limited information. Does anyone here have experience with errors such as this and can point me in the right direction?
I also added the --noprobe suggestion, but it still printed the same error.
I found a work around, hopefully this is useful for someone. Sakis3G seems to be more focused around other SIM card models rather than T-Mobile. I found a really good guide that allows for easy connection (https://www.rhydolabz.com/wiki/?p=16325).
Follow the link's steps and you should be good. The only flaw with this currently is that it requires manual connection every time the pi boots, but this could probably be fixed by someone who knows R-Pi better than me!
I am trying to get the Movesense to work with a Unity BLE asset as originally I thought MS would be simple enough. I have managed to connect to it and subscribed to the "61353090-" starting service and the "34802252-" starting charasteristic. I think I even got some notifications. Now the problem is, that I am not receiving or able to decode any data from there.
I also ended up reading the example codes and found out the complex system the Movesense uses and the "whiteboard", which I am unfamiliar with. I cannot find anything sensible by googling, as whiteboard is a whiteboard :)
Now my questions are:
What should I do to progress? Do I need to write something to the "17816557"?
What is the "whiteboard" actually?
Would it actually be smarter to just make a Unity plugin for the Movesense?
Thank you
Your are quite right that the answer is in the "Whiteboard" component. Whiteboard is the embedded REST framework (Note: it is not over HTTP!) that Movesense uses to implement REST services within as well as inter device (e.g. over UART or BLE). As you can imagine it is not a simple component, so decoding the traffic without Amersports'/Suunto's help is quite a big challenge. The actual BLE layer is simple: one characteristic to each direction (write & notify), the complexity lies in what goes inside that data pipe.
However, if you are trying to use Unity to make a mobile app the situation is not so bad. There has been a prototype of Movesense mobile library integration for Unity (Android) that uses the existing Movesense mobile library. If you ask Movesense team (info (at) movesense.com) they might be able to help you further. For Windows (Unity or plain) there is nothing done (at least not yet) mainly because until Windows 10 there was no official BLE API for Windows.
Full disclosure: I work for the Movesense team
I've seen a lot of projects, tutorials and how-to's on the web regarding the Raspberry Pi.
I've just received my first Pi in the mail, and I can't wait to get tinkering with it.
Of course, doing any of these things is going to be a difficult process, however, as my experience with the Pi is next to none, I wondered about the capabilities of what I want to do with my first major project.
I'd like to be able to build an on-board computer for my car. I've seen several projects regarding this, and I've seen some good guides online.
However, none that I have seen will do EVERYTHING that I can think of....
I'm assuming that my 8GB SD card will be limited to only a selection of these specifications, however, here's a list of what I'd like the solution to be capable of, and if anyone knows any reason why this isn't possible, please give me a heads up :)
So...
I'd like a front-end GUI (on a 7" touchscreen monitor) with a menu to navigate the options, which will include
From this menu, I'd like to be able to select (and of course, run) the following:
Media center (I've seen things like XBMC etc.) - I'd like this to be capable of taking over the radio unit and playign mp3's etc (possibly from my iphone!?)
GPS/SatNav - I don't know how possible this is and I assume i'd need a 3G card or something...
Reverse parking camera (stick a webcam in the rear view window) etc (I've seen good tutorials for this)
Connect my phone with a bluetooth thingy(?) so that I can add a USB mic and play the receiver audio through my speakers (acting as a hands free kit)
I'll add more ideas too...
I'm not questioning if each of these individual specifications are possible, I am asking if they are all possible through one solution as a whole, with a GUI to navigate through them?
Thanks for any help.
Cal.
It is all possible, all in one bundle. 8gb is more than enough for everything, it'll only limit your music collection. The only question is: how much work are you able/capable of doing. That will be the limiting factor, not your Pi.
Short answer is yes, all exist and the pi can handle it. But you'll be writing a lot of custom software to make them interoperate.