Author Topic: IFTTT or how to integrate with home assistant  (Read 7601 times)

0 Members and 1 Guest are viewing this topic.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
IFTTT or how to integrate with home assistant
« 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

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #1 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
« Last Edit: November 30, 2016, 08:11:32 AM by nime5ter »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #2 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.
« Last Edit: November 30, 2016, 09:53:48 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #3 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.
« Last Edit: November 30, 2016, 09:54:37 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #4 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.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #5 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.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #6 on: November 30, 2016, 12:44:00 PM »
You can probably also send messages to VC with http get or something.

+1
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: IFTTT or how to integrate with home assistant
« Reply #7 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.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: IFTTT or how to integrate with home assistant
« Reply #8 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.



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.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #9 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?

« Last Edit: November 30, 2016, 05:20:58 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: IFTTT or how to integrate with home assistant
« Reply #10 on: November 30, 2016, 05:20:44 PM »


So it is getting the payloads attached

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #11 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, 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.

« Last Edit: December 02, 2016, 03:01:52 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #12 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.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: IFTTT or how to integrate with home assistant
« Reply #13 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



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.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: IFTTT or how to integrate with home assistant
« Reply #14 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.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)