August 29Aug 29 I just finished a Tuya plugin for ceiling fans. Tuya is a smarthome platform that lots of companies use to put their products into a smarthome ecosystem. So there are lots of things that could be Tuya, but I only own fans and therefore that is all I included.This is a local plugin, no cloud. Except you need to jump through some hoops on the cloud first to get your device id and key. I put detailed instructions on github, but the basic jist is you register your product using the tuya app, you register as a developer on the tuya website and then after a little more menu navigation and a few trial and error choices, Tuya gives you the info you need to let IoX converse directly with your device, all within your LAN.In all likelihood, it would probably not take a ton of work to add additional devices to the plugin, but I would have to have access to those devices to do so.This probably will be my last plugin for a while since I no longer own anything "smart" that doesn't have a plugin. Edited August 29Aug 29 by apostolakisl
5 hours ago5 hr Author I have finally gotten around to really using the plugin. I thought it would be helpful to give example how to use it for fans in conjunction with a kpl (or kpls).1) Create 4 scenes in IoX, one each for fan(s) low/med/high/off2) Add all the tuya fans you want controlled by the scenes.3) Set fan "command" to speed 2,4,6 for the low/med/high scenes respectively. For fan off scene , set command off for each fan.4) Add each of the 4 kpl buttons to each scene, with the 1 kpl button in each scene as a controller for the scene that does its job. ie, in scene fan high, put kpl button high as a controller.5) In each scene, click on the controller kpl button for that scene, and set the fan speeds accordingly and set the other kpl buttons "on level" to "off". If you are using multiple KPL's, do it for each of the two kpl controller buttons (one from each kpl). ie, in fan high scene, click on the red "fan high" kpl button, then in the menu on the right, set the "on level" for fan off/low/med to "off", set the fans to speed 6.6) Set the kpl button toggle mode to "on only" for the 4 kpl buttons.To integrate with Alexa1) expose the 4 scenes to Alexa, set them as "switches"2) have Alexa discover (usually does it on its own)3) create 4 routines, one for off/low/med/high. Create a spoken for each routine.4) to each routine, add the correct scene.You need to use routines here because the scenes are designed to only ever be turned on. As a device on Alexa, Alexa could turn it off. So just like you set your kpl buttons for on only, you need to set alexa for on only using routines.Now Alexa will control one or more fans in parallel with each other and your kpl backlights will match the current state of the fan(s). This is particularly a good way to do it with multiple fans that you want to work together along with a fully sync'd KPL. Edited 4 hours ago4 hr by apostolakisl
Create an account or sign in to comment