I have a Tuya Zigbee IR Remote that controls 2 different lights (soon to be 3). I’m using this driver. I want these synced to a virtual device or devices so I can use them in existing Room Lighting rules for the room, but I feel there is a better way to do this. This is what I have so far that is working and doesn't have too much of a delay:
I have the rule repeat pushing a button 3 times because sometimes it doesn’t turn on/off the actual devices even when I see the command being executed in the logs. Since these are battery powered lights, I’d hate for them to not turn off. For some reason, without the 0.1s delay, only the last command in the Repeat gets executed.
My first attempt at this was 2 different rules syncing to 2 different virtual devices, but because I have the "Repeat 3x every second" for EACH device, there was a considerable delay between when motion is detected and the lights would turn on/off.
Does anyone have a better way to do this?
I wrote myself a quick little app to connect virtual switches to Zigbee IR device code names. Then you just use the virtual switches as if they were normal devices in your automations, and the app sends the codes in the background when the switch state changes.
If you want to play around with it for your use case.
Zigbee IR Switch Connector
1 Like
Thank you! This is exactly what I was trying to do with the rules. I never really took the time to figure out how to code apps and drivers in Hubitat, but are the switches hard-coded right now to the 5 in this?
Yeah, I created it for up to five switches at the time, but I just realized what I didn't add was the App Name preference, so I added that to it just now.
That lets you add as many instances of the app as you need, and name them differently, to use as many virtual switches you need by adding more instances of the app.
1 Like
I ended up switching back to the Broadlink + Powerbank
I just couldn't get this to work. Whenever I would try to turn on multiple devices one after the other, it kept stepping on each other and there would be at least 1 that wouldn't turn on/off and I didn't want to have to deal with setting up delays. I don't have the same issue with the Broadlink. Maybe I'll use this in a room that only has one IR light controlled at a time.
Hmmm... that is good to know. I'm not sure if my Zigbee IR powered from USB will have the same issues. I got mine for like $5 on AliExpress, and it is working great right now to just run my fireplace. I replaced my RM-4 pro in the living room with it because it was smaller and not so noticable. However, come Christmas I need to run all the inside lights, with candles, string lights, and the Christmas tree with it. I may need to go back to my Broadlink come Christmas time.
The other reason I will need to switch back, is I didn't think about the fact that the sendCode command in the Zigbee IR does not allow for repetitions to be sent, like I can with Broadlink, and I depend on that for setting the level of my xmas lights, by calculating how many repetitions are needed for up and down to get to a brightness level.
This is my Broadlink Switch Connector that was modified for the Zigbee IR. I made it to send off with two repetitions, to make sure the device turns off, using that feature in the Broadlink driver.
1 Like
Sweet! Thank you! I looked at what the Broadlink does when you use the built-in function that sends the code with repetition and it only sends the code once. The string it sends seems to have that built-in. Unlike the Tuya Zigbee driver, which shows being sent multiple times and sometimes it doesn’t like it when you send them quickly one after the other.