Big517 Posted November 19, 2015 Posted November 19, 2015 UP AND RUNNING! currently on BWS 1.1.0. I'm going to add the Harmony later since it's being delivered today and will visit on that later, but I'm curious about a few things regarding the voice commands and how the the dimming works... When I said "Alexa turn chandelier to 50%" it wouldn't work, but it did work when I said 20%... Then I looked at the URL being sent thanks to @BarryGordon's awesome piece of software, and I noticed this: ${intensity.byte}. I'm having a little bit of trouble getting the chandelier on (dimmable device) but NOT with the on/off switches... Should I change this to "Intensity.percent" to get the expected response when I say "Set brightness to 90 percent" for example? Quote
blueman2 Posted November 19, 2015 Posted November 19, 2015 UP AND RUNNING! currently on BWS 1.1.0. I'm going to add the Harmony later since it's being delivered today and will visit on that later, but I'm curious about a few things regarding the voice commands and how the the dimming works... When I said "Alexa turn chandelier to 50%" it wouldn't work, but it did work when I said 20%... Then I looked at the URL being sent thanks to @BarryGordon's awesome piece of software, and I noticed this: ${intensity.byte}. I'm having a little bit of trouble getting the chandelier on (dimmable device) but NOT with the on/off switches... Should I change this to "Intensity.percent" to get the expected response when I say "Set brightness to 90 percent" for example? Intensity.byte is correct for dimmable devices. You use Intensity.percent for things like Thermostats. Also, the command I use is "Alexa, set Den to 50 percent". That seems to work reliably. Finally, dimming only works on DEVICES, not on SCENES, at least for me. Quote
blueman2 Posted November 19, 2015 Posted November 19, 2015 (edited) Big517 asked a question about my setup that I thought I would copy here for those interested. For Harmony "Activities", I am using Barry's config tool to allow me to say things like "Alexa, turn on Den Television" or "Alexa, turn on Den Music". This talks to the Harmony which then gets my audio/video equipment all set up correctly. So Echo=>BWS Hue/Harmony Bridge=>Harmony=>IR devices for all harmony activities. But I have also decided it is good to have my ISY directly talking to the Harmony hub as well, using the networking module that I have purchased for the ISY. For example, I have created networking resources for all of the number buttons plus 'enter' on my DirecTV receiver. I have created ISY programs for all my most watched channels, such as ABC, NBC, CBS, HBO, CNN, etc. Each program just contains a blank IF and ELSE, with only the THEN populated with the commands to press the numbers for that channel then the enter button. I then use Barry's tool to create an Alexa link to that program. I can then say "Alexa, turn on CNN", and the TV will turn to channel 202 (for DirecTV CNN). So Echo=>BWS Hue Bridge/Harmony Bridge=>ISY Program=>Harmony=>IR devices. Amazingly, even with all these link in the chain, the result is instantaneous when I given Alexa the command. The only issue with ISY talking directly to the Harmony Bridge requires the use of the OLDER Harmony program in addition to the new one integrated into the HA-bridge software. That is because the newer integrated one (1.1.0) does not allow access to the core Harmony functions. Gets kind of complex to get it all set up, but it works great! For channel change via Alexa, here are the screen shots of my ISY so you can get the idea how it works: First, I set up network resources for all the buttons I need (number 0-9 and enter): Here is the detail for one of the buttons. Note, this networking command is talking to the older, stand alone BWS harmony software: And here is the program for CNN: I then use Barry's tool to make alexa trigger the CNN program. Finally, here is my rc.local file from my Pi: #!/bin/sh -e # # rc.local # # Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi #The following is for multiple emulators on the same machine #echo "Starting the Echo Bridge Emulators" nohup java -jar -Dvera.address=192.168.1.145 -Dupnp.config.address=$_IP -Dharmony.address=192.168.1.127 -Dserver.port=8080 -Dupnp.response.port=50000 -Dupnp.device.db=/home/pi/echobridge/data/device80.db -Dharmony.user=XXXXX -Dharmony.pwd=XXXX /home/pi/echobridge/ha-bridge-1.1.0.jar > /home/pi/echobridge/logs/log80.txt 2>&1 & nohup java -jar -Dvera.address=192.168.1.145 -Dupnp.config.address=$_IP -Dharmony.address=192.168.1.127 -Dserver.port=8081 -Dupnp.response.port=50001 -Dupnp.device.db=/home/pi/echobridge/data/device81.db -Dharmony.user=XXXXXX -Dharmony.pwd=XXXX /home/pi/echobridge/ha-bridge-1.1.0.jar > /home/pi/echobridge/logs/log81.txt 2>&1 & #Harmony for ISY to talk to java -jar -Dserver.port=8086 /home/pi/Harmony/harmony-0.1.4.jar 192.168.1.127 USERNAME PWD > /home/pi/echobridge/logs/log86.txt 2>&1 & exit 0 Edited November 20, 2015 by blueman2 Quote
barrygordon Posted November 19, 2015 Posted November 19, 2015 The fact that scenes cannot be dimmed is an ISY design issue. A scene can set its members to specific dim levels, but a Scene will not accept a command to dim/brighten. You can have different scenes with the same members to set various moods and you could choose between them based on a variable using an ISY program Quote
LeeG Posted November 19, 2015 Posted November 19, 2015 barrygordon "The fact that scenes cannot be dimmed is an ISY design issue." Can you expand on that. What Insteon function at the Scene level does the ISY not support. Quote
Jimbo.Automates Posted November 19, 2015 Posted November 19, 2015 Intensity.byte is correct for dimmable devices. You use Intensity.percent for things like Thermostats. Also, the command I use is "Alexa, set Den to 50 percent". That seems to work reliably. Finally, dimming only works on DEVICES, not on SCENES, at least for me. The way ISYHelper handles this is when instruct Alexa to turn on or off a scene, it sends the command to the scene, when you give a brightness level, it sends that to the controller of the scene. This works well for me in all of the common cases. For example, I have "kitchen cans" which is a scene that is controlled by 2 switchlinc's. So I put the Spoken property "kitchen cans" on the switchlinc that has the load attached to it. So, when I say "turn on kitchen cans" it sends the scene on command, if I say "set kitchen cans to 50 percent" it sends the brightness command to the switchlinc device. I do it this way because I want the scene to come on when I say "turn on" so all responders react as they should, but it also allows changing brightness. I've considered having it set the brightness level of all dimmable responders, but I haven't done that yet. This works well for my usage, and I don't want to start a debate on insteon scenes and brightness That has been discussed may times on this forum Quote
barrygordon Posted November 19, 2015 Posted November 19, 2015 (edited) LeeG, A Scene supports all Insteon devices at all levels. What, AFAIK, you cannot do is command a defined scene to work at a specific brightness dynamically. I think it was you who told me this. You can use the REST interface to do DON, DOF, DFON, and DFOF, but I do not believe DON/50 will work to set the scene members to 50% dynamically. I have some scenes that are not controlled by devices but rather by REST commands directly or by REST commands to programs running either Then or Else branches. There is no way I know of to change the brightness of the members of those scenes as a group, i.e. all the members of the scene. Edited November 19, 2015 by barrygordon Quote
Xathros Posted November 19, 2015 Posted November 19, 2015 Barry- I believe Lee's point was that this is an Insteon protocol limitation, not an ISY specific limitation. -Xathros Quote
LeeG Posted November 19, 2015 Posted November 19, 2015 barrygordon Thanks for that information. As Xathros (thanks) just noted I was asking for information on something Insteon can do that the ISY does not support. What you describe is how Insteon works (not able to globally change responder on levels across the Scene), not something the ISY does not support. Not trying to start a discussion, I was pretty certain the ISY was not a limiting factor. This requires a discussion with the Insteon manufacturer (SmartLabs/Smarthome) to see if they are willing/able to add that capability. They may be limited by the SD command structures associated with Scene On. Quote
barrygordon Posted November 19, 2015 Posted November 19, 2015 LeeG, Xanthos, Thanks for the clarification. I now understand what you are saying. I agree it is an Insteon limitation in the way they implemented the scene logic in their devices. I was confused in that I thought that ISY scenes were handled more like ISY programs with all of the logic and information in the ISY. I am happy the way it is. Quote
themlruts Posted November 20, 2015 Posted November 20, 2015 (edited) Finally got my pi up and running. Thank you Barry. Still need to work on my rc.local file still not working. Will look at that at later date. I know you can say "set couch lamps to 50%" But what about "set fan to high" Can you use words instead of numbers or do i just need to create programs for low med and high? ThanksMike Edited November 20, 2015 by themlruts Quote
barrygordon Posted November 20, 2015 Posted November 20, 2015 I created programs for the fans for high medium, low and off. The Hue bridge does not handle things like High Medium Low. I assume Izzy will. What is wrong with your rc.local file other than the error I found in the -Dvera parameter? Quote
Jimbo.Automates Posted November 20, 2015 Posted November 20, 2015 Finally got my pi up and running. Thank you Barry. Still need to work on my rc.local file still not working. Will look at that at later date. I know you can say "set couch lamps to 50%" But what about "set fan to high" Can you use words instead of numbers or do i just need to create programs for low med and high? Thanks Mike Usually for fans you create a high, medium, and low scene with the fan motor as a responder at the appropriate level. Sent from my Nexus 6P using Tapatalk Quote
blueman2 Posted November 20, 2015 Posted November 20, 2015 I created programs for the fans for high medium, low and off. The Hue bridge does not handle things like High Medium Low. I assume Izzy will. What is wrong with your rc.local file other than the error I found in the -Dvera parameter? themlruts, this is also exactly what I do. Create a program for Low, and you can just say "Alexa, turn fan on low" and it works. BTW, did you remember to set the rc.local to execute? (chmod 777). Just use my rc.local above as an example. Quote
Big517 Posted November 20, 2015 Posted November 20, 2015 themlruts, this is also exactly what I do. Create a program for Low, and you can just say "Alexa, turn fan on low" and it works. BTW, did you remember to set the rc.local to execute? (chmod 777). Just use my rc.local above as an example. What is the friendly name for this in BarryGordans software? I was under there impression it had to on/off or 0-100. Does this mean its possible to say "Lock the front door" or "Close the garage door"? Sent from my SM-G900V using Tapatalk Quote
blueman2 Posted November 20, 2015 Posted November 20, 2015 As for lock/unlock, open/close, these do work with some friendly names but I am not certain exactly how to use them. For example, "set temperature to 70 degrees" will only work with friendly name Thermostat and when using intensity.percent. I know at one time I was able to say lock/unlock to alexa for a z-wave door lock I had, but it no longer works consistently for some reason. As for the fan high/medium/low, I am taking advantage of the fact that Alexa is very loose with how you address a device. So if you create a friendly name "Fan Medium", you can address it by "Alexa, turn on Fan Medium" (as you would expect), but also by "Alexa, turn fan on to Medium" and "Alexa, turn on Fan to Medium", or "Alexa, turn fan on medium". So long as you only have one device with the terms 'fan' and 'medium', then alexa gets it. I use this trick for a lot of my friendly names. Note that about 50% of my home 'devices' are actually programs on the ISY which Alexa calls. I find programs to be much more flexible. Also, I can change a program at will, and do not have to do a re-discover with Alexa. I find that very helpful in testing phases. Quote
barrygordon Posted November 20, 2015 Posted November 20, 2015 themlruts, I do not understand "...my rc.local file not working.... If the rc.local file is not working how are you starting the HA Bridge emulator? How do you know the rc.local file is not working? Normally when the RPi is set up the rc.local file is set as executable so there should be no issue un less there is something causing the file to abort its execution. Quote
David G Posted November 23, 2015 Posted November 23, 2015 Biueman2Reading your post 591 it sounds like you have the thermostat control working with your echo.I am running a RPI with EHbridge 1.1.0 and Barry's AWS 5.0.30I have an insteon thermostat, Isy994i/IR pro running 4.3.26When i just select my thermostat in AWS and dont change anything. when i say "alexa set thermostat to 70" it replys "ok" but nothing happens.When I change the OnURL to what you had in post 591:"/rest/vars/set/2/9/${intensity.percent}"it responds "device thermostat is not responding"Can you please help me? Quote
barrygordon Posted November 23, 2015 Posted November 23, 2015 (edited) There seems to be a bit of confusion regarding the control of thermostats. I will try and clarify things although I do not use the Echo to control my thermostats. Basic Concept: The Echo thinks it is talking to lights when it communicates with the HA Bridge (emulation of a Philips HUE Bridge) Therefor the basic commands must be those for lights. Basic lighting commands are 'Turn On', 'Turn Off, and 'Dim', Additional commands which seem to work are 'Shut Off' (same as Turn Off), 'Set' (same as Dim). Commands to tun on or off a Light, a Scene, or to run a program, take no other arguments. The configuration program is knowledgeable regarding Devices (Lights) Scenes, and Programs and will properly set the on and off URL's that the HA Bridge requires. When setting up for the dimming of a light, or other dim-able device (Scenes may not be dynamically dimmed) the configuration system adds a suffix to the command (DON) which is sent as the REST command. This command is the value to be used to set the brightness level of an Insteon light or device and must be an integer in the range of 0-255. The spoken value must be in the range of 0-100. The suffix that is appended to the DON by the configuration system will be ${intensity.byte} . There are other suffix's that may be used (${intensity.percent}, ${intensity.math}). The documentation on the configuration system discusses these alternate forms. Thermostats: Thermostats are not lights. The thermostats I own are Z-Wave devices which came with my Trane systems. I do not use the Echo to control my thermostats in any way. I very rarely change the settings on my thermostats. The ISY does report the state of my thermostats to my iPad controllers and my iPhone, and I can alter any of the thermostat settings from these devices. I also have one-wire sensors in every room that give me the exact temperature of that room when requested by the iPads/iPhone. If you want to control your thermostats using echo, then there are several approaches. 1) Blueman's approach using variables and programs when a variable value changes. He has discussed this in several posts to this thread. 2) A direct control approach using the ISY Climate commands (CLIMD, CLISPH, CLISPC, CLIFS). In a direct control approach you will need to modify the On and Off URL's set up by the Configuration system. For example, a command to set the system mode to Heat or Off would have as its on URL rest/nodes/<address>/cmd/CLIMOD/1, and its off URL rest/nodes/<address>/cmd/CLIMD/0 and for cooling the commands would have as its on URL 'rest/nodes/<address>/cmd/CLIMOD/2', and its off URL 'rest/nodes/<address>/cmd/CLIMD/0' To set the thermostats temperature set-point the ISY wants a rest command of the form 'rest/nodes/<address>/CLISPC/value' or 'rest/nodes/<address>/CLISPH/value' The phrase spoken to the Echo would be of the form: 'Alexa, Set the Bedroom thermostat to 75' where 'Bedroom thermostat' is the friendly name of the HVAC system Assuming we are dealing with Cooling the On URL would look like 'rest/nodes/<address>/CLISPC/${intensity.percent}'; however there is a glitch. Insteon thermostats operate in 1/2 degree increments so to set the set-point to 75 degrees one needs a value of 150. Z-Wave thermostats, at least the ones I have, operate in whole degree values so to set the set-point to 75 degrees one needs a value of 75. To gain this flexibility and still be able to say 'Set the thermostat to 75' we need to use a different suffix. The On URL would be of the form: 'rest/nodes/<address>/CLISPC/${intensity.math(f(x)}' where f(x) is a math expression to compute the ISY desired value from the spoken value. The spoken value will be between will be in the range 0-100; but IIRC, The Amazon Echo cloud will send that value as a number between 0 and 255 to the HA Bridge emulator. Seventy Five (75) will be sent as 192 (0.75*256). A math expression of the form X/255*100, where X represents the value received from the Amazon Cloud, will put the value from the Echo back to a number between 0 and 100. If it is an Insteon thermostat you will need an expression of the form X/255*200 will put the value in the range of 0-300, (75 spoken will be 150 for the ISY) When the expression is computed the value is rounded to the nearest integer. In summary the onURL for an Insteon thermostat cooling set-point would be, I think, the following: 'rest/nodes/<address>/CLISPC/${intensity.math(X/255*200}' I say 'I Think' as I have never tried it. Part of the fun of DIY Home Automation is working out the bugs by playing with the system. Edited November 23, 2015 by barrygordon Quote
David G Posted November 23, 2015 Posted November 23, 2015 Barry Thank you. I do very much enjoy much enjoy trying to figure things out. I don't remember the post number, but a while back you said that you enjoy puzzles. When I read that I thought that I fit into that category too. My problem is that I come from a industrial mechanical side of the world not IT. I have no problems installing a 50,000 HP gas turbine with all of it's PLC controls or liquid natural gas marine condensing, storage and export facilities. My first home automation project (2000-2014) were actually with an AB PLC, but it required a lot of rewiring switches to the PLC then from the PLC to the device. Now that I have an Isy and Insteon devices, I have it where it controls my brewing stand, with temperature control, ingredient measurement control and liquid transfers. I want to learn what is going on with this type of home automation, but I apologize that I am a novice when it comes to home networks, Linix, Vbasic, (fortran 4 is what I learned), but I DO want to learn. What you have said makes sense, but when I change the on url to what you suggest or what blueman2 has on his post 591, I get "device thermostat is not responding". It appeared to me that Blueman2 has it working on his system and uses it, so I thought I would ask him if he could help me out and understand how it works in the process. Thanks again for everyone's help. I really do like tinkering with this stuff, I have learned so much in the last few months and hope to get to the point where my knowledge allows me to be a valued contributor, I'm just not there yet. Quote
barrygordon Posted November 23, 2015 Posted November 23, 2015 David, To get more insight turn on debugging in the HA Bridge. This will send a lot of data to whatever you have defined as your log file. Just add the following parameter to the startup line in rc.local. Remember parameters appear before the call to the bridge, and must be preceded and followed by a space. -Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG I generally reboot the RPi to clear the log file, but anyway that you can clear the log file will make it easier. The log file is chronological. Just say the phrase and you will see how the HA Bridge process the spoken words as interpreted by the Amazon cloud speech processor. The processing will be at the end of the log file and should be able to be spotted. (the log file is pure text. I look at it with textpad which understands unix and PC line endings which are different. Notepad doesn't Quote
Jimbo.Automates Posted November 23, 2015 Posted November 23, 2015 IMO, the easiest way to test different urls is to enter them in your browser. Then you see exactly what the ISY replied with. Sent from my Nexus 6P using Tapatalk Quote
barrygordon Posted November 23, 2015 Posted November 23, 2015 Jimbo, Unfortunately in this case what you suggest will not help. The ISY if sent the proper command will do the correct thing. In this situation there are two intermediaries in the loop/process. First we have the Amazon cloud which handles the speech processing and yields a textual representation of what was said. The textual representation is sent to the HA Bridge and will have several parts. First the ID number of the entry as developed when the device was discovered, second the primary command, on or off, and lastly any auxiliary data such as an intensity value. The HA Bridge debugging capability will show what the Amazon cloud sent which is key to understanding what the Amazon cloud thought was said. It will then show the command that was formulated to send to the end device, in our case the ISY. It will also show the computation, if any that produced an intensity/value. All of that is required to understand where the failure is taking place in the overall process. Barry Quote
Jimbo.Automates Posted November 24, 2015 Posted November 24, 2015 I agree Barry, and my response was short, but what I meant is since he was saying he was a novice to all this, the first step in debugging would be to enter the url in a browser to make sure it is acceptable. Then you can debug if what you are saying is properly sent from the echo. Sent from my Nexus 6P using Tapatalk Quote
kupermanp Posted November 24, 2015 Posted November 24, 2015 Hi, I'm getting into this a little late. i would love to get this working. Will this work with the older isy99IR pro? If not what do I need to get and what if any modules do I need to activate. Whatever replacement i get would need IR as I use this to control some lights in the home theater. I also have a microcomputer running linux for my electricity monitor (it basically just runs a small python program to pass the polled info to a internet server). I assume I can use this computer to run the server for the alexa commands Thanks K Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.