BrettSheleski / SmartThingsPublic

36 stars 23 forks source link

Support For Tuya Dimmer (54) #26

Open pug306d opened 5 years ago

pug306d commented 5 years ago

Hi,

I am trying to get my Tuya Dimmer which is flashed with Tasmota 6.4.1 basic working in Smart Things.

I set everything up as per the readme and various guides / forum posts I found but I don’t seem to have control of the dimmer in smart things even though it looks like it is connected ok?

Should the Tuya Dimmer be working or does it require some code @changes?

image

image

Thanks!

BrettSheleski commented 5 years ago

There currently is no support for a dimmer functionality in the SmartThings device handler. Nor is there any specific code to handle that specific module type.

It wouldn't be too difficult to implement either/both.

First, one would need to implement a child-device-handler for a dimmer. It would probably be very similar to the Tasmota-Power Device Handler.

Then one would need to modify the Tasmota Device Handler to spawn a dimmer child device. This probably mean the switch statement where it checks the module type would need to have a case statement added.

I probably won't be able to get to inplementing this for at least several days. Feel free to do so yourself and submit a pull request with the changes.

On Wed, Feb 20, 2019, 2:51 PM pug306d notifications@github.com wrote:

Hi,

I am trying to get my Tuya Dimmer which is flashed with Tasmota 6.4.1 basic working in Smart Things.

I set everything up as per the readme and various guides / forum posts I found but I don’t seem to have control of the dimmer in smart things even though it looks like it is connected ok?

Should the Tuya Dimmer be working or does it require some code @changes https://github.com/changes?

[image: image] https://user-images.githubusercontent.com/1840059/53123496-24f26800-3551-11e9-89cc-e9b78ea9bbdc.png

[image: image] https://user-images.githubusercontent.com/1840059/53123554-481d1780-3551-11e9-8267-27301de3f297.png

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BrettSheleski/SmartThingsPublic/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjwuhEUbPraTZXY6Ag85k-apsapHD-Jks5vPbVVgaJpZM4bGFv8 .

pug306d commented 5 years ago

thabks for the tips - im getting close! i first added the case statement to just spawn the Tasmota-Power device handler which worked fine for basic on / off :-)

Next i started on Tasmota-Dimmer by copying sample code from the Smart Things Virtual Dimmer, the Dimmer is almost workng, it will turn on / off if i adjust the dimming level between 0 and 100 but it doesnt actually adjust the level yet as I am not sure on what commands need to be sent to Tasmota.

Any tips on how to get it to actually send the dim level command to the dimmer now?

i submitted a pull request for the dimmer device handler so far.

thanks!

BrettSheleski commented 5 years ago

Honestly I didnt know Tasmota has been updated to even offer dimmer functionality. I'd like to know to see if I can update the iFan02 module handler.

pug306d commented 5 years ago

i managed to figure it out and got it working :-)

I can now power on / off and adjuat the dimming level of my tuya dimmer using smartthings.

BrettSheleski commented 5 years ago

Awesome. I'd love to include it into these device handlers. Make a pull request!