First of all, I want to apologize for my English. I’m from Spain.
I’m new for here, I have been enthusiastic about electronics, programming and automation since I was a kid, and over time I have learned to deal with these issues.
Last summer, I decided to learn another programing language and try to write some edge driver. I bought a Zigbee Moes Smart IR Remote Control and started to learn LUA, zigbee protocol and edge driver structure. Althought I’m very newbie yet, I want to share with you an edge driver for that device. This is the invitation to my channel
The zigbee2mqtt code has helped me a lot to understand how the device works. After the driver could learn and send IR codes, I used keypadInput and mode capabilities for the interface.
The driver has three fingerprints:
manufacturer: _TZ3290_ot6ewjvmejq5ekhl model: TS1201
manufacturer: _TZ3290_acv1iuslxi3shaaj model: TS1201
manufacturer: _TZ3290_j37rooaxrcdcqo5n model: TS1201
To learn a new code, you can select Learning in mode option, and press the button that you want to learn. Then, a led in the device turn on and you can press a button in your real remote control. You have 20 seconds for this, if you don’t press any button on Smartthings or in your remote control, the led will turn off and the mode will change to Learning Off. As well, you can delete all learned codes form Delete ALL buttons option.
I hope you like it.
Added actions for keypad, delay between action buttons, power on/off Option 1, pressed and learned buttons in history, and new preferences for delay value and history
2023-10-31 BUG FIXED
The On and Off states now work correctly
2023-11-21 BUG FIXED
Learning Mode set to “Learning off” when driver is initialized
I checked the only key that you can use in routines is power button, which can be learned as well.
I will try to use a custom capability presentation to add conditions and actions for the rest of the buttons.
I’m planning to change how the on/off button works:
Enter in learning mode:
If the switch is Off, the driver will learn Off key,
if the switch is On, the driver will learn On key.
If you only learn one key, On for exemple, this key will be sent in both cases: On and Off ,
if your learn both keys, the driver will send a keycode for On and other keycode for Off,
Add two pushButtons for each key,
Learn and send different keycodes,
I’m already checking how to add actions for every button in routines. I’m trying to use a device profile to add the automation section, but no success. As I said, I’m very newbie.
Sorry i can’t help you with code. I’m dummy.
Maybe Mariano can help and give you lights to go on. Personaly i like the option One, because i can use on Alexa to Turn on/off by voice and nantain the status of the device.
Hi, please someone with skills help this man to advance to Next stage. I did’nt see anything yet that can handle IR receivers without bridge and Run locally with edge. For me is a udge step. I still use with smartthings a tuya hub just to handle my ir receiver. If this driver grows to perfect stage, i can rid off the tuya hub… Thanks to all smartthings comunity
I wrote the option 1 for On/Off buttons
Because of the On/Off action is always present in automation, i had to do this:
Added a stack to save On/Off action and button action.
If the device is already On and the automation send On command, this has no effect
The same for the Off action.
There is no delay between On/Off action and the button action, so some devices don’t run the button action (my tv for exemple) I will add a delay in preferences.
I hope to publish a new version soon with all these changes.
I published a new version with the changes related in the previous post.
Also, I added the pressed and learned buttons in the history and new preferences.
I hope you like it.
Finally, I want to thank Mariano for his help.
Hi Javier, thanks for the update. I’m facing now a problem with this driver version: the on/off button dont work anymore… APP tell me the driver did not update yet. Other buttons working fine.
I tested my device and power on/power off (learned separately) were working ok.
The new driver version is “Zigbee IR Remote Control 2023-10-27T18:34:12.441360538”. Do you have installed that version? In that case, you should learn both power button states, because in the previous version, the driver only recognised one state for the power button.
Maybe you can uninstall the driver from my channel and reinstall it again to force the update.
The new version has two preferences in configuration, but the previous one does not. That can help you to identify the new version.
Please, can you remove the batteries from the device and put them back in?
When I was writing the driver, sometimes the device would do strange things and the only solution was a power reset.
What is the fingerprint of your device? Is it in the list of the first post?
I tested again in Smartthings my device and it was ok for me.
Thanks for your tests,