Jump to content

Amazon Echo and ISY


madmartian

Recommended Posts

I have just posted version 2.0.62 of the configuration system (AWS_CONFIG.exe) on my website (the-gordons.net). This is a significant upgrade which now handles Devices, Scenes, and Programs in folders. ISY Variables (static and integer) are also handled. When dealing with spoken numeric values the Emulator (version 0.4.9) now allows for the URL to contain a math function to adjust the spoken value suffix. Please read the documentation as that has been updated to describe all of the new capabilities. Emulator version 0.4.9 is now available from bwssystems.com and is required for the math capability.

 

Have Fun!

 

Barry 

Link to comment

Thanks once again, Barry. The variable addition is huge to me, since I use the ISY a lot to do intermediate work before handing off to the end device.  For example, filtering a temperature value for my thermostat to make sure it is reasonable and sane.  

 

I am now using BWS System's restful-harmony bridge to control my home theater via my harmony hub/remote. It really is slick.  One issue I am running into, however, is that BWS uses PUT commands with a json body.  I have had to create those directly in the HA-bridge's web page.  Works OK, but it would be nicer to have it all handled in your slick app.  Any thoughts of including this capability for the custom endpoints?  You would need to be able to select "PUT", and handle a json body such as {"deviceid":"Watch TV"}.  Not a huge deal to go back and forth between your app and the BWS web page, but I do miss how hice yours is for moving across emulators and the general ease of use.

 

Thanks again for sharing your great app!

 

Blueman2 

Link to comment

I am glad you are finding the configuration tool helpful. The reason the tool is so "slick" is because it grabs the configuration of the ISY thereby greatly reducing the amount of typing needed to set up an entry for the emulator.

 

I have no knowledge regarding the harmony hub/remote. Could you point me to something that describes the harmony hub/remote API?

From what I see in the BWS documentation the URL's appear to be quite complex. I am not sure which Parameters are static and which need to change in the URL for a specific entry. I Would like to fold as much of the URL as possible into the definition of the custom endpoint and add some additional fields to the definition of the custom endpoint e.g "Type=JSON", "Verb=PUT". JSON format is well defined and easy to build, but I need to understand the API which I currently have no clue about.

 

Also, is there a configuration in the harmony hub that can be pulled or is it very static with just commands like an IR remote?

 

Perhaps initially we should take this off line to email until I better understand what is needed.

 

I am curious about how Alexa's performance is in a theater environment which will generally have I high noise level. I can start my theater using the Echo but I have been hesitant to do anything else with it. The entire theater is controlled by a PC using TCP/IP over wi-fi and either a Pronto PRO or iPad/iPhone as the UI so controlling it via the Echo would be quite simple.

Link to comment

I just did some harmony research. To test I would need a harmony remote and an account. If someone loans me a remote I will set up an account. I shouldn't need the remote for more than a week or two.

 

My plan would be to read the configuration of the harmony as I do for the ISY. I would add a harmony button to load the harmony devices, activities and buttons and modify the device editor pane to be aimed at the harmony format. The operation of the configuration system should be fairly seamless. The ini file would specify the key facts about the harmony system; ip, port account I'd, account Password, . . . The harmony button would only appear if there was a harmony section in the ini file. The harmony button would load all of the activity names, button names, etc and tag them. Double clicking a harmony "device" would then place that device in the new editor window.

 

Comments?

Link to comment

I agree the biggest value of your tool is the ability to integrate so well, read and write, with the ISY.  And doing what you describe above would be AMAZING, providing similar integration with harmony.  But I guess I was thinking smaller, at least as a first step.  Perhaps just expand the capabilities of the custom endpoint settings to allow different verbs (PUT, GET, POST) and different body types (e.g. JSON).  Maybe mimic the options already there in the BWS HA-Bridge web interface within your custom device options. Users would still have to gather info themselves, like I do now, but allows us to use your tool which I like much more as a single interface.  A later step could be to allow people to put Activity IDs/names, Device button IDs/names manually into the config file to do some of what you describe above, scaping the IDs/names themselves from the 'list' command of the restful-harmony interface.  The names and device IDs are mostly static.  Only changes are when you add new device / activities (need to add new stuff) or when you change names of a device/activity (IDs stay same, but names change - so better to use IDs if you plan to change names over time).      

Link to comment

I have just posted version 2.0.63. It was pointed out to me that I reversed the definition of the Var_Type in the Rest URL's for variables. It is now correct.  The RESTful URL for a state variable is now 2 and for an integer variable 1.

 

I also now provide the ability to download the AWS_Config.exe file only.  It is not in an archive so some browsers may issue a warning message. It is the same file that is in the install package 

Link to comment

It seems the API for the Harmony HUB has not been released by Logitech. (One of the reasons I stopped buying Logitech Gear) If any one has a copy and can send it to me I would appreciate it.  Without the API there is too much reverse engineering required which becomes extremely difficult if one does not have the actual device.

Link to comment

It seems the API for the Harmony HUB has not been released by Logitech. (One of the reasons I stopped buying Logitech Gear) If any one has a copy and can send it to me I would appreciate it.  Without the API there is too much reverse engineering required which becomes extremely difficult if one does not have the actual device.

So, if you look at the https://github.com/bwssytems/restful-harmonyit lays out the API from this bridge. There is information out there on handling the Harmony API, but it requires you to keep track of a token from logitech.com sign in. That is what this bridge does for you. It is just helper. If you need some dumps from the list calls I can get that for you.

Link to comment

Nice to see you here bwssystems.  I was just looking into modifying my configuration program to handle the Harmony, but I am not sure I will have the time to do that.  Naturally your restful-harmony site was one of the first places I looked. I hate to produce software with no real way to test it as I don't have a harmony hub

 

Barry

Link to comment

So I just picked up the Insteon 2441th thermostat and am using the BWS systems HA bridge (v0.4.9) (thank you BWS for this awesome tool), as well as Barry's wonderful config tool.  I've added the thermostat as a climate device and am calling it directly using the ${intensity.math()} function but I'm having problems with rounding issues since it doesn't actually pass the spoken value.  My exact equation is: ${intensity.math((X/2.55)*2)}.  This is to reverse the calculation done by the bridge (at least that's where I'm assuming the 255*percentage is coming from) as well as double the value to the thermostat (for some reason this thermostat requires double the setting amount).  The problem is that on some values (for example "set thermostat to 75 degrees") it looks like the number is being truncated before I can even use it in the math function which is causing it to not allow some values (like 75 degrees, etc).  Any idea how to fix this?   Can a math function be added that still allows the spoken number similar to ${intensity.percent}?  (Maybe ${intensity.mathperc()} or similar)?  Or maybe someone else has a more elegant solution.

 

TIA

Link to comment

Look at post #588 in this thread. The Echo believes it is talking to a HUE HUB. The number provided by the Echo when the phrase is spoken as described in that post is (X/100)*255. That is, it takes the spoken number as a percentage of 255 and provides that value as the value of the "bri" property.

 

The ISY when working with an Insteon thermostats assumes that temperature values are in 1/2 degree increments so to set the value to 75 degrees you must give it a value of 150. Using ${intensity.math((X*200)/255)} should provide the correct value for the Insteon Thermostat

Link to comment

Thanks Barry, unfortunately that gave me the same problem as before:  when I say "set thermostat to 74 degrees" it ends up setting it to 73 degrees instead (same thing happens with 76 degrees, it actually sets it to 75).  My guess is that when it does the calculation .74 * 255 = 188.7 it must be dropping the .7 at the end before doing the math calculation.  Any more ideas of how to get around this?

Link to comment

First off what vision of the hue emulator are you using? The jar 0.4.8 does not round, the jar 0.4.9 does round. You can always do the round yourself as an ${intensity.math(0.5+(yourMathFunction))} if the emulator is truncating and not rounding the result.

You can turn on logging in the hue emulator, instructions are at bwssystems git, and send the log file to info@bwssystems.com. The tests I ran with the latest jar worked correctly.

Link to comment

Thanks again Barry, adding 0.5 seemed to do the trick...but (always a but), something strange is still going on. A couple times when I would say 'set thermostat to 79 degrees' it would set it to 79 for a split second & then change to 78...this didn't happen every time but I was able to reproduce a few times. Really strange & didn't seem to happen with other numbers. (I'm using the 0.4.9 emulator).

Link to comment

Tungsten,

 

I recommend you not directly set temps from the HA-Bridge.  I prefer instead to have the bridge send the value directly to an ISY State variable, and then have a program use that change to set the thermostat.  Several advantages:

 

1) no math or calculation.  You directly send the actual number to the variable, which sends that to the thermostat.  No translations to go wrong. 

2) you can only allow 'valid' temps to be set.  Just in case Alexa misunderstands or someone says "Alexa, set Thermostat to 99 degrees".  Result would be pretty bad.  So I have a program that only allows 'good values'.  

 

This works just as fast and introduces no noticeable lag when I use it through ISY program.  Much better solution I think.  You just have to use ${intensity.percent} in your command on the AWS-config tool, and point it to the right State Variable.  

 

Line in AWS-config would look like:

http://user:pwd@<ISY IP address>/rest/vars/set/2/9/${intensity.percent}

for State Variable #9.  

Link to comment

bwssystems,

 

Thanks. What Blueman2 was looking for was a modification to my Configuration program to deal with the Harmony in a manner similar to the way I deal with the ISY.  With the ISY, the Configuration program reads all of the information stored on the ISY so it can easily make up the commands (restful URL's for a On/Off of the device with little if any typing.  Generally just the friendly name.

 

My understanding is that without a valid harmony account (userid and password) I cannot read the configuration of the users specific Harmony Remote/hub as that is held in the Harmony cloud. If my understanding is correct then I need someone to send me the information for their account so I can check out the code I need to write to read the Harmony configuration. This assumes I can query the account in the cloud without the actual hub present on my LAN. Blueman2?? 

 

If my understanding is incorrect then I need someone to explain to me how I can read all the device/activity information for the Harmony hub.  I am suffering from a bad sinus infection (the internet is close contact with no infection vectors)  so my mind is a little cloudy.

Link to comment

bwssystems,

 

Thanks. What Blueman2 was looking for was a modification to my Configuration program to deal with the Harmony in a manner similar to the way I deal with the ISY.  With the ISY, the Configuration program reads all of the information stored on the ISY so it can easily make up the commands (restful URL's for a On/Off of the device with little if any typing.  Generally just the friendly name.

 

My understanding is that without a valid harmony account (userid and password) I cannot read the configuration of the users specific Harmony Remote/hub as that is held in the Harmony cloud. If my understanding is correct then I need someone to send me the information for their account so I can check out the code I need to write to read the Harmony configuration. This assumes I can query the account in the cloud without the actual hub present on my LAN. Blueman2?? 

 

If my understanding is incorrect then I need someone to explain to me how I can read all the device/activity information for the Harmony hub.  I am suffering from a bad sinus infection (the internet is close contact with no infection vectors)  so my mind is a little cloudy.

 

So the restful-harmony app in development mode mimics being connected to a hub without supplying any ip or harmony login info. No account or actual hub needed. It will return actual data (Captured from my hub of course) and respond to all commands. Hope that sheds some light on the update.

Link to comment

Above and beyond my expectations, as usual. Thanks for the clarification. Looking at what you have done with the resident web server on the harmony emulator, I am not sure how much will be added by modifying my configuration system to handle the harmony hub as well as the ISY. I should have time next week to look at this.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...