Closed snakedog116 closed 8 years ago
Reopening this one. Since Celsius is a critical feature for many, let's use this one to track it as an actual issue.
I'll make this the next priority for the code and will try to get this resolved this week.
Can this be done in a formula in the code? T(°C) = (T(°F) - 32) / 1.8 or T(°F) = T(°C) × 1.8 + 32?
Sounds good. Thanks StrykerSKS.
Also I forgot to mention the temperature forecast is in Fahrenheit too.
Any idea if the weather forecast (not the temp tile, but the sunny vs overcast tile) not working would have anything to do with Celsius not being set up? My app doesn't tell me that the weather is cloudy. It just keeps saying that it is updating forever. Is this related or should I open a separate ticket for that?
Yes. In fact I have helper functions already defined (and There are some built in conversion functions). I just need to go through and find all the places that it needs to be converted back and forth.
The Ecobee only uses F so have to go back and forth.
// Sean
Sent from my iPhone
On Jan 4, 2016, at 8:33 PM, ncsufire notifications@github.com wrote:
Can this be done in a formula in the code? T(°C) = (T(°F) - 32) / 1.8 or T(°F) = T(°C) × 9/5 + 32?
— Reply to this email directly or view it on GitHub https://github.com/StrykerSKS/SmartThingsPublic/issues/5#issuecomment-168875059 .
From Ecobee's API, slight modification of the formula:
The temperature values are all provided in units of 0.1 of a Fahrenheit (℉). For example, our actualTemperature of 711 is actually 71.1℉. It is up to the caller of the API to convert to Celsius (℃). You can use the following formula:
(F - 320) * 5 / 90 = ℃ https://www.ecobee.com/home/developer/api/examples/ex2.shtml
Okay, anyone feeling adventurous and wanting to test Celsius support, I have a ready for test version on the StrykerSKS-enhanced-ecobeedevice branch. After I get some sleep and hopefully some time to test tomorrow night then I'll move it over to the release branch, but in the meantime it is available now for testing.
Thanks StrykerSKS!
I've updated my apps to use your test code. Here are my findings:
Outstanding Issues
You seem to have fixed:
It would be nice to also see:
Thank you for the very detailed feedback! Let me try to address each point. Can you also provide the following details:
(2.) heatingSetpoint and coolingSetpoint Tiles: The initial current temp readings for the cool and heat setpoints is not reading correctly (it's also in the negatives and used to work). Note, when I changed the temp using the sliders these read out in celsius (this used to be in Fahrenheit when you adjusted the sliders). FIXED INTERMITTENTLY - still buggy I pressed the 'refresh' icon on the bottom and that seems to have reset something and now the temp reading works fine. But as I play with it a bit, there are some times that it pops back down to negative numbers. The refresh button fixes the issue.
The initial value will not change until a refresh is done in most cases. This is because it doesn't see that the values have changed.
As far as the reading switching to negative, I've very baffled by this. This shouldn't even be possible if you are using the latest code as there are checks for boundary numbers:
if ( getTemperatureScale() == "F" ) {
if (heatingSetpoint > 79) {
heatingSetpoint = 79
} else if (heatingSetpoint < 45) {
heatingSetpoint = 45
}
} else {
if (heatingSetpoint > 26) {
heatingSetpoint = 26
} else if (heatingSetpoint < 7) {
heatingSetpoint = 7
}
}
As you can see, the lowest value allowed in Celsius mode is 7 for heat. (There is an equivalent set of code for cool handling. (Although, since the Ecobee already has limit controls in place, perhaps I should just delete these and let Ecobee enforce the limits on the backend.)
I suspect that perhaps the Thermostat device-type was not updated.
(3.) The up and down arrows within the device seem to set the temp randomly. My temp started at 18. Initially the up arrow set it to 24, I reset it and then tried the down arrow and it went to 19. I reset it and tried the down arrow again and it went to 24 (I think that's my max). - I think this could be the same issue as issue 4 below?
This was a good catch, turns out that I was missing Celsius limit checks, so it was using F ones instead, which was screwing up the numbers! I've removed the limit checks and will simply let Ecobee use the limits already set in the unit instead.
(4.) Routines: I've tried using different routines to set the thermostat and it isn't working right:
I think the fixes from the above items have also fixed this problem as well. So far my tests on this are all working as expected.
It would be nice to also see:
- The heat and cool sliders currently slide between 0-100? Celsius ranges between 15 and 30 maximum.
- Celsius temps can be shown with 1 decimal.
- Okay, looks like the slider can take a parameter that specifies the range. I may have to use a range that encompasses both C and F values as there isn't a lot of flexibility in the Tiles, but let me see if I can make it work. (Will have to come back to this one.)
- Will also have to look at this one. There is rounding used in many places in the current SmartApp and device type. Will have to change this in several places.
The updates for the bug fixes (not the nice to have yet) have been synced up to the beta branch so you should be able to retest this now. Hopefully I caught most of everything.
// Sean
I'm using the thermostat in 'heat' mode. Yes, the thermostat is Celsius My thermostat is set to be between 15 and 24 It's not in cooling so I'm not sure what the cooling setpoint is. Do you need me to find out? Yes, I updated both devices, and the smartapp. I've attached some of the debug messages. (these screen shots are from the code you had last night except for the last one, which is this morning with the new code)
I haven't done much with your updated code this morning yet. I'll test it out this weekend.
This one is from this morning
Ok, so I've tested the device a bit more in Celsius.
Below are my findings (Note, I'm in Canada, and don't have an AC unit. So I only tested this in 'heat' mode, and only the 'heat' side of things. So I can't speak to whether the 'cool' slider works, or if it's setting the 'cool' set points properly.
Further details for 3.
Seems like there is an issue with the up arrow but only if you use the down arrow first? Does that make any sense with the code?
9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:58 PM MST: debug Generate Status Event = Right Now: Idle 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:58 PM MST: debug HVAC Mode = heat 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:58 PM MST: debug Cooling set point = 33 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:58 PM MST: debug Heating set point = 16 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:58 PM MST: debug Temperature = 20 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:58 PM MST: debug Generate Status Event for Mode = heat 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:58 PM MST: debug alterSetpoint in mode heat succeed change setpoint to= 16 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:56 PM MST: debug Entered whatHoldType() with nextTransition settings.holdType == Temporary 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:56 PM MST: debug alterSetpoint >> in mode heat trying to change heatingSetpoint to 16 coolingSetpoint to 33 with holdType : nextTransition 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:56 PM MST: debug Entered whatHoldType() with nextTransition settings.holdType == Temporary 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:56 PM MST: debug alterSetpoint - temp.value is 16 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:53 PM MST: info In mode heat lowerSetpoint() to 16 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:53 PM MST: debug lowerSetpoint() mode = heat, heatingSetpoint: 17, coolingSetpoint:33, thermostatSetpoint:17 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:53 PM MST: debug Heat: lowerSetpoint being called 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:53 PM MST: debug setTemperature(): change the heat temp 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:53 PM MST: debug deltaTemp = -19 9890ea57-2de6-439a-bcf0-eb06ae3b86eb 11:22:53 PM MST: debug setTemperature() called with setpoint 1. Current temperature: 20. Heat Setpoint: 17. Cool Setpoint: 33. Thermo Setpoint: 17
Just wanted to say thank you for adding a range of 17-85 for the heating slider. Much better than 0-100
Okay, looks like the slider can take a parameter that specifies the range. I may have to use a range that encompasses both C and F values as there isn't a lot of flexibility in the Tiles, but let me see if I can make it work. (Will have to come back to this one.)
On the slider, I had a good chat with one of the SmartThings engineers (at CES) and he acknowledged the need to have dynamic tiles (like they do for the dynamic config pages) but also said it was pretty low on the priority list. So, for now the best we can do is have a range that covers both C and F on the same slider.
Otherwise, I think I've ironed out the rest of the Celsius items, so @snakedog116 (and other Celsius users) could test the latest version to confirm, then we can close this one out.
- Adjusting Temp up and down arrows The arrows are now all working in Celsius, sending the changes in Celsius. Great. However, the up arrow sometimes doesn't increase the temperature. Below are more details. I think the issue is that if you press on the down arrow first, then the up arrow stops working and instead lowers the temp setting every time you press on it.
Did you fix my issue 3 above? I can test it again to see if the newest code changes anything?
Yes, I think I fixed it. There is a bug (feature?) in the ST side that causes it to act differently for passing the setpoint to the function when it is set to Celsius. I've put in a workaround. I still need to open a bug report with ST, but for now the code should work for the arrows. (I tested a lot of combinations.)
I find the arrows a bit hard to hit sometimes, but that is another issue I want to take up with ST as the UI needs some work from a usability (IMO).
Yup, seems to be working for me, I'll mark the other comment with a complete.
If you look at the code, or the Readme file you'll notice that making Celsius work is in the development plan but is not currently working.
For anyone using Celsius on your Ecobee Thermostat I just want to let you know of what that'll do to your thermostat. It's still usable, but you need to understand how it works:
If you remember to convert properly, the devices and SmartApps should work just fine with the code as is, until someone updates it to handle Celsius properly.