Yes. I had to adjust the values in the script.
I did but it always went to low. I pulled the power tab out on the switch itself then pushed it back in and that took care of my problem.
I only had to adjust the low value to 30.
I set up this device type and it seems to work fine in the ST app, but echo still sees it as a dimmer so I have to tell it a percent instead of low/med/high. Any way around this? I’d love to be able to say “Alexa, set the fan to medium” instead of “Set the fan to 50%”
I have the exact same request…just got a Echo and it would be nice to say “Set Living Room Fan to Low” instead of randomly picking a number between 1 and 30.
You should check out Ask Alexa…you can do that exact thing (almost with those exact words).
Try this, if you’re using askAlexa…
Continuing the discussion from Z-Wave Smart Fan Control Custom Device Type:
Continuing the discussion from [RELEASE] Ask Alexa:
You could also do it with ifttt and a virtual switch. Alexa trigger living room fan low
@johnconstantelo I’m using your DTH (Thanks!) and have one small anomaly. I suspect it’s a limitation of the hardware, but wanted to see if you could do anything. I’m checking the isPhysical state, particularly whether it has been pressed off.
If the switch is on, it reports a physical switch off. Good.
But, if it’s already off, it does not report the physical press off. I’m trying to use this to override other actions, so it’s useful to press off an already off switch. Any chance your DTH can see this?
Hi @CAL7, I just tested both physical and through the app. All scenarios worked as expected. I was actually surprised how quick the app updated after I physically turned off or on the fan.
@johnconstantelo Thanks for looking at that so promptly. I’m still figuring out the nuances of ST, so I had not checked the device log; but now I see the same thing you pointed out.
The logs show that, even when already OFF, a physical press sends an OFF. So, I suppose I need to look elsewhere for a solution. You referenced “through the app” - is this the device handler status page or can you refer me to a SmartApp that you know responds to the physical press?
I’m stymied because the only apps I know of, and have tested, that differentiate between digital and physical OFF are Rule Machine and CoRE. My test case using both of those apps does not give me a response to the OFF if the switch is already off (they do if the switch is on and the physical press changes the state to off).
I would appreciate any help you can give to point my way to the next step of debugging. Tagging @ady624 in case he knows any reason that CoRE would purposefully ignore an OFF if already in an off state.
I meant the phone app, sorry about that. The device updated in the phone app within a few seconds of physically using it.
I was able to test, and you’ll see in the screen shot below that the first entry is another physical event turning off the switch (@5:55pm) which was already off (@5:53pm):
Every time I press off on the device I get a log entry like the first one.
What I see in the log agrees with your test (Thanks for that, BTW). But my two test programs, with either RM or CoRE, never report the physical OFF press if the condition was already off.
(Contributing to the flakiness is that rarely, but every once in a while, a digital OFF will be interpreted as a physical OFF.)
Do you know of a SmartApp that can differentiate between digital and physical state change?
No worries. I’m actually still using my original code with just a couple changes from others (display the transition of states, ie “turning off”), and not the one people have been tweaking above. I don’t need to adjust any parameters for low/med/high because all my fans are the same and what I hard coded for those values work perfectly fine.
@johnconstantelo Hi, again. I spent some more time (ref: Post #127-129) trying to diagnose my attempts to determine the physical switch press.
My issue is that if the switch is OFF, the physical press OFF does not get reported by CoRE. If the switch is ON, the physical press OFF does report. I set up a simple piston to look just for the physical press.
So, I went to the logs. Here I see that when it starts OFF, each switch off press gets one log entry. But, CoRE does not see it.
However, it is different if I physically turn on the switch (I don’t believe it matters if it’s turned on programatically or physically) before pressing the OFF. With it on, the single OFF press gives two log entries:
It would seem that the PHYSICAL press indicator only registers if it is also a change-of-state. As you pointed out in #128, each press is logged; but there is something different depending on whether it is a state change and that difference hides it from CoRE.
Is it possible for the DTH to send the notification of the switch press, whether previously on or off?
Also, tagging @ady624 to see if there is a CoRE solution.
You need to manually specify isStateChange: true in the sendEvent if you want each to register into CoRE or any other subscribed app for that matter. Otherwise, isStateChange is set automatically by ST and I believe that if new state and old state match, it is set to false. CoRE also has code to prevent duplicate messages, but it would warn you in the logs if it filters out an event. Events are not filtered if data exists in the event object (think buttons with their buttonNumber data element) or if the event value is a number (temperature, power, etc)
If you’re willing to look into it any further, I’d be happy to send you logs or whatever would be helpful.
OTH, if this is too much of a niche problem, I’ll leave it alone. Thanks for your earlier comments - they were very helpful.
Sorry I couldn’t help too much @CAL7.
For other community members still using my DH, the code for my original DH was based off of ST’s dimmer DH, and that has changed since then. I did create a new DH using ST’s latest dimmer switch DH:
I might have been seeing something similar. Just not smart enough to know. At night I am using CoRe to set my fan speed to low at 2am. Usually it’s on med or high when we crawl in bed. Gets cool later so switch to low when we’re asleep.
Anyway I had trouble setting speed using a level. I ended up using the "triangle"loW command available in CoRe. This works every time. Buuuut smartthings and smartiles still show the fan in whatever previous state was.
Weird but I didn’t care was just a visual thing.