Showing posts with label Google Assistant. Show all posts
Showing posts with label Google Assistant. Show all posts

Wednesday, December 18, 2019

A New Standard for Home Automation

Big news this week, Apple, Google, Zigbee Alliance, Amazon, Samsung, Ikea, and every other company in the world are getting together and building a new standard for home automation! Sounds wonderful doesn't it?

Today it is hard to get homelkit stuff to work with Phillips Hue. Google doesn't work with Amazon, and so on. This new alliance will be the answer to the worlds problem. Peace in the middle east, no more starving children, climate change has ended.

Yea right!

Before this standard will be mainstream, it'll take at lease a year before the standard is hammered out, assuming everyone cooperates. Hardware built to meet this standard will come shortly after that, maybe. Will it all interoperate? no one knows.

It'll likely take 5 years or more for the most of these manufacturers switch their devices exclusivly to this standard. Between the time it takes to flesh out the standard, getting the functions needed on these standard, and the manufacturing pipeline, it is just the way things are. No one needs to stall to make this take so long, it just will take that long.  

Standards are written to be slightly ambiguous, for many reasons. Google will interpret one part different than Apple interpreted it, as well as Amazon, so they will work similar, but not totally compatible. It is the way life it. Certainly a zigbee device won't be able to talk to a BLE device, who can't talk to a WiFi device.

This new standard will work in the hubs, and almost no where else. The hubs will talk to the devices that manufacturer built them to work with, and nothing else. That sounds like the way things are today, only there is likely to be more things that work with the Amazon or Google hubs.

What should you do?

  • Wait? that is fine, if you have been waiting and have limited need for home automation. Maybe pick a hub after one is released in a couple years, and a couple minor devices at the same time. After 3-7 years, it will be ok to stick with products that promise to work with the hub you picked.
  • Keep using what you have? If you have something and it is working for you, keep going. No need to change now. Maybe in the future, your protocol will migrate to the new protocol, or the new hub will support legacy protocols. 
  • Pick something and start now? If you want home automation now, then pick something and get started. It should keep working for then next few years, unless the manufacturer changes their mind or goes out of business (and plenty have, including Best Buy, Lowes, and others). 

The home automation landscape hasn't changed a bit with this new standard. Over the last 20 years companies have come and gone in this space. Having a bunch of companies get together and promise a new protocol changes nothing.

Home automation is a little easier than maybe 20 years ago, but it is still someone mostly for tech savvy individuals. Nothing wrong with that. If you are handy with the soldering iron and some coding, the NodeMCU/Node-Red solution will work. If you want plug and play, pick a manufacturer and stay in that eco-system.

Wednesday, April 17, 2019

Voice Control

Almost everything can be voice controlled these days. Ask your phone, and it'll tell you stuff you didn't know you needed to know. Apple, Google, Amazon and others all have voice assistants that can be used for control of appliances, buying stuff or just entertainment. Node Red has nodes that support most of these assistants.

I have been mostly using the Google infrastructure, since it is typically more open. It isn't perfect, but it does allow me to develop apps and write blogs. I have had some success using their tools for automating my home.

NOTE: gbridge is no longer a solution. The company no longer supports this application. 

I am using the gbridge node. The setup is very simple, using a standard MQTT interface to their service. It does take some registration on their web site, and in the google home app. They support multiple levels of usage, and allow self hosting. The self hosting can be done on the same RaspberryPi that Node-Red/Mosquitto is running on. The free service allows 4 devices, and more than that will require a subscription, and you choose how much to pay.

Setting up something simple

In the account on the gbridge site, you can set up various devices, what traits (open, close, on, off, etc) those devices will exhibit and what the topic and payload is allowed. This must be done before adding the node to node red.

I connected this to my most complex flow, and it worked right out of the box! After following the setup steps properly. The flow is very simple:



Just an MQTT input node, a debug node and a connector. The connector goes to the heater flow in the previous post. The single "google voice" node could go right in the heater flow without adding much complexity to that flow.

The MQTT node has some configuration:

The server is the gbridge server. This is another MQTT agent that the Node-Red will talk to . It should be set up as any other MQTT agent is added to node-red (like localhost for any of the connections to mosquitto running on the Raspberry Pi).

The URL will have your user number in it. This is your number, and shouldn't be shared with anyone, unless you want others to control your home. The uNNN is my number obfuscated, so I can prevent you from controlling my house.

Once all that is set, using a google assistant (voice or typing), I enter the command "set sunroom thermostat to 80" and the thermostat setting will change to 80 degrees. The payload from the MQTT node is the temperature.

The voice assistant understands other commands like "make it cooler", "make it warmer", but my flow doesn't know what to do with those commands. The payload from the Google Voice MQTT node will send "3" for make it warmer, and "-3" for make it cooler. This could be used in a function node to adjust the current temperature, but for now, I won't use them. What happens now, the thermostat will be set to 3 degrees if the "make it warmer" command is asked.

There are other topics that can be used by node-red to allow querying the status of the node as well. The "gBridge/uNNN/d1000/tempset-ambient/set topic allows me to ask the google assistant what the current temperature is in the room.

I'd like to ask the current state of the garage as well. I've driven off many times, and been unsure if I shut the garage. MAybe in the next post, I'll show how to do that. I also want to show the library that I have made to simplify the nodeMCU development, and other things. There is lots to come.

Ask any questions.