Gbridge - a Google Smart Home to MQTT bridge

I haven't had a chance to look at this in any detail but it sounds good.

https://about.gbridge.io/

gBridge is an application, that provides a Bridge between Google Assistant smart home devices and MQTT, an open and available messaging protocol that is supported by many smart home applications and devices.

mic "Hey Google, set the ceiling light to 43%." arrow_forward gBridge/u1/ceiling_light/brightness: 43

Since gBridge is an open source project, you can host it on your own systems.

There is both a hosted and self hosted version.

3 Likes

I've been trying this out for a few days and it has worked well. With all the trouble it can be to set up google integration it was nice to have it up and running in literally about 10 minutes.

Is there something like this for Alexa??

Yes, same here.
The MQTT response is really fast, and consistent.

Ah, very cool. While I'm always cautious about using 3rd-party services connected to the house, at least there is a nice easy way to get started before setting up a home server.

I did check out the Ts&Cs and the privacy page. The former seem OK, the privacy page is rather lacking as it only refers to the web site, not the service. There is an implication that they don't reuse personal data but it isn't explicit which isn't so good. But being based in Germany is good as they are generally pretty strict.

I'll definitely be trying this out at some point to complement my Telegram bot and home dashboard. My Wiser heating system already has Google Home integration but being able to use "scenes" to control multiple rooms via Node-RED would be nice.

I noticed a few days ago, that some new features have been added, see this post.
Two of the features in particular caught my attention;

Acknowledgement

Hey Google, turn on {device name}
Are you sure you want to turn on {device name}?
Yes.
OK, turning on {device name}

and

Acknowledgement

Hey Google, turn on {device name}
Can I have your security code to turn {device name} on?
1234
OK, turning {device name} on

1 Like

Link - gBridge service closing

Hi there :slight_smile:
I'm really bad in code and need some help.
When I use the bridge I gott a long message from it sent to my Mqtt. See below.
I want to use an IF in a function node to have a response on the state "true" / "false" and send on / off instead to the mqtt.
Please help.

{
  topic: "",
  name: "Light"
  raw: {},
  payload: {
    command: "action.devices.commands.OnOff",
    params: {
      on: true
    }
  }
}

Lots of ways, but here is one using a ternary operator...
Try the below code into a function node.

let result = msg.payload.params.on? "on" : "off"
return { payload: result }
[{"id":"88c190a4645879b4","type":"inject","z":"217df193.d774ce","name":"True","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\":\"action.devices.commands.OnOff\",\"params\":{\"on\":true}}","payloadType":"json","x":165,"y":535,"wires":[["44d72ed86afee168"]]},{"id":"3d2d01e6919ffd4a","type":"debug","z":"217df193.d774ce","name":"debug 29","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":455,"y":550,"wires":[]},{"id":"44d72ed86afee168","type":"function","z":"217df193.d774ce","name":"function 7","func":"let result = msg.payload.params.on? \"on\" : \"off\"\nreturn { payload: result }","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":305,"y":550,"wires":[["3d2d01e6919ffd4a"]]},{"id":"c04febdc6d16de87","type":"inject","z":"217df193.d774ce","name":"False","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\":\"action.devices.commands.OnOff\",\"params\":{\"on\":false}}","payloadType":"json","x":165,"y":575,"wires":[["44d72ed86afee168"]]}]
1 Like

Thank you so much :slight_smile:
works perfect and I have learned new things!

Thank you for fast and nice response!

Have a nice day.

sincerely
Ola A in Sweden.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.