You can use http://jsonlint.com to validate the body, it will make sure it’s a valid JSON
Now if there were only a way to control locks, thermostats, and other sensors. But just being able to turn on and off lights with vioce control is very useful.
Does bridge work with virtual switches or just real ones? I have Virtual switches for my thermostat mode/fan functions.
I’m probably the wrong person to answer your question but the bridge permits you to specify a URL for the on or off status of any device that you create (i.e. give a name to). I now have it controlling a light that is controlled by the HAI Omnipro. Given the constraints of the vocabulary understood by the Echo, you could create any named device and the on/off URLs for it. Of course, you could name a lock “lamp” and then say to Echo “turn on the lamp” and if the on URL unlocked the lock, it would work. It is interesting that saying “open the lamp” results in Echo saying it could not find lamp in the device list so it understands open/close but I’m not sure what it is looking for at that point.
You could use the dim functionality for the light bulbs for setting the temp for a thermostat. I don’t have a thermostat, but if a new device type was created that leveraged the switchLevel capability it should be possible.
I tried it by asking my Bedroom lights to turn to 68 degrees and they turned to 68% brightness
Yes virtual switches work. Anything that reports as having switch capability will work. For example I added switch to my AC unit so it work work with my AC.
Or dimmer (switchLevel).
I’m back with another problem. After getting everything working using my laptop, I wanted to set it up on a another Mac which I use as a server, Everything seemed to work until I went to discover devices at which point Echo says it couldn’t find any. The Hue bridge is running and the Post with the device definition worked (the response was 201 Created) as before. I had cleared all devices before doing the discovery lest it get confused by having 2 devices with the same name. The Tomcat server starts but when I ask Echo to do Discovery, the Tomcat console never shows the UpnP messages. I have checked that ports 8080, 1900, 50000 are not in use by any other app.
UPDATE: I found the problem though I’m not sure I understand it. The MacMini is connected to a (dumb) ethernet hub but if I connect it to the same Linksys router as the Macbook it sees the Discovery packets. I am at a loss to explain how the packets are being filtered out but that seems to be the case.
Will you please share the steps you took to open up port 1900? I just can’t seem to kill the processes.
Thanks
I did not have anything running on that port. I checked with sudo lsof -i :1900
Just wanted to mention that the $179 price for the Echo doesn’t include a remote–you have to pay $30 extra if you want one now.
I suspect that reflects the real advantage of the Echo–totally handsfree. Once you have to press the remote button, you might as well use your phone.
Oh well. I only used the remote the first day. It’s not needed.
My housemate and I each have an Echo. His is in the livingroom and covers most of the first floor. Mine is in my bedroom.
He uses the remote so he can give quiet voice commands to the living room Echo first thing in the morning to control the lights in his room.
We don’t use the second remote.
I use my remote to talk to echo in other rooms. So for example I can control my lights for rooms that don’t contain an echo by using the remote. So it comes in handy. I also use it when I am watching the TV loudly so I can talk to the echo without the noise blocking my commands. I am surprised they took the remote out of the package. But I guess it makes sense to save customers that don’t want it some money.
We’re controlling lights in 8 rooms with one Echo, no remote. Most of the first floor. But it all depends on the floor plan.
I was able tonight to finally complete the steps that I started a couple weeks ago to control the thermostat temperature using my echo.
Here’s what I did
-1 Created a virtual dimmer switch, named it thermostat
-2 Created a SmartApp that copies the virtual dimmer level to my actual thermostat
-3 Using ThingLayer to control virtual dimmer thermostat via url
So now I can say “Alexa set thermostat to 72” and she does it.
I keep the remote in the kitchen attached to the fridge (the echo is in the living room). It comes in handy if I’m playing music and want to skip songs or pause. I’m sure I could do it via voice command as well but it’s quick and easy with the remote
Are you willing to share your SmartApp code. That is the last piece of the puzzle for me. I already made SmartApps to control my Thermostat fan and modes.
It’s still very very rough, but it works. I used code from the big switch and dim with me.
My hope is that we’ll get actual integration soon. If not I’ll likely update this and make it better so that dimmer level also follows current setpoint and it gets the current mode head or cool and uses that info to set the heatpoint / coolpoint. You could also just create two smartapps and two virtual dimmers one called thermostat heat and one called thermostat cool.
definition(
name: "Set thermostat with dim level-Amazon Echo",
namespace: "matt",
author: "matt",
description: "Uses virtual dimmer level to set thermostat temp. Use with amazon echo",
category: "My Apps",
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png"
)
preferences {
section("When this dimmer is set") {
input "masters", "capability.switchLevel",
multiple: false,
title: "Master Dimmer Switch...",
required: true
}
section("Tthis thermostat will follow") {
input "slaves", "capability.thermostat",
multiple: true,
title: "Slave Thermostat",
required: true
}
}
def installed()
{
subscribe(masters, "switch.on", switchOnHandler)
subscribe(masters, "switch.off", switchOffHandler)
subscribe(masters, "switch.setLevel", switchSetLevelHandler)
subscribe(masters, "switch", switchSetLevelHandler)
}
def updated()
{
unsubscribe()
subscribe(masters, "switch.on", switchOnHandler)
subscribe(masters, "switch.off", switchOffHandler)
subscribe(masters, "switch.setLevel", switchSetLevelHandler)
subscribe(masters, "switch", switchSetLevelHandler)
log.info "subscribed to all of switches events"
}
def switchSetLevelHandler(evt)
{
if ((evt.value == "on") || (evt.value == "off" ))
return
def level = evt.value.toFloat()
level = level.toInteger()
log.info "switchSetLevelHandler Event: ${level}"
slaves?.setCoolingSetpoint(level)
}
def switchOnHandler(evt) {
log.info "switchOnHandler Event: ${evt.value}"
def dimmerValue = masters.latestValue("level") //can be turned on by setting the level
}
Now we need a hack to trick Alexa into providing us information. Something similar to the wiki question ability.
But i want to say “Alexa what is the temperature in the bedroom” and she tell me. Or “Alexa what is the status of the back door?”
Obviously it’s also be neat for her to be able to tells us things without asking. Similar to the way her alarm is triggered only it trigger her saying “XXX is arriving”, “There is motion at the back door” Etc etc.
I have to give huge props to Amazon, this is probably my favorite techy toy, mostly because 9 times out of 10 she works exactly as she is designed/current ability.