tgsoverly / smart-things

Custom device type handlers for the SmartThings platform
MIT License
3 stars 2 forks source link

level capability should map 1-100 #5

Open jterrace opened 6 years ago

jterrace commented 6 years ago

The switchLevel capability has no way to set a min and max value, so the general convention is that it should go from 1 to 100. When I import this device into ActionTiles, for example, it shows a 1-100 slider, which makes it very hard to pick a value from 1-10.

It looks like they're proposing a new fanSpeed capability, but even that doesn't look like you can specify the min and max value.

I'd like to propose using 1-100 as the level capability and mapping them to 1-10, e.g.

hollapm commented 5 years ago

Did you find a way to do the above? I'm a newbie at this and agree that it should go to a max of 10.

One challenge with the dimmer in doing increments of 10, at speed 3, it shows the dimmer at 3, at speed 7 it shows the dimmer at 7. I don't thing a dimmer setting above 10 is going to work? Note that I have a 10 speed fan as well.

jterrace commented 5 years ago

Yes, I have pending changes that I've been using on my smartthings hub for a long time. I didn't send a PR though because I wanted to fix #4 as well.

hollapm commented 5 years ago

Any way that you can share what you've done to your system/code?
Also are you still using the classic or the newer capabilities? In looking at the newer API it looks like multiple devices can be put into one. Basically the Whole House Fan as it is run today is ultimately using the switch call (which allows it to have the two buttons for increase/decrease plus power button on the bottom. In thinking about this more, I wonder if a button can be added at the bottom for time increase, and there the current secondary_control area is, it would update with time remaining there? The button would be at the bottom, similar to the power button?

Would love to see what you have done. I use to code a "long time" ago but that was with C++. Do you have any applications that you recommend which may color code variables, code etc? I'm on a Mac if that makes a difference.

Thanks jterrace and I hope that I can help with this project as well.

jterrace commented 5 years ago

I sent out #10 with my changes.

I'm using the generation 2 controller. As far as I understand it, there is no API for the new controllers. See the last paragraph here: https://blog.airscapefans.com/archives/new-controls

Is that what you meant by the newer API?

As for IDE, I use Eclipse with a Groovy plugin. But it doesn't work that well honestly. Most people use the SmartThings IDE as far as I know, since otherwise you have to copy/paste from your own IDE into there anyway.

hollapm commented 5 years ago

Your assessment is correct, I ment the API from from smartthings - https://graph.api.smartthings.com Also are you using the Classic Smartthings app or the newer app? With the updates I d/l which you submitted I'm not getting anything to work, but I don't know if its due to the fact I'm running Android Q on my phone which is causing issues with Smartthings either. Grr...

I'd love to help test out as well ;-)

jterrace commented 5 years ago

It will definitely not work with the new app, only smartthings classic. Which do you have?

hollapm commented 5 years ago

I'm using the new interface which is what Samsung said I needed to use with my phone. I have tried the "classic" with an older phone and it is sticking on "updating"... On Monday, June 24, 2019, 04:32:21 PM PDT, Jeff Terrace notifications@github.com wrote:

It will definitely not work with the new app, only smartthings classic. Which do you have?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jterrace commented 5 years ago

@hollapm - please try the pull request with the latest commit. I think I fixed the issue you were having.

hollapm commented 5 years ago

Jeff,It's working much better.  The levelDown is not submitting the fan code and refresh is giving an a java error. Also Max is only going up a single level.  One other item, the screen only shows 0 and the bottom right "updating".  This has been the case previously but thats more cosmetic than anything ;-) Here's a snapshot of the log:c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:23 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:23 PM: debug airscape: onc93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:14 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:14 PM: debug airscape: onc93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep roundedLevel 0.0 roundedTarget 10.0c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep level 0 target 100c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug airscape: maximumc93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep roundedLevel 0.0 roundedTarget 10.0c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep level 0 target 100c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug airscape: maximumc93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug getNextStep roundedLevel 0.0 roundedTarget 10.0c93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug getNextStep level 0 target 100c93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug airscape: maximumc93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:48 PM: error grails.validation.ValidationException: Validation Error(s) occurred during save():

@hollapm - please try the pull request with the latest commit. I think I fixed the issue you were having.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

hollapm commented 5 years ago

Also it looks like the tile on and off are flipped:         standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {      state "off", label: '${currentValue}', action: "switch.on", icon: "st.Lighting.light24", backgroundColor: "#ffffff"    state "on", label: '${currentValue}', action: "switch.off", icon: "st.Lighting.light24", backgroundColor: "#79b821"

off shows action switch.on On Saturday, June 29, 2019, 08:30:35 PM PDT, Paul Holland hollapm@yahoo.com wrote:

Jeff,It's working much better.  The levelDown is not submitting the fan code and refresh is giving an a java error. Also Max is only going up a single level.  One other item, the screen only shows 0 and the bottom right "updating".  This has been the case previously but thats more cosmetic than anything ;-) Here's a snapshot of the log:c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:23 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:23 PM: debug airscape: onc93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:14 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:14 PM: debug airscape: onc93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep roundedLevel 0.0 roundedTarget 10.0c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep level 0 target 100c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug airscape: maximumc93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep roundedLevel 0.0 roundedTarget 10.0c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep level 0 target 100c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug airscape: maximumc93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug getNextStep roundedLevel 0.0 roundedTarget 10.0c93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug getNextStep level 0 target 100c93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug airscape: maximumc93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:48 PM: error grails.validation.ValidationException: Validation Error(s) occurred during save():

@hollapm - please try the pull request with the latest commit. I think I fixed the issue you were having.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

hollapm commented 5 years ago

I also have to edit out unsubscribe: def updated() {//    unsubscribe()    initialize()}

On Saturday, June 29, 2019, 08:32:51 PM PDT, Paul Holland <hollapm@yahoo.com> wrote:  

Also it looks like the tile on and off are flipped:         standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {      state "off", label: '${currentValue}', action: "switch.on", icon: "st.Lighting.light24", backgroundColor: "#ffffff"    state "on", label: '${currentValue}', action: "switch.off", icon: "st.Lighting.light24", backgroundColor: "#79b821"

off shows action switch.on On Saturday, June 29, 2019, 08:30:35 PM PDT, Paul Holland hollapm@yahoo.com wrote:

Jeff,It's working much better.  The levelDown is not submitting the fan code and refresh is giving an a java error. Also Max is only going up a single level.  One other item, the screen only shows 0 and the bottom right "updating".  This has been the case previously but thats more cosmetic than anything ;-) Here's a snapshot of the log:c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:23 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:23 PM: debug airscape: onc93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:14 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:14 PM: debug airscape: onc93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep roundedLevel 0.0 roundedTarget 10.0c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep level 0 target 100c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug airscape: maximumc93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep roundedLevel 0.0 roundedTarget 10.0c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug getNextStep level 0 target 100c93624ef-7674-4f21-8cb3-547ae20a4f01 8:21:08 PM: debug airscape: maximumc93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug sending fan code 1c93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug getNextStep roundedLevel 0.0 roundedTarget 10.0c93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug getNextStep level 0 target 100c93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:59 PM: debug airscape: maximumc93624ef-7674-4f21-8cb3-547ae20a4f01 8:20:48 PM: error grails.validation.ValidationException: Validation Error(s) occurred during save():

@hollapm - please try the pull request with the latest commit. I think I fixed the issue you were having.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.