Jump to content

How To Guide: Getting Alexa to provide verbal responses


blueman2

Recommended Posts

Posted

No worries.  But do pass your thanks along to the people at 3PO-Labs who made all of this possible.  They are doing it for free because they like what we are doing with Alexa for home automation.  

  • 2 weeks later...
Posted

I am having problems understanding the logic on checking a SwitchLinc current state device.  I already keep tracking of the current state and count each "on" per device.  So would I need to create two network resources, one ran from each program?

 

If office light control = on ---- run network resource Alexa saying the office light is on

If office light control =off ---- run network resource Alexa saying the office light is off

 

Thanks & this thread may become very useful.

Posted

I wanted to thank Blueman2 again for his clear and detailed instructions.

 

I also added a step to enable Alexa to Tell Me the current inside temperature on my two Nest thermostats.

 

I replaced two insteon thermostats which integrated well with ISY (but didn't always work so well) with two NEST thermostats which work well but do not integrate with ISY.  I missed my previous thermostat integration with ISY but was unwilling to use a Raspberry-pi or a computer on 24/7 to get the integration.  What I now use is ISY's ability to integrate with IFTTT and NEST's ability to integrate with IFTTT.  Now I can ask "Alexa, TELL ME the temperature" and she replies with the upstairs and downstairs temperature on the NESTs.

 

First I followed the Wiki to enable ISY to talk to IFTTT and vica versa. 

https://wiki.universal-devices.com/index.php?title=ISY_Portal_IFTTT_Integration

 

 

Then from IFTTT I used the NEST channel and the MAKER channel to create a recipe which sends the temperature to an ISY integer variable.  This required about 40 recipes one for each degree the temperature rose and one for each degree the temperature fell and a set for each Nest (upstairs and downstairs) - so I have 40 recipes.  However, they took less than a minute each to create.

 

Every time the temperature rises or falls 1 degree the NEST cloud tells IFTTT which then triggers one of the recipes which sends the actual degree that the nest rose or fell (i.e. the Downstairs Nest was at 69 degree and it fell to 68 degrees) the IFTTT recipes sends 68 to the  ISY variable..  

 

Next, I created a program in ISY which recognizes that the variable has changed and triggers the network resource as described by Blueman2 in the first post of this thread.

 

So this killed two birds with one stone.  I now have the actual upstairs and downstairs temperatures in ISY that I can use for any purpose I wish AND Alexa can speak those temperatures when asked.
 
The downside is that I only get the actual temperatures of the Nests.  I don't get the setpoints or any other information the Nest provides.  Alexa, however can directly change the setpoints but not through ISY.
 

 

If anyone is interested in greater detail, I'd be happy to share.

Posted (edited)

I wanted to thank Blueman2 again for his clear and detailed instructions.

 

I also added a step to enable Alexa to Tell Me the current inside temperature on my two Nest thermostats.

 

I replaced two insteon thermostats which integrated well with ISY (but didn't always work so well) with two NEST thermostats which work well but do not integrate with ISY.  I missed my previous thermostat integration with ISY but was unwilling to use a Raspberry-pi or a computer on 24/7 to get the integration.  What I now use is ISY's ability to integrate with IFTTT and NEST's ability to integrate with IFTTT.  Now I can ask "Alexa, TELL ME the temperature" and she replies with the upstairs and downstairs temperature on the NESTs.

 

First I followed the Wiki to enable ISY to talk to IFTTT and vica versa. 

https://wiki.universal-devices.com/index.php?title=ISY_Portal_IFTTT_Integration

 

 

Then from IFTTT I used the NEST channel and the MAKER channel to create a recipe which sends the temperature to an ISY integer variable.  This required about 40 recipes one for each degree the temperature rose and one for each degree the temperature fell and a set for each Nest (upstairs and downstairs) - so I have 40 recipes.  However, they took less than a minute each to create.

 

Every time the temperature rises or falls 1 degree the NEST cloud tells IFTTT which then triggers one of the recipes which sends the actual degree that the nest rose or fell (i.e. the Downstairs Nest was at 69 degree and it fell to 68 degrees) the IFTTT recipes sends 68 to the  ISY variable..  

 

Next, I created a program in ISY which recognizes that the variable has changed and triggers the network resource as described by Blueman2 in the first post of this thread.

 

So this killed two birds with one stone.  I now have the actual upstairs and downstairs temperatures in ISY that I can use for any purpose I wish AND Alexa can speak those temperatures when asked.
 
The downside is that I only get the actual temperatures of the Nests.  I don't get the setpoints or any other information the Nest provides.  Alexa, however can directly change the setpoints but not through ISY.
 

 

If anyone is interested in greater detail, I'd be happy to share.

I did this as well with Insteon thermostats for upstairs and downstairs.

I just update the two variables every time they change.  I am not certain if you could do the same with the Nests?

Contemplating switching from the Insteon thermostats to something else but working well so far.

Edited by Outlander
Posted

I am having problems understanding the logic on checking a SwitchLinc current state device.  I already keep tracking of the current state and count each "on" per device.  So would I need to create two network resources, one ran from each program?

 

If office light control = on ---- run network resource Alexa saying the office light is on

If office light control =off ---- run network resource Alexa saying the office light is off

 

Thanks & this thread may become very useful.

 

Sorry, memphis, I was traveling.  But yes, you would create 2 network resources and trigger each one via a program so that the phrase is updated as needed.  

Posted

This is a great write up! 

 

I'm still a bit confused - how do you setup the variable for temperature?  Can you share the example program you are using to populate State Variable #17 with the temperature of your Insteon thermostat.  

 

Thanks!

Posted

This is a great write up! 

 

I'm still a bit confused - how do you setup the variable for temperature?  Can you share the example program you are using to populate State Variable #17 with the temperature of your Insteon thermostat.  

 

Thanks!

That would take v5.xxx or a series of programs based on each temperature threshold or a NR that sends the current temperature to ISY (itself) for every change in temperature above say...-1C
Posted

That would take v5.xxx or a series of programs based on each temperature threshold or a NR that sends the current temperature to ISY (itself) for every change in temperature above say...-1C

 

Sorry, yes I am using 5.06 to update the variables.

I compare the actual temperature with my stored variable and if not the same, update variable, and update Responder with network resource.

I have a similar program for the downstairs temperature.

 

TempUS2Vars - [iD 009F][Parent 0023]

 

If

        'Temperature / Upstairs Main' Temperature is not '$UpstairsTemp Degrees'

 

Then

        $UpstairsTemp  = 'Temperature / Upstairs Main' Temperature °

        Resource 'RespMainTemperature'

 

Else

   - No Actions - (To add one, press 'Action')

 

 

Posted (edited)

This is a great write up! 

 

I'm still a bit confused - how do you setup the variable for temperature?  Can you share the example program you are using to populate State Variable #17 with the temperature of your Insteon thermostat.  

 

Thanks!

 

I am not using a state variable, as a normal integer is working fine for me right now.  I am able to get 0.5 degree (Celsius) precision from the Insteon thermostat and the above program.

The variable number is used in the Network Resource to update the Intent in your skill.

Edited by Outlander
Posted (edited)

Sorry, yes I am using 5.06 to update the variables.

I compare the actual temperature with my stored variable and if not the same, update variable, and update Responder with network resource.

I have a similar program for the downstairs temperature.

 

TempUS2Vars - [iD 009F][Parent 0023]

 

If

        'Temperature / Upstairs Main' Temperature is not '$UpstairsTemp Degrees'

 

Then

        $UpstairsTemp  = 'Temperature / Upstairs Main' Temperature °

        Resource 'RespMainTemperature'

 

Else

   - No Actions - (To add one, press 'Action')

 

 

 

If you use a State variable, you can simplify this:

If
        'Temperature / Upstairs Main' Temperature is > 0

Then
       Resource 'RespMainTemperature'
 
Else
   - No Actions - (To add one, press 'Action')

This works because State variables are only evaluated upon change.  So if it changes, the IF becomes true and the THEN is executed.  Well, so long as your temperature remains above 0.  You could put > -255 to be safe!

Edited by blueman2
Posted

I am not using a state variable, as a normal integer is working fine for me right now.  I am able to get 0.5 degree (Celsius) precision from the Insteon thermostat and the above program.

The variable number is used in the Network Resource to update the Intent in your skill.

You can use either type of variable but if you want to trigger programs from it in other programs you will eed to utilise a State variable type, as mentioned by blueman2 above.
  • Like 1
Posted

If you use a State variable, you can simplify this:

If
        'Temperature / Upstairs Main' Temperature is > 0

Then
       Resource 'RespMainTemperature'
 
Else
   - No Actions - (To add one, press 'Action')

This works because State variables are only evaluated upon change.  So if it changes, the IF becomes true and the THEN is executed.  Well, so long as your temperature remains above 0.  You could put > -255 to be safe!

Thanks BlueMan,

I know I tried something like this at first but wasn't getting the results I expected.  Probably a stupid mistake I made in my Network Resources.

I will experiment more with this tomorrow.

Posted

I'm using an Autelis device to control my pool.  The device also passes status, such as pool and spa temp, back to ISY in a state variable.  I have been unable to figure out any way of querying alexa for the spa temp variable.  This appears like it is my solution.  Am I correct, or is there an easier way.  I wish variables were treated as devices so I could simply say, "alexa, ask isy the status of variable xyz."

  • 2 weeks later...
Posted

First, thanks for the guide. This is great! I have mine giving me security status, inside temp, and fan speed currently. 

 

Question: Is it possible to do an IF or CASE type statement in the body of the network resources code? Something like...

 

IF ${var.2.3} = 1 THEN <speak> this <speak>

ELSE <speak> that <speak>

 

I don't know what the syntax would be, just trying to think of ways to create less resources. 

  • Like 1
Posted

First, thanks for the guide. This is great! I have mine giving me security status, inside temp, and fan speed currently. 

 

Question: Is it possible to do an IF or CASE type statement in the body of the network resources code? Something like...

 

IF ${var.2.3} = 1 THEN <speak> this <speak>

ELSE <speak> that <speak>

 

I don't know what the syntax would be, just trying to think of ways to create less resources. 

 

I don't believe so but others should chime in.  I'm at around 80 Network resources just for Alexa - On/off - Open/close etc.  ISY v5.0* I believe allows decimal points, and maybe String variables.  Strings for me would reduce Network Resources.  Alexa - tell me which gates are open.  Right now, she will tell me one or more is open.  Would be nice to return a String saying which gate in terms of a $var*.*

 

I'm very happy with the results, no one can believe how much time I have programming into my house.  I can't wait for Alexa just to start shouting at me.  "You left the gate open, you fool... and now the dog is swimming in the pond."  Via RFID and IOLincs.

Posted

I have the basic coding done and working, thanks to Bluemans great guide .

Now I need to get the data from my Aeotec Sensors into variables.

Any help would be appreciated, examples are especially so:)

Posted

I have the basic coding done and working, thanks to Bluemans great guide .

Now I need to get the data from my Aeotec Sensors into variables.

Any help would be appreciated, examples are especially so:)

 

What version of ISY are you on?  As I recall, you might need to be on 5.x in order to read z-wave values into variables.  

Posted

Blueman2 -

 

Thanks for the step by step instructions.  I followed everything and double checked my cut-and-pastes but I keep getting "Error: TCP client request failed [Net Module Rule 1:400]".  It appears I still don't have something connected quite right.  I'm very new to the net resources stuff.  Any place that is well documented for beginners that you can recommend for me to start debugging?  It seems most of the Wiki and Forums are great references for those who know what is going on, but few (other than your great step by step with examples) for us newbies. 

 

 

ISY 994i v4.5.4 w/Portal Integration

 

 

Thanks again

Posted (edited)

Blueman2 -

 

..I keep getting "Error: TCP client request failed [Net Module Rule 1:400]". 

 

Does this show up in the pop-up box when doing the 'Test' of the resource?  If so, please copy and paste your network resource info so I can view it.  Screen capture would be fine.  

 

Also, double check you are using Mode:C-escaped

and Select Content Type: application/json

Edited by blueman2
Posted

post-8505-0-94147200-1479879262_thumb.jpgBlueman2 -

 

Yes, it's the popup when I try to test it.  Here is my Network Resource definition.  One other weird thing, when I click on "more Info" in the Portal tab, I never get the page to load.

 

 

Posted

I see you still have ${var.2.17} in there.  Do you have that variable defined?  If not, delete that reference.  But everything else looks right.  

Posted

I finally got it working.  The problem ended up being that when I copied the example for the resource, I was using the MS Edge browser and it ended up putting some weird characters (0xC2 0xA0) for each leading space on each line :x .  When I just retyped it, or used Chrome to copy it so the spaces were 0x20, everything was fine.  I also was able to use "Raw Text" rather than "C-Escaped" to keep the code in the Body window in a sane format.

Posted (edited)

I finally got it working.  The problem ended up being that when I copied the example for the resource, I was using the MS Edge browser and it ended up putting some weird characters (0xC2 0xA0) for each leading space on each line :x .  When I just retyped it, or used Chrome to copy it so the spaces were 0x20, everything was fine.  I also was able to use "Raw Text" rather than "C-Escaped" to keep the code in the Body window in a sane format.

 

Great!  And I will definitely try the raw text.  I have the way the formatting gets changed when editing the line!

 

EDIT: jndsoccer, you are right!!! The Raw Text mode does work much better.  I changed the How To to reflect this and gave you credit for the find.  

Edited by blueman2
  • 5 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.1k
    • Total Posts
      371.5k
×
×
  • Create New...