[RELEASE] Alexa Helper

Thresholds are also useful for lighting dimmers, especially with LED and CFL elements. While the user might think they’re requesting 1%, the elements themselves might only be capable of much higher numbers. So having thresholds there help too. As in, sure, let the user request 1% dimming, but truncate that to the minimum level instead. User is happy, getting what they think they want, but not running into problems like LED drivers failing or the lights flashing.

Indeed…the reason for this is when I was testing the virtual dimmer I noticed Alexa misunderstood me a couple times…nothing major, but enough to get me to worry that someone would blame me for Alexa having NO feedback except ‘ok’ that she heard the correct number. Again, I recommend folks set a tight range, or even forgo using this functionality and put a hard coded temperature into a ST routine and then just use one of the switch actions to trigger the temperature that way.

You’re correct. I pasted the wrong version :(… I wish there is some way to not publish the app even if you accidentally pushed the button. That way you guys can set that within the app and the IDE won’t publish it. No need to worry about which app to publish or not as an end user.

Thanks for this BTW…

Hehe…had that same issue…had to blow away the app and then repaste my own code when I accidently published it :frowning:
Oh well…hope it is working for you!

Can someone recommend this to the people who make these kind of tweaks? I’m sure you two aren’t the only ones to have done this by accident.

That is an inherent piece of the IDE. The parent/child apps are rather new and the IDE hasn’t quite caught up with this paradigm of ‘not’ publishing the child apps.

I did put this app in for consideration to be included in the main ST app. That would eliminate the need to copy/paste any code. Keep your fingers crossed.

1 Like

Updated the child app. For clarification, here are the latest versions:

Parent app: 3.3.1
Child app: 1.1.1
Virtual Dimmer: 1.0.0

Enjoy!

Hey Michael, thanks for all your work. This is great! I tried to use it though and everything worked well, except the thermostat. I keep mine in “auto” mode, so Alexa’s dim number was not being updated. I sent you a minor change that takes care of that. See if you like it. It works well for me and you don’t have to check for the mode.

When you say you made a minor change, did you submit it through GitHub? Let me know…what thermostat do you have? If I am following I know that I did set the temperature based on the heat or cool setting without any regard to auto…

Good call on this…

Thx…Yes. Let me know if you don’t see the proposed changes on GitHub. As for tstat, I have the Honeywell z-wave.

I don’t see it…can you put the code lines here…Might as well share. And, of course, I will give you credit in the code :wink:

Here is the change…The advantage of not checking the mode, is that if you are on heat but is too hot, you can turn the ac and if it’s colder, you can turn on the heat…

//Thermostat Handler
def thermoHandler(evt){
// Get settings between limits
def tstatLevel = vDimmer.currentValue(“level”) as int
def currentTemp = tstat.currentValue(“temperature”) as int

if (tstatLevel > upLimit){
	tstatLevel = upLimit
		//log.debug "Setting tstat to ${tstatLevel}"    
}

if (tstatLevel < lowLimit){
	tstatLevel = lowLimit
    	//log.debug "Setting tstat to ${tstatLevel}"   
}

//Turn thermostat to proper level depending on mode

if (currentTemp < tstatLevel) {
    tstat.setHeatingSetpoint(tstatLevel) 
       log.info "Setting Heating to ${tstatLevel}"
	}
if (currentTemp > tstatLevel) {
    tstat.setCoolingSetpoint(tstatLevel)   
        log.info "Setting Cooling to ${tstatLevel}"
   	}

}

Ok…so really nothing you are doing here with thermostat, but you appear to only be taking action if the temperature is above or below a certain temperature.

I think the issue with that is where you will have a non ‘auto’ setting. Let me play with this a bit more. I do like these changes but need to ensure that it will work in various scenarios.

You know what, you’re right, I adjusted it for “auto”. Maybe you can add changing the mode accordingly, to match the temperature change. I think that’s even better that staying with same mode.

E.G.

if (currentTemp < tstatLevel) {
tstat.setThermostatMode(“heat”)
tstat.setHeatingSetpoint(tstatLevel)
log.info “Setting Heating to ${tstatLevel}”
}

Looking at that now as it is definable as a variable to key off of like heat and cool…I instead would do it this way:

If thermostat is in heat mode or auto and temp is lower than setting, set the temperature setpoint
If thermostat is in cool mode or auto and temp is higher than setting, set the temperature setpoint

Will play around with this and publish new code based on my findings…I appreciate you bringing this to my attention.

edit
Thinking through the logic of this I am actually questioning how auto really works. Consider the following use case: Let’s say you are going to bed and it is 72 in the house (during winter). You tell Alexa to set the temperature to 65 (to save power). If you are in auto and see this temperature, your A/C may go on…which may not be the desired state. What happens with your equipment if you set it to a lower temperature than the current one? Technically, you would want the ‘heat set point’ to be set to 65 and NOT the cooling set point. The solution to this might just be a change in documenting how the app works and not the code…

1 Like

Well yes, when we go to bed, we tell Alexa to turn on the good night mode, which sets the heating to 68 in the winter and cooling to 78 in the summer, via customized thermostat mode director app. I am using your app for quick change to overwrite my regular schedule if for some reason we are slightly hot or cold.

Hmmm. In that case I may just update the text as you could cause some issues if you run the AC in the winter. Or, put a toggle in there to define heating or cooling. Then the auto setting will work.

In my thermostat mode/fan app, I use virtual switches for each mode and a second app to set heating setpoint and cooling setpoint with dimmer switches. I also program a limiter so any value above/below a requested temperature will automatically switch the appropriate limit.

I need to learn the parent/child set up to deal with building dimmers with in the apps.
Originally I create my thermostat apps to deal with limits of SmartTiles, but adapted well to Alexa.

Good points…taking all of this into consideration I think I will change the app with a toggle to ensure it will work in auto mode, but still heat in the winter, cool in the summer. More restrictions on the Alexa are good since there is no active feedback from her except ‘ok’.

Updated the app with a bit better GUI for the thermostat control on the main page, and added a switch to allow for control while in auto mode. The GitHub links in this thread have been updated, along with the version posting.

1 Like