SmartThings Community

GE Ceiling Fan Switch Custom Device Type - Low, Med, High buttons w/no slider!

fan
dth_hvac

(Adam) #78

Hi @Sticks18 and @craig! Thank you guys for your implementation of this device type. I’m having some slight issues, which are cosmetic only.

@Sticks18 The “Lit When Off” and “Refresh” buttons are askew in the bottom of the device. This is the latest iOS SmartThings App (2.0.3). I know you use android, but just wanted to bring this up. (see attached screenshot)

@craig With your device type, whenever I go into the app it will show the fan as HIGH when it’s on actually on Medium. I keep my fan on medium almost all the time and if I select medium in the device type it just stays as it is, but if I go back into the app sometime later it will see the fan as being on HIGH when there have been no changes (button presses or changed in the app). As a note, I don’t have this issue with @Sticks18’s version.

Thank you guys for doing an awesome job with this switch!


(adam) #79

First off, this code is great. Thanks. I’m having a few issue, maybe you can help:

The main tile icon always says High when the fan is on and the current speed always shows as --.
The fan changes properly from each setting, it just doesn’t display. It also always defaults to High when I turn it on after being off. Anyway to make the medium?

I’m using the latest version from the OP’s GitHub, is there another version I’m missing?


(Craig) #80

I’m having the same issue, so obviously it’s a flaw in my code. I’ll be honest and say it will most likely be a while before I get around to fixing it, but anyone wants to take a crack without me have at it :smile:


#81

Doh! I signed up just to report this same problem, i was seeing three days ago, also using the latest from the github, didn’t notice someone else posted about it till now lol.

Actually clicking low/mid/high changes the top tile to the correct value. And the changespeed tile to the correct word. But if you refresh by pulling the screen down, or if you exit and come back in, it always goes back to showing HIGH for the current value. Although the changespeed tile is always correct. Its just like the switch value is wrong but not always right away. i can exit and go back in a few times and it will say MED, and then refresh/exit whatever, and it’ll return back to saying HIGH. I’ve looked at the code, but i’m new to groovy and java and just don’t see where your logic might fail. Almost seems like a bug in smartthings app and not your code… just not sure…

Hopefully someone has a fix. :smiley: I’ve been waiting to fix this before buying all the other GE Fan Switches for around the house.


#82

Found this, and probably the key to our problems.

State Selection
The following algorithm is used to determine which state to display, when there are multiple states:

  1. If a state is defined for the attribute’s current value, it will render that.
  2. If no state exists for the attribute value, it will render a state that has specified defaultState: true. Use this in place of the “default” state name that you may see in some device handlers.
  3. If no state matches the above rules, it will render the first state declaration.

This is from the documentation. Number 3 is our problem, i don’t think the default value of device.switch is onHigh/onMed/OnLow ect… what is the values this outputs? because it is not one of those, i tried moving around those in the attribute, and it always will go with whatever is the First State declaration. So that means no state matches. I guess we have to redefine those state values.


#83

I’ve fixed alot of the bugs in this and added some features, hope it helps others. Thank You for starting this. Why the heck SmartThings doesn’t already have a decent Fan Controller right now is ridiculous. They are not new devices, and we are on Hub V2 and still nothing. See my new version here. Thanks.


(Derek W Beck) #84

Hello All, so I’ve been a forum follower for a year now, but only just bought/setup a Smartthings Hub and have my first devices. They are just dimmers/switches for LEDs, and one of these fan switches. I’m new: so I’m trying to track all of the above. My coding experience is out of date. What exactly do I need to do to get this special code and switch into my app? I see the code above, figured out how to add custom code. But do I call it a Device Type? And I just copied and pasted the OP’s code in, but there seems to be multiple refinements suggested, yet I have no clue where to put those refinements.

What would help is:

  1. Do I call this a Device Type
  2. Can someone share the code w/ the refinements built in so I don’t have to learn the code myself?
  3. Any other tips on getting this to work on my phone?

Thanks so much for your patience with me!


(Jason) #85

This is a Device Type

If you click on his Github link in post one I assume this is the most up to date version, It’s dated Sept 5th 2015.

I don’t have any real world experience coding. Everything I know (which isn’t a ton) is self taught. Adding community device types and smart apps is very simple for me.

For a more In Depth Guide see the comunity created Things that are smart wiki article here

In Short:
1.You will need to do this with the developer tools you can find that in the upper right hand corner at community.smartthings.com Edit: This should be done via desktop/laptop not mobile.

2.Click on my device types, Create new from code - copy/paste the code, Save and publish for me.

3.Then go to the my device tab. Click on the fan switch you installed and paired. Click edit. Click type and select the device type you just added. Click update. Changes should push out.

Edit: Also Another better guide than my quick version: FAQ: An Overview of Using Custom Code in SmartThings


(Derek W Beck) #86

Great, thanks. It worked perfectly. Derek


#88

The switch works great John.I wanted to the report the same issue with the high setting being displayed but soooooo much better than the slider. Also thanks to Schapper for the steps to adding it to my hub.


(Jason) #89

Anytime, glad to help.


(Sean) #90

I think the new ST app for iOS broke my fan controller. No matter what speed I set it to it changes back to 1%. I used the slider, the high/med/low buttons and I hear the fan speed up then immediately slow down and it shows 1% again. Anybody else experiencing this? Anyone have any ideas?

Thanks


(Derrek Krasnicki ) #91

Mine seems to be working I’m using the chadck zwave smart fan controller


(Sean) #92

I updated to the newest code but still have an issue. If I select high it stats and within a second it goes to medium then low (33%) then to 1%. This is a bit frustrating as I use this fan every night when we sleep and run it on medium. If I remember correctly support will do noting for me as this is a community custom device type so I cannot really call them. @ChadCK or anyone else have any thoughts?

Edit: I pulled out the tab to the left of the led and it seems to be working properly now. Any ideas why that is?


(Shaun Barrow) #93

Thanks for this!! Exactly what i was looking for


(Craig) #94

Just reading this now. If you mean “tab” by the LED on the actual switch. I would guess this is a “air gap” which is mean to stop electricity going to the “light” or “fan” so you can change a light blub (or what ever) without being harmed. My guess is it was setting it to 1% in an attempt to do just that which is also “low”.


(Craig) #95

I’m just catching up on really old forums (and I’m glad I did)! @ChadCK this is awesome I’m glad you got everything working on this app, especially that stupid “HIGH” bug.

Thanks!


#97

Why has this not made it to a official device type to be selected during the pairing process? I would love to see this officially supported as well as “Condensed Dimmer w/ Preset” for the GE Dimmers.


#98

I’m not an expert on this stuff. So, if I install a GE ceiling fan switch & this custom device type to my family room ceiling fan (currently just a dumb fan only switch/no lights) I would be able to tell “Echo/Alexa” to turn on or off my fan while I’m vegging on the couch watching tv?

Would it also be possible to have “Alexa” change the speed of the fan?

Side note: “Alexa” after numerous tries could not tell me how to spell “vegging”, but “Siri” got it on the first try. One would think that since I’m an expert at vegging, I would know how to spell it.


(Scott G) #99

Yup and sorta. On/off will work as expected. Changing speed won’t because Alexa doesn’t have context for Low/Med/High. She just sees the fan as a dimmable “light”. What you can do is tell Alexa to set the “dim” level of the fan to a value in the range you want. So “set fan to 20” for low, 50 for med, 80 for high as an example. If you want to use language like low/med/high you’ll need to use virtual switches or some other workaround. Alexa Helper SmartApp would be a good tool for this.