OpenGarage › Forums › Comments, Suggestions, Requests › OpenGarage integration Google Home – Door status?
Tagged: google home
- This topic has 11 replies, 5 voices, and was last updated 5 years, 4 months ago by Ray.
-
AuthorPosts
-
March 5, 2018 at 11:21 am #1026
LesParticipantHello,
I’m looking at purchasing an Opengarage for some seniors who aren’t too tech savvy. They do however love their google home, and I was hoping to be able to use GH to get a status on the door. What I believe would be a simple “Hey google, is the garage door open?” and get back a “The door is closed/open” heck even an on/off would be good. But from reading through the forum I haven’t found this so hoping to get some clarification.
If at all possible I would like to perform this without opening ports on the firewall. I wouldn’t mind having a pi or similar running node-red or something if required to make this work.
I should note that through the forums I get the understanding that through the blink app’s webhook you can connect google home to ifttt to send the command to close/open the door which is great. 🙂
March 5, 2018 at 9:43 pm #1033
lawrence_jeffParticipantI think you can hack together open and close with Google -> IFTTT -> Blynk
Querying device status is a different matter, I’m not aware of anything there for Google, You need a web service that supports Assistant queries.. IFTTT doesn’t handle that natively, Blynk doesn’t either.. so unless someone has written a bridge service, I’m not aware of any options.
If you want to use Alexa or Apple Homekit as alternatives you can find instructions for both in the forum.
March 6, 2018 at 12:06 pm #1034
LesParticipantThanks for the quick response. I found Google Home Helper but I don’t think it would integrate with Blynk.
So i started searching for a bridge (none exists), but I’ve looked through a few assistant tutorials and I think I could create one and happy to share if it works. The question becomes approach, hopefully you can shed some light here.
If I understand correctly Blynk has a public facing site with webhooks to allow for opening/closing the garage.
1. Is there a webhook to return status? If so what does it return open/closed,exact distance?
2. If there is no webhook, does the firmware monitor status and can it notify a service upon change? -i’m thinking a command to enter status into a google sheet: https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/range?valueInputOption=valueInputOption or probably better for mass use instead of individual would be to post to a google firebaseMarch 7, 2018 at 10:54 pm #1044
lawrence_jeffParticipantBreaking this up a bit
As long as you have the OG setup with Blynk it will keep Blynk up to date upon change (and every 15 seconds) So if we know Blynk knows the status and is available via the internet.TO RETRIEVE STATUS ON REQUEST
To get status you just do a normal web request (HTTP GET) to http://blynk-cloud.com/auth_token/get/pin (https://blynkapi.docs.apiary.io/#reference/0/write-pin-value-via-put/write-pin-value-via-put)Where auth_token is your blynk token and pin depends on what you want to read the door state its virtual pin 0.
So you need code that takes the request of “Is the door open” and then makes the request to Blynk to get the value of the pin and then returns the status.
TO CHANGE STATUS ON REQUEST
Same thing here accept the request is http://blynk-cloud.com/auth_token/update/pin?value=valueMarch 8, 2018 at 12:31 am #1053
RayKeymasterAs Jeff said, you can use Google -> IFTTT -> Blynk route. This is actually what I use at the moment, so that I can speak to my Google Pixel 2 when I need to open my garage door. Basically, you can go to IFTTT to create an ‘applet’ that connects your Google home with a ‘web request’. The web request is in the form of:
http://blynk-cloud.com/your_blynk_id/update/v1?value=1
where your_blynk_id is the blynk id.The only quirk is that setting virtual pin 1 (v1) to 1 will keep the relay engaged, so I always have to go to the Blynk app afterwards to release the button. Otherwise the relay will keep engaged and won’t allow you to trigger a click. This can be easily fixed by adding something in the firmware, I just haven’t got around time to do that.
March 8, 2018 at 3:02 pm #1054
LesParticipantHey Ray, Jeff,
Thank you both for the answers.
Let’s start by tackling the status request, then the setting. So to get the status we need to perform the get request:
http://blynk-cloud.com/auth_token/get/V0 Please let me know if it’s not V0What answer do we get back if its open vs closed? I’m going to start working on the app to interpret results and communicate with Blynk & Assistant, will write after I get somewhere.
March 8, 2018 at 3:38 pm #1055
lawrence_jeffParticipantI would look at the code for the IOS/Android app – this is the approach it uses to reflect whether the door is open or closed and to open/close it upon button push.
One relevant file is this oneJeff
- This reply was modified 6 years, 8 months ago by lawrence_jeff. Reason: Addded link to relevant file
March 13, 2018 at 9:20 am #1064
LesParticipantHey Jeff, thanks for the link….I see 3 references.
Some of the reference/docs are perhaps a little dated, because I see reference to OG checking if the garage door is open before opening and same for closed which i believe is in the latest firmware. Also only found pin V1 for triggering as opposed to separate pin for open vs close command (and V0 as mentioned above for status).So I’ve had success in creating the app, will publish instructions in next post. If someone would like to test it please let me know how it works. I’m hoping to get my OG in a month or so, will test then.
Note: I’ve made two assumptions (which most likely need adjustment based on what the proper PIN is for blynk to open vs close):
OPEN = “http://blynk-cloud.com/your_blynk_id/update/v1?value=1”;
CLOSE = “http://blynk-cloud.com/your_blynk_id/update/v2?value=1”;
I should also note I saw on the selling page “Remote access through cloud-based app for iOS and Android.” so if cloud app other than blynk also has webhooks it would also be possible to use that instead of Blynk.March 13, 2018 at 9:29 am #1065
LesParticipantAttached are
1. Instructions for setting up an Open garage agent for Google Assistant to communicate with OG through Blynk api
2. OpenGarageAgent.zip – the agent to import into DiagFlow
3. opengarage_firebase.js – the code to load into FireBase to process request. Must insert your Blynk api key.Notes:
1. Open and close links may need to adjust the pin (v1 and v2 currently)
2. Not currently able to authenticate directly with Blynk so api key must be added to firebase code.
3. It’s a work in progress so feedback welcome.
4. If your interested in running in your own node.js server instead of firebase, let me know.- This reply was modified 6 years, 8 months ago by Les.
Attachments:
You must be logged in to view attached files.May 19, 2019 at 12:11 pm #1637
adam gParticipantHere’s an update to the JavaScript for the fulfillment: https://pastebin.com/derwZmE2. The trick was to sleep 2s then set the v1 and v2 pins back down to 0. Now I can open and close with the button, remote, and Google Home. Also, I had to set my Firebase project account billing to blaze to get it to request out to blynk, so this isn’t free 🙁 I’ll probably move it to homeassistant.io at some point.
It mostly works for me, except sometimes Google thinks there’s a real door called “garage”, so I sometimes have to say “Tell the garage door to open the garage door” after fiddling with the agent’s intents.
- This reply was modified 5 years, 6 months ago by adam g. Reason: .js file failed to upload, clarified the difference and trying a .js.gz along with a pastebin link. 🤷
Attachments:
You must be logged in to view attached files.July 20, 2019 at 7:00 pm #1782
whioParticipantI thought I’d have a go at this but I’m getting stuck.
The instructions refer to a webhook. I’ve constructed the URL http://ip:port/cc?dkey=xxx&click=1
However instead of opening the door, I get the result.
{“result”:1,”item”:””}I think that if I can get this working then the next step is to link this with Sinric, IFTTT or similar as that’s already linked into Google Home. Does that sound right? Does anyone have any idea what I’ve done wrong with the webhook?
Thanks!
July 21, 2019 at 3:18 pm #1783
RayKeymasterresult:1 means the command is successful. You can take a look at the API document to see the result status code:
https://github.com/OpenGarage/OpenGarage-Firmware/blob/master/docs/ -
AuthorPosts
- You must be logged in to reply to this topic.
OpenGarage › Forums › Comments, Suggestions, Requests › OpenGarage integration Google Home – Door status?