VoxCommando

Help and Support (Using VoxCommando) => VoxCommando Basics and Core Features => Topic started by: IKROWNI on November 29, 2016, 11:52:05 PM

Title: IFTTT or how to integrate with home assistant
Post by: IKROWNI on November 29, 2016, 11:52:05 PM
I have home assistant on my raspberry pi with a few other home automation programs. I wish vox could run on it as well.But since that doesnt really seem like an option at this point i need to find another way to trigger events from home asistant on my raspberry pi to my voxcommando on my windows pc.

The whole reason for this is because as far as i know vox isnt compatible with the echo dot so i am using home assistant so that i can give alexa commands to turn various things on/off.

I've been tinkering with iftt and im kinda confused by how you guys go about getting ifttt to work with voxcommando. I see some people saying to use the maker channel, some saying to use the watcher plugin in vox, and other methods with dropbox.

If someone could help me with setting up ifttt to send messages from home assistant to vox to trigger events or if you know another way to have alexa find devices through vox and control them that would be even better.

Thanks as always guys
Title: Re: IFTTT or how to integrate with home assistant
Post by: jitterjames on November 30, 2016, 07:45:14 AM
Maker is probably simpler and faster but you must use port forwarding. If you are comfortable with that, then choose maker.

https://ifttt.com/applets/306969p-announce-iss-overhead-with-voxcommando
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on November 30, 2016, 08:40:44 AM
I've been tinkering with iftt and im kinda confused by how you guys go about getting ifttt to work with voxcommando. I see some people saying to use the maker channel, some saying to use the watcher plugin in vox, and other methods with dropbox.

The other solution is to use an IFTTT recipe that saves a file to Dropbox. Then, in VoxCommando, you set up the Watcher plugin to "watch" for new activity in that Dropbox folder. So, this is a single IFTTT solution, not 2 separate things.

This means, of course, that you need to have Dropbox installed on the same LAN as VC.

http://voxcommando.com/mediawiki/index.php?title=Plugin_Watcher

Watcher can watch any folder on your network, not just the Dropbox folder. However, in order to integrate VC with IFTTT, we use IFTTT's Dropbox service.

The Dropbox IFTTT service allows you to create and save a text file to your Dropbox account.

The Watcher plugin can either :

a. generate events in VC when it spots new activity in the Dropbox folder; or

b. automatically process a text message saved to a text file in the watched folder, if the message follows VC's standard API syntax (e.g. TTS.Speak&&Alexa is turning on the living room lights). VC then executes that action automatically. In IFTTT, one of the Dropbox services is to save a message to a text file in Dropbox.
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on November 30, 2016, 08:52:27 AM
And this is way beyond me as I'm not familiar with MQTT or Home Assistant, but:

Scanning the Home Assistant site, it looks like it can communicate via MQTT and also works with Vera devices. If you are using either of these, maybe there's a way to communicate with VC either through tthe MQTT plugin or the Vera plugin.

I don't want to open a can of worms there, but it may be worth exploring.
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on November 30, 2016, 09:02:54 AM
You should also investigate all the different ways that Home Assistant can issue notifications.

https://home-assistant.io/components/notify/

Looks like there are a lot of options. I don't know if the Raspberry Pi and VC are on the same LAN, but if so, maybe it would be possible for the Watcher plugin to directly "watch" Home Assistant's config/ folder -- no IFTTT necessary.
Title: Re: IFTTT or how to integrate with home assistant
Post by: jitterjames on November 30, 2016, 12:14:01 PM
You can probably also send messages to VC with http get or something.

Best to avoid ifttt if possible.
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on November 30, 2016, 12:44:00 PM
You can probably also send messages to VC with http get or something.

+1
Title: Re: IFTTT or how to integrate with home assistant
Post by: IKROWNI on November 30, 2016, 03:36:05 PM
You guys/gals are simply the best! I'll try a few of these ideas tonight thanks everyone.
Title: Re: IFTTT or how to integrate with home assistant
Post by: IKROWNI on November 30, 2016, 05:04:16 PM
Scanning the Home Assistant site, it looks like it can communicate via MQTT and also works with Vera devices. If you are using either of these, maybe there's a way to communicate with VC either through tthe MQTT plugin or the Vera plugin.

So i checked out the mqtt documentation found here

https://home-assistant.io/components/switch.mqtt/

And ive setup a switch that looks like this in home assistant

Code: [Select]
#switch 1
- platform: mqtt
  name: "Fan"
  command_topic: "HomeAssistant/Events/"
  payload_on: "VC.TriggerEvent&&Fan On"
  payload_off: "VC.TriggerEvent&&Fan Off"

This created my switch properly in home assistant and i can flick it on and off but i think i might be looking at this wrong as far as how its supposed to work because when i click the switch in home assistant i can see this in the vox logs.

(https://voxcommando.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FS6OwP8m.png&hash=ca4b4fbf5adf06e5a316aa83af1b7547f4d1e1dd)

Code: [Select]
MQTT.Topic.HomeAssistant/Events/ pops up in vox so i can see that clicking the button in home assistant is getting through to voxcommando but its not sending the events i need it to send for on/off. When i click the button on i was hoping for it to send through something to vox in the shape of VC.TriggerEvent&&Fan On and from there i would just drag that event into the command editor in vox.
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on November 30, 2016, 05:15:17 PM
Cool. It's neat to see that VC's MQTT plugin can be used for this.

James has limited availability/Internet access right now and he's probably the only one who can usefully answer questions about MQTT stuff.

To me, it looks as though the plugin is monitoring "Topics", so your Topic line is what is generating the event in VC.

If you roll over the "MQTT.Topic.HomeAssistant/Events/" event that is being generated, does it show any attached payload values?

Did you need to do anything in VC's MQTT plugin?

Title: Re: IFTTT or how to integrate with home assistant
Post by: IKROWNI on November 30, 2016, 05:20:44 PM
(https://voxcommando.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FGQsHdRm.png&hash=fd3fad9b2a07671df2f0011326f4de1780da548a)

So it is getting the payloads attached
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on November 30, 2016, 05:29:11 PM
OK, that's cool.

Rather than setting your payloads to be "VC.TriggerEvent&&Fan On", use just the voice command phrases you would use to issue the commands in VC (don't include "VC.TriggerEvent&&").

For example, if your voice command to turn the fan on or off is "Living Room Fan On" or "Living Room Fan Off", then the payloads in your script in HA should match the phrases exactly.

Then you can use a catch-all command in VC that passes payload {2} to a VC.TellVox (http://voxcommando.com/mediawiki/index.php?title=Actions#TellVox), like so:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.0-->
<command id="55" name="Monitor Home Assistant events" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>VC.TellVox</cmdType>
    <params>
      <param>{2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>MQTT.Topic.HomeAssistant/Events/</event>
</command>

Though I don't think you need such a long Command Topic path, if this is how it's working.

Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on November 30, 2016, 05:47:49 PM
If you prefer to trigger events, then you would simply pass the name of the event as a payload (again, not prefixed by VC.TriggerEvent&&) and use a VC.TriggerEvent action instead of VC.TellVox in the "catch-all" command.

But I suspect using the VC.TellVox voice emulation technique is going to be a less labour-intensive way to send info from HA to VC.

Eventually James may be able to suggest a more sophisticated solution based on how the MQTT protocol works and how his plugin works. In the meantime, though, this seems like it should work for you.
Title: Re: IFTTT or how to integrate with home assistant
Post by: IKROWNI on November 30, 2016, 05:56:40 PM
Hey thanks for all of your help nime5ter. I got it working using the second method instead of using VC.TellVox because when i used that it gave me this

(https://voxcommando.com/forum/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FiAAyXc5.png&hash=2bb0a3ed18c7b22f5658374b27309d42ae58b303)

switching it over to VC.TriggerEvent got everything firing properly. Just out of curiosity do you guys have a donations page? I feel like ive gotten the best level of support from this community especially you and james that i need to make more of a contribution.
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on November 30, 2016, 06:16:15 PM
Interesting. Glad you got it working.

Yes, sure. If you go to http://voxcommando.com and look under the "Purchase" menu, there's a link to "Donate".

It's the same place that you end up if you click on the "Donations Always Welcome" tab on the purchase page.
Title: Re: IFTTT or how to integrate with home assistant
Post by: IKROWNI on November 30, 2016, 06:32:25 PM
ok cool thanks again!  ^-^
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on November 30, 2016, 06:38:45 PM
cheers
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on December 03, 2016, 01:09:48 PM
@IKROWNI -- out of curiosity, have you ever used IFTTT's Amazon Alexa service?

https://ifttt.com/amazon_alexa

I'm just curious what it actually accomplishes. The feature is only available in the U.S., so I can't read the documentation for it.
Title: Re: IFTTT or how to integrate with home assistant
Post by: wannaspeed on December 11, 2016, 10:08:35 PM
@IKROWNI -- out of curiosity, have you ever used IFTTT's Amazon Alexa service?

https://ifttt.com/amazon_alexa

I'm just curious what it actually accomplishes. The feature is only available in the U.S., so I can't read the documentation for it.

I know this was directed to IKROWNI, but I have used the Alexa IFTTT. It definitely has some limitations.  From what I have seen it only works one way. You tell Alexa the "IF" part and choose a service to "Then that". For example I have 2 applets that work together, one raises my phone's volume to 100% the other has IFTTT call my phone. So I say "Alexa, Trigger find my phone" She sends the command to IFTTT it raises the volume and calls me.

You can also have Alexa send a file to dropbox and then have VC watch that folder to issue a command for you. But I find these type of commands a bit on the slow side.

The Alexa phrase command is probably the most useful, there are others like if an item is added to my Alexa to do list, or an item is added or removed from my shopping cart, but I think they aren't as useful.

Unfortunately Alexa has no way to accept commands from other services. So you couldn't send Alexa an sms to turn off the lights or play song/movie x. However I found a workaround using Roger from the phone to send commands to Alexa, but this is not using IFTTT. Hope that helps give you an idea of some of Alexa and IFTTT's capabilities.

Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on December 12, 2016, 07:44:52 AM
@wannaspeed -- thanks for the explanation, much appreciated. Happy to have folks to chime in in any thread if there's an unanswered question that you can contribute to.

I asked IKROWNI because he had been actively seeking help with his Alexa stuff at the time, so I thought he would be subscribed to that thread.

By the way, "Alexa" is the kind of unique multisyllabic prefix that is likely to work well as a prefix or even as "start listening" phrase. I'm pretty sure that's why Amazon selected it.

One of our users has been using "Alexander" for years.


See also: http://voxcommando.com/forum/index.php?topic=1812
Title: Re: IFTTT or how to integrate with home assistant
Post by: nime5ter on December 19, 2016, 11:03:31 AM
The whole reason for this is because as far as i know vox isnt compatible with the echo dot so i am using home assistant so that i can give alexa commands to turn various things on/off.


IKROWNI--in case you haven't been following the other thread, Dave has great news for those of you with access to Amazon Echo and Dot (which are not sold in Canada).

Dave has been experimenting with his Dot in Germany. He has just made a nice video that demonstrates using a custom skill that he created to communicate directly between the Dot and Vox (using VC's TCP web server--no other software required).

  ::bow Let us all bow in gratitude to Dave, who has put in the time to open up a world of possibilities.  ::bow

http://voxcommando.com/forum/index.php?topic=2672.msg22987#msg22987




Title: Re: IFTTT or how to integrate with home assistant
Post by: Dave on December 22, 2016, 12:50:03 PM
The instruction to install an "EchoToVC"-Skill are now online:

http://voxcommando.com/forum/index.php?topic=2682.0 (http://voxcommando.com/forum/index.php?topic=2682.0)
Title: Re: IFTTT or how to integrate with home assistant
Post by: IKROWNI on December 23, 2016, 01:24:57 AM
Now if only amazon would open up push notifications.