Please login or register.

Login with username, password and session length
Advanced search  

News:

The X10 Community wants to know how you use your X10 system!
Share your story in the Automated Home Showcase.

Pages: 1 [2]

Author Topic: Google Home and X10  (Read 621 times)

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 237
  • Posts: 6852
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: Google Home and X10
« Reply #15 on: December 06, 2017, 04:33:31 PM »

Using web hooks with IFTTT one may be able to trigger HA-Bridge devices.
However you'll need to be sure you have security enabled for the bridge.
I'll experiment with this over the next few days.
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 237
  • Posts: 6852
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: Google Home and X10
« Reply #16 on: December 06, 2017, 06:16:27 PM »

Using web hooks and IFTTT will work. However since the device IDs can change in the bridge this would be unstable B:( 
I believe I can get this to work however using the web server in PCC.(ultralite)
If so I'll re-write it for Alex10 making it even simpler.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum

lazydiyer

  • Newbie
  • Helpful Post Rating: 6
  • Posts: 4
Re: Google Home and X10
« Reply #17 on: December 08, 2017, 08:37:09 PM »

Part One:

Hi to anyone interested.

So here is a simple tutorial on getting Google Home to control your X10 devices, as of Dec 8, 2017.
I originally tried to write a very brief tutorial but I tend to be wordy when writing, so it expanded
quickly.

I'm not used to writing pure text tutorials so please forgive any lack of clarity.
I'm going to assume most everyone using X10 on this forum is at least a little bit of a tinkerer,
so I'll keep the info at a fairly high level except for the IFTTT details which is where I think the
help is really needed. I'll be as specific on the IFTTT steps as I can be.


First a really brief overview so you can see what we are trying to do.

Controlling X10 devices with Google Home consists of a series of links in a chain:

1] You issue a voice command to Google Home
2] Google talks to IFTTT, changing your voice command to a digital instruction.
3] IFTTT interprets the digital instruction, and performs a pre-defined action
    - in our case it sends a web command to X10 Commander on our home server
4] Melloware's free X10 Commander software then interprets the web command and sends the
   equivalent X10 command to our X10 device over the powerline.

The whole process is ridiculously fast and in practice a light will turn on in just 2-3
seconds... which is a very natural feeling pause if that makes any sense to anyone.


Okay, lets get some preliminary info out of the way. It will make the explanation easier if you
are clear on the pieces of info you need at each step.

WAN_IP  - this is the internet address of your home router or gateway, as seen from the outside.
        - for example, as if you were connecting to home from your work computer.
        - an easy way to get this is visit ipchicken.com and make note of the address they display

WAN_PORT - this is the port you will connect to on your router, from the internet

LOCAL_IP - this is the local address of your computer as seen on the 'inside' of your router,
           or the inside of your home network if thats clearer.
         - in windows, run cmd.exe and then type 'ipconfig" and check for the line labeled
           "IPv4 Address". it usually looks like 192.168.0.xxx or 10.0.0.x, etc.

LOCAL_PORT: X10 Commander uses port 8086 by default

DEVICE_NAME - just the X10 address of the device we want to control
            - I'll use 'A3'

DEVICE_STATE - set to either ON or OFF

-----------------------------------------
PART TWO FOLLOWS IMMEDIATELY BELOW
-----------------------------------------
Logged

lazydiyer

  • Newbie
  • Helpful Post Rating: 6
  • Posts: 4
Re: Google Home and X10
« Reply #18 on: December 08, 2017, 08:45:19 PM »

PART TWO


Now, lets get started with IFTTT.

Go to ifttt.com and sign up for an account.

Hint: sign into a Chrome browser first, with the credentials you use for Google Home. Then when you go
to IFTTT, tell it to use google credentials and IFTTT and Google will just link everything up for you.
Easy! To clarify, IFTTT is already a registered service with Google Home so they already know how to
talk to each other. All we're doing is linking _our_ Google Home with _our_ IFTTT commands.


IFTTT stands for if THIS then THAT.
'THIS' is known as a trigger.
'THAT' is known as an action.

So what we're really doing here is assigning a specific action(s) to a specific trigger(s).
In our case, the TRIGGER is a spoken phrase sent to IFTTT via Google Home.
And the ACTION we would like to take is to send a web command to X10 Commander on our home server.

STEP BY STEP:

Sign in to IFTTT

From the top menu, click 'My Applets'

On the upper right side of the screen, click 'New Applet'

Click the big blue '+this' link

Click 'Google Assistant'  << GA is what actually makes Google Home smart

Click 'Say a Simple Phrase'

Fill out the form:

  Q. What do you want to say?
  Type: Turn on the front door light

  Q. What do you want the Assistant to say in response?
  Type: Banana

  Q. Language
  Select English... or whatever

Click 'Create Trigger'


Now, click the big blue '+that' link

Click 'webhooks'  << this is the magic, and why all of the older youtube examples fail

Click 'Make a Web Request'


**************************************************************
Okay, we're going to pause here and construct our web request.
It should be formatted like this:

ht tp://WAN_IP:WAN_PORT/?x10command=DEVICE~sendplc~%22DEVICE_NAME%20DEVICE_STATE%22

where WAN_IP, WAN_PORT and DEVICE_NAME were defined above



A _real_ example (although I just made up the WAN_IP address):

ht tp://66.131.88.125:38000/?x10command=DEVICE~sendplc~%22A3%20ON%22

where WAN_IP = 66.131.88.125
      WAN_PORT = 38000
      DEVICE_NAME = A3
      DEVICE_STATE = ON


Quick note: "sendplc" above is the 'send powerline command', which works for the CM19 controller
for sure but 'should' work for other controller devices too

Now back to IFTTT's action setup...

*****************************************************************

Fill out the form:

  Q. URL
  Type in your constructed URL _precisely_.
  Every letter and symbol matters.

  Q. Method
  Type: Get

  Q. Content Type
  Select: application/w-www-form-urlencoded


  Click 'Create action'


And that should be it for IFTTT.



The last part of the puzzle is setting up port fowarding on your home router to accept
traffic on port: WAN_PORT and sending it to your home server at LOCAL_IP:LOCAL_PORT.
Setting up that part is not really hard but the specific instructions vary widely between
hardware models. Just google your router model and the words "port forward" and you
should find tutorials for pretty much everything.


And of course, you should have X10 Commander installed on your windows server.
There's really nothing to configure beyond what X10 control device you're using.
I use a CM19, so I selected that from the dropdown in the upper right corner of the
software.


Test it out:

Say "Turn on the front door light"

And GH should reply with "Banana".

Okay, you don't have to get it to say banana, but you'll want to use unique responses at first
to help troubleshoot any problems in your setup. I just like the word banana.
I also like minions :)


And finally, repeat.
It should be easy to add any number of commands, while simply substituting DEVICE_NAME and
DEVICE_STATE.


I'll leave this tutorial here. Its very wordy already but I hope it helps a few people out.
I'm new to the forum but I'll try to pop back in now and then to see if there are any questions
I can help with.

Good luck.
Nope, don't need luck. Should be fine.
Have fun !

Lazydiyer

PS> None of this works without the free software X10 Commander from Melloware.
Its not very pretty but it is VERY flexible. I invite you to buy either their iphone
or android app as support and a thank-you for making this software available.

L.



Logged

Knightrider

  • Community Organizer
  • Hero Member
  • **
  • Helpful Post Rating: 58
  • Posts: 1376
  • I want my BVC
    • This Automated House
Re: Google Home and X10
« Reply #19 on: December 08, 2017, 09:55:54 PM »

I'd give you a +2 if I were able. Enjoy this +1 on me. #:)
Logged
Invented in 1975?  Why doesn't everyone have it?

Satisfied BVC user since November 2007

Proud Supporter of Xenia Kids and Robots. 
Introducing kids to high technology and teamwork since 2009.

Check out This Automated House

HA Dave

  • Community Organizer
  • Hero Member
  • **
  • Helpful Post Rating: 169
  • Posts: 5896
  • I have no superpowers. I guess I am the villian.
Re: Google Home and X10
« Reply #20 on: December 09, 2017, 12:43:58 AM »

I'd give you a +2 if I were able. Enjoy this +1 on me. #:)

I'll chip in the other one!

Great and very helpful effort lazydiyer. You did great. Now... literally ANY X10 user with a spare PC or laptop and either a CM15A or even a CM19A ($17).... can use the Google or Amazon device to control their X10.... for as little as ZERO dollars.

Thank you!


P.S. the Melloware link again:  https://melloware.com/x10commander/
« Last Edit: December 09, 2017, 05:18:25 PM by HA Dave »
Logged
Modern automation is much more than turning things on and off.
The use of Home Automation is limited... only by our imaginations.

Brian H

  • Community Organizer
  • Hero Member
  • **
  • Helpful Post Rating: 282
  • Posts: 12149
Re: Google Home and X10
« Reply #21 on: December 09, 2017, 05:55:25 AM »

Thank you for the information and the work that went into it.
+1 from me also.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 237
  • Posts: 6852
  • I don't work for X10, I use it successfuly!
    • Tuicemen Software
Re: Google Home and X10
« Reply #22 on: December 09, 2017, 07:22:13 AM »

lazydiyer, nice write up! #:)
Very helpful.
As I suspected web hooks were used!
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Find extra info @ My forum
Pages: 1 [2]
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.