radinsky / broadlink-http-rest

Broadlink RM/RM2/RM Pro/RM3/BlackBean/A1 Web server with REST API (like..)
MIT License
156 stars 47 forks source link

TC2 switch support? #8

Closed bigpresh closed 6 years ago

bigpresh commented 7 years ago

Firstly, broadlink_http_rest is working brilliantly for me so far. I picked up an RM-Pro and wanted to automate various IR and RF controlled stuff, and didn't really want to be running RM-Bridge on an Android device etc - this project is exactly what I was looking for, and I'm very grateful for it! (Take beer money donations?)

I've picked up a TC2 dual-gang lightswitch, which I plan to install soon and pair up with the RM-Pro via the Broadlink app, but once that bit is done, I'm curious on how to operate it via broadlink_http_rest - have you done such a thing / have any advice?

If I get it working, would you be interested in a PR adding documentation on it, and possibly any new features that are needed to make it work?

radinsky commented 7 years ago

Thanks for the kind words and for a beer (maybe someday :smile: )

Regarding the TC2 broadlink switches, I never experienced with them, always was using the generic "crystal touch" switches with RF remote controllers.

What you can do, there's some bug/feature/workaround that actually should work for you. 1) Learn your TC2 with broadlink native app (e-control), check that you can control the switch. 2) Start the broadlink-http-rest as usual and learn command for TC2, for example "kitchenlights" : http://localhost:8080/learnCommand/kitchenlightson 3) While in learning mode, use the e-control app to send the "on" command to your TC2 switch (that you learned in (1) )

That's it, verify settings.ini that the command learned correct and test it by using sendCommand

bigpresh commented 7 years ago

Ohhh, cunning - so it can learn codes that it itself is transmitting? That would do the job just fine in theory then - I shall give that a shot, thanks!

radinsky commented 7 years ago

Yes, I did it in past and that worked for me. Again, I don't sure 100% regarding the behavior of TC2 but should be exactly the same. I will keep the issue open for a while to get an update from you, thanks!