BobRak / OpenHAB-Smartthings

53 stars 54 forks source link

Switch State for Dimmers #41

Closed jiggahertz86 closed 6 years ago

jiggahertz86 commented 6 years ago

Is there anyway to interact with the switch state for dimmers, I only have access to change the level. I would like to preserve the state when turning ON/OFF and interact with the item as a switch in openhab. Any suggestions on how I would do this?

BobRak commented 6 years ago

Unfortunately at the moment my Smartthings hub is packed away because I am in the process of moving. But, I think you should be able to declare the same device as both a dimmer and switch. Here is how I think it might be setup. But, I can't currently test it:

Thing definition: ` Bridge smartthings:smartthings:Home [ smartthingsIp="192.168.1.12", smartthingsPort=39500 ] {

switchLevel              KitchenDimmer           [ smartthingsName="Kitchen lights" ]

switch                      KitchenSwitch  [ smartthingsName="Kitchen lights" ]

} `

Item definition: ` Dimmer KitchenDimmer "Kitchen dimmer" { channel="smartthings:switchLevel:Home:KitchenDimmer:level" }

Switch KitchenSwitch "Kitchen light" { channel="smartthings:switch:Home:KitchenSwitch:switch" } ` The only dimmer I had was a Leviton In-Wall 600W Dimmer (Model number: DZ6HD) that I bought from the Smartthings store. You could preset the level when you turn the switch on using the paddle. If your switch has the same capability I think it would turn onto the preset level when turning it on.

Please let me know how it goes. I wish I could try it out and give you a tested answer but that isn't possible right now.

Bob

BobRak commented 6 years ago

Have you tried my recommendation and did it work?

adobito commented 5 years ago

For anyone who stumbles upon this, I have this set up and it works well.