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
September 25Sep 25 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 September 25Sep 25 by apostolakisl
Saturday at 02:48 PM5 days Author Further configuration to make most useful in UD mobile. I wanted to have 4 "radio" buttons in ud mobile that worked like the kpl buttons on my wall. I wanted to tap which ever speed and have that speed turn on and have the icon turn red. Press a different speed, and the previous icon goes back to blue and that one turns red.1) Created 4 virtual nodes using the virtual node plugin. Set them as "switch". Named one each for off/low/med/high. ie, key 78 value switch, key 79 value switch, etc. Restarted the plugin. If the nodes don't show up in admin con, then restart it. Renamed the 4 nodes in the admin con to Fan off virtual, Fan low virtual, etc.2) Added all 4 of those nodes to each of the 4 scenes as responders (you could set the one that is for that node as controller, ie high virtual switch as controller in high scene, if you wanted to control that switch and have it control the scene.3) For each controller of the scene (ie, the primary scene, and the kpl button(s) controlling the scene), set the "on level" for each of the nodes to "off" except the virtual node matching the scene (ie, virtual node high is set to be "on" when the scene is on, all others are set to be "off"). Don't forget to do it for each controller.4) In UD mobile, create 4 favorites, using the scenes as the display node, one each for each scene, set them as "command" type.5) Add a command, which is to turn on the scene.6) Change your display node to the virtual node corresponding to that scene.7) In advanced configuration, set it to turn the node red if value equal to "on" (ff0000). I also had it set formatted value to "-". I added a second advanced configuration that sets the formatted value to "-" when "off". Now it just always has a dash, it doesn't show on/off which is confusing and unnecessary when the icon turns red when on and blue when off.8) Finally I set the icon to be a fan.I would expect that if you set the virtual node as a controller for the corresponding scene, you could use that virtual node as the primary node in your ud favorite, but otherwise set things up the same. I didn't try that since I already had created the 4 favorites using the scene before realizing I couldn't get the 4 buttons to turn red when its speed was on.
Create an account or sign in to comment