Michael, thanks so much for the code. even being a newbie it was simple following you directions.
Excellent to hearâŠI realized this âvirtual dimmerâ could be used for a bit better control on Sonos as well. Right now you can turn on or off the sonos from AlexaâŠbut not change the volumeâŠCould actually add that. Anyone see value in that?
Hell yes! I do⊠Any control above play/pause is very welcome.
For those that are following this thread, Alexa Helper now has connected speaker control (i.e. Sonos). Similar to the temperature control, you will control the speaker volume using a virtual dimmer. In addition, you can define virtual momentary tiles to control next and previous tracks.
The GitHub has been updated and the links above will take you to the proper place, so here are the consolidate instructions:
-
In your IDE, create a new device type by copying/pasting this dimmer code and publishing it. Then, in the âMy Devicesâ section of the IDE, create a virtual switch. Maybe call it âSpeakerâ
-
Find the Alexa Helper-Parent Code. Copy/Paste it into the IDE and SAVE and PUBLISH
-
Find the Alexa Helper-Scenario Code. Copy/Paste it into the IDE. SAVE but DO NOT publish
Now, create a couple momentary switch tile devices in the IDE for next and previous track buttons. While you may have the impulse to simply call them Next Track or Previous Track, those are Alexa key words. I used âSpeakerNextTrackâ and âSpeakerPreviousTrackâ.
Find the speaker area of the main app and associate the appropriate devices. If you have previously âDiscoveredâ your speaker through Alexa you can âforget itâ in the Alexa appâŠthis should give you the same functionality.
I did put a safety mechanism in here that if you start the speaker through the Alexa you have the option to set the initial volume. This will prevent a previous 50% level from blowing your ears out when you first turn the speaker back on.
To turn on or off the speaker simply say: âAlexa, turn âonâ, âoffâ the speakerâ (where speaker is the name of your virtual dimmer.)
To change the volume, say âAlexa, set speaker to ####â. If you have limits set up, the speaker will only work between those limits.
To change tracks, say âAlexa, turn on SpeakerNextTrackâ or âSpeakerPreviousTrackâ.
Here are some possible limitations:
If you turn on the speaker with âAlexa, set speaker to ####â and your initial volume is set in the app, it will go to the initial volume first. You will need to issue the volume command again.
Sometimes Alexa requires a percentage to set a dimmerâŠso the command might be âAlexa, set speaker to #### percentâ
Just remember, these are little âhacksâ to get Alexa to control more complex devices. There is only so much that could be done with controlling an external speaker, but this is more than just Play/Stop.
Please play with the code and see if there is anything I missed or you have an issues with it.
This works really well. Thank you so much!
I will be installing an Ecobee 3 tonight, so I can try that with these apps/Device as well.
Question about virtual dimmers.
I created 1 in IDE and named it virtual dimmer.
Can this 1 virtual dimmer be used for both my Sonos and my thermostat(ecobee 3) in ST and Alexa?
Technically, yes, you could, but realistically you wouldnât want to. The way this works is it looks for a change in the dimmer and then send the corresponding commands to either the thermostat or speaker. If you use the same device as the control, when you set your speaker to 20 you would set your thermostat to 20 as well. Conversely, if you set the temperature to 76, you will blow out your ears with the speaker being 76% volumeâŠ
I recommend separate devices for each speaker and thermostat.
Lol⊠I wouldnât want to blow my ears off! Thanks for answering so quickly!
So I could name the dimmers:
Virtual Sonos dimmer
and
Virtual Thermostat dimmer
CorrectâŠOr anything else Alexa will recognizeâŠ
Well in IDE I named them
Virtual Sonos dimmer
and
Virtual Thermostat dimmer
But in Alexa I created my groups named
Speaker
and
Thermostat
Same way I have mine and it works great!
So if I turn on the âauto modeâ switch that means that in winter it will only turn heater on and in summer only turn the a/c on? Iâm not quite getting how that works.
Is there a way to use Alexa to switch the mode and say something like âAlexa, turn heater on to 68 degreesâ?
Also, is there a way to ask Alexa what the current temp is?
When setting the temperature via SmartThings, most thermostats can accept 2 settins, the Heating setpoint and the Cooling setpoint. At first, I had the app check which mode you were in and set the proper setpoint. However, there is an âautoâ mode that allows both settings to be activeâŠSo if you have an empty house for a year, it would cool in the summer (anything above a certain set point) and heat in the winter. Unfortunately, the way the logic worked in the app is that if you were in auto mode it wouldnât send anything to the thermostat as it wasnât technically set to heating or cool. So, I did some modifications and now what happens is that it sets both the upper and lower thresholds to the same number when in auto mode. This probably has some issues if you are in the winter, but the temp in the house (somehow) gets above the setpoint. In theory, it could set off the A/C unit. I recommend you NOT set auto on your thermostat unless there is an over arching need for it, and then I say be careful.
To answer your other question, yesâŠin theory you could have a virtual switch that is called âheatingâ or âcoolingâ. You would then say âAlexa, turn on heatingâ. Similarly to the setting for the speakers you could then set a default temperature to set the thermostat to when you issue this command. If you wanted another temperature, you would have to issue the other command âAlexa set temperature to 68â (degrees probably wouldnât workâŠalexa thinks this is just a dimmer switch). My app doesnât have the ability currently to set the different thermostat modes, but that isnât a bad ideaâŠwould you use it if it were in there?
Finally, if you are asking if Alexa can tell you the temperature of the house, the answer is noâŠoutside of building your own Amazon app, there is no feedback TO the AlexaâŠi.e. SmartThings canât make Alexa say anything. This is a limitation of the way the device works.
Does that help?
I have apps that I posted that can control various functions of the thermostat. One controls the mode and fan and the other deals with setpoints. As for modes and since I have four seasons where I live, I use cooling for summer and heating for winter. Auto is usually during spring and fall when the temperature swings during the day may require switching between heating and cooling.
As for the same temperature setting for both setpoints, I would avoid as well, you could always code so they both cannot be the same. Although I would thing the once the thermostat temperature reach the setpoint it would turn off whichever unit was running.
I will probably add these revisions (set heating, cooling, auto) in the next version of Alexa Helper.
I would definitely use it in my household. The main reason is I have a wife who would think âI need heatâ in her head and have the tendency to say something like âset heater to xxâ or âturn heater onâ. The reason it would be nice to know what it is set at currently is the fact that if she just wants the heater on, it would be nice to know what the current temp is so she could then change the thermostat a couple of clicks up to make it turn on. However, I understand the limitationsâŠ
Thanks for all of this great work!
OkâŠhere is the next revision to test, 3.3.0 of the parent app (no need to load any others if you already have them working).
I separated the sections out for better GUI usage. In the temperature area you can now choose virtual switches (momentary tiles are recommended) to activate heating, cooling and auto modes. In addition, you have the ability to have a set point sent to the thermostat when turning from one mode to another. For example, if you have a momentary tile called âHeating Modeâ, and a heating set point to 67, all you would say is âAlexa, turn on Heating Modeâ. If your thermostat is in HOME mode, the thermostat would set to HEATING and then set the thermostat to 67 degreesâŠIf you have set up the virtual dimmer and feel 67 is now too cool, you could then say âAlexa, set thermostat to 70â assuming your virtual dimmer is set to âthermostatâ
I just realized as writing this that there is no command to turn off the modes. I will work on that, but these are the use cases that are covered now.
Thanks for the suggestions to make this app better and better.
To load, simply copy/paste this code into your IDE and save and PUBLISH it:
@MichaelS I just want to say thank you for such brilliant work! I am a UK ST and Echo user and this makes it pretty seamless to control my Routines via IFTTT.
I feel like I am living on the set of Star Trek now
That was the goalâŠMore enhancements to come!
Sorry guys but I missed the train and am late, had the original Alexa Helper, awesome! Have filled 5 out of 6 slots so I installed the new helper, child unpublished and dimmer device, hey have nest and sonos why not right! Now what do I do when I run out of slots? Install another version of helper? Also when I click on version if still says 2.0.2 even though I deleted and put in new code, Iâm not seeing the new options of thermostat etc