Problem: Hook HA Toggle Switches no longer turning off

I use custom API to control devices via a Hook Home Automation hub. For those of you not familiar with the Hook, it is a device that’s based on a Particle.io heart that allows control over RF-based devices (315 and 433 mhz frequencies). The API for this device that I’m using can be found at:
https://github.com/beckyricha/smartthings-hook

I’ve found that recently, the buttons in the Smartthings app that are associated with these connections are no longer working. I’m familiar with the fact that these “toggle” buttons don’t keep track of the state of the device (since there’s no backward check in from the device or the Hook).

The buttons in the Smartthings app no longer flip to the “Off” state of the button. I noticed that the buttons on the home screen of the app operated in this fashion. Now the switches are behaving in the same fashion. They no longer update to an “off” state and this behavior reflects in the loss of control of these switches from the Smartthings app. The functions still work under automations, Google Assistant as well as Alexa skills so I know the API is good for functionality.

Does anyone else have the same issues or concerns?

Buttons are supposed to represent the real current state of the associated Attribute, not necessarily the “nextState” setting in the Tile definition.

While nextState is helpful to make the button react “immediately”, it is meant purely for temporary display and not for any functionality.

That’s all well and good except that - because the button no longer changes
state when pressed, the nextstate of ON doesn’t exist. Here’s a transcript
of the behavior.
Previously: button toggles. It’s default state is on, so:
button state = On/ outlet on>button press >button state=off, the outlet
turns off.
If the button state is on but the outlet is off, pressing it twice= button

on = outlet on.

Now:
Button state=ON, button press>button state=on but outlet DOES turn off.
But because the button state doesn’t change to off, the next state of ON
isn’t available.

Can you make any suggestions on getting a non - toggle switch(one ON
switch, one OFF button)? I have very little groovy (or for that matter any)
programming language experience (except for very limited vb experience).

Sure…

  • First; If you have existing Device Type Handler code; link it here, since it is easier than starting from scratch.
  • Second; Using 2 “standardTiles()” - one that calls on(), one that calls off() … is pretty trivial. You even ignore the “nextState” parameter then.
  • You may want to add a “valueTile()” that shows the presumed state, but if you can’t be certain of knowing the state, then… no need to bother.

Okay, sorry that I’m just getting ’ round to this. I tried a couple of mods to the code and - obviously- I’m not getting “groovy”. While I was able to separate out the standard tiles, It still only populated one switch tile in the app. The code has a “toggle” functionality that I believe is affecting this. The code reads:
def params = [
uri: “https://api.gethook.io/v1/device/trigger/${device.deviceNetworkId}/${toggle}/?token=yourhooktoken
]
[Yes- I did replace the yourhooktoken]
The code I’m working from is : https://github.com/beckyricha/smartthings-hook/blob/master/hook.src
Thanks again for looking in on this.

Im having the same problem

Same problem here. “toggle” is not the issue. That’s just a variable for the On or Off that is passed in the URL.

I am also having the same problem. I cannot get the device to cycle the power on/off.

Same here. Discussed with Smartthings support and they’re not willing to assist. Likely a push to sell more of their own outlets. This worked so well for so long. -.-

EDIT: A very kind gent on GitHub provided the fix for me by simply modifying the handler code to include “nextState” as shown here: https://github.com/beckyricha/smartthings-hook/issues/1#issuecomment-353414016

Hopefully that helps someone assuming the requirements are that of my own :slight_smile: