@tomw First off, great work on this. I retired the previous community driver and imported codes into this one with no problems.
I did have a couple of issues when learning new codes though. After a sweep is completed, but no frequency is found, the UI continues to say "sweeping" even though the light on the Broadlink is gone. I have to manually Cancel RF. Is this expected?
The device I was trying to add is an Aeratron fan. I did multiple sweeps but couldn't pick up it's frequency. I don't think its remote operates in the normal way when a button is pressed and held. I did find out from a Broadlink forum that the fan remote operates on 433.85 MHz. There was no way to input this into the driver however, so I modified the code to allow setting of the remote frequency. After that I was able to skip Sweep RF and move onto Learn RF which it did successfully.
You may way to consider allowing the remote frequency to be set for cases where the sweep fails. I can submit a pull request if you'd like.
Re: sweep completes on the device but keeps running in Hubitat
There isn't a response from the device (as far as I could tell) that indicates the sweep ended. So, I just have to wait a sufficient amount of time with software-timing on the Hubitat side before I assume that it failed. I chose 40 seconds, which seemed slightly longer than the Broadlink device would run. If you wait that long, does it end on its own?
Re: manually setting frequency
I did a version with this feature privately for another user, but it didn't work reliably in stress testing. Specifically, when I switched between ~315MHz and ~433MHz remotes, it wouldn't always work and I would have to sweep the frequency between them in order to get a successful learning operation on my RM4 Pro. I'll contact you privately with that modified code to see if it works for your purposes and to see if we can dial it in.
Hello everyone. I have single RM4 Pro. I installed the driver, the app and even saved the channels I want to control. Then I added broadlink remote to the list of devices in my hubitat dashboard. Through "button number" I can execute all the commands that I have saved. Now I want to add all of them to sharptools dashboard. I don't really know how to set it up. Do you have to make a virtual device for each button separately? Is it even possible?
I don't use SharpTools. What options do you have when configuring buttons?
You could do the same thing with supplying the saved code name with the button push. Or you could use the sequence feature to execute a series of saved commands with a single button push.
If those don't work, can you explain more about the differences between how you want to use it with the SharpTools dashboard and how you have it working with the Hubitat dashboard?
Do you have multiple different buttons you want to control?
It's a bit of an advanced approach, but if you have multiple different buttons you want to be able to control (especially somewhat related to each other), I would use a Super Tile to bring all the different buttons together on a single tile.
From there, I would create a rule to make it easier to control different buttons with a parameter. If I understand how your button device works, your rule would just need a single action to call the push() command on your button and use a Context Variable (Event > HTTP > Parameter -> 'button')
You don't need any Triggers and 'button' as the parameter name is arbitrary so you can use whatever you want as long as it's consistent.
Back in the Super Tile, add a static icon or label to the Super Tile and edit it with a Hyperlink action... for the URL use a special $.runRule("RULEID", {"button": 1}) syntax where you substitute "RULEID" accordingly and the number in the 'button' field accordingly. This enables you to use the single rule we created above to change which button is 'pressed'.
--> add tile --> Things --> Broadlink RM 4 Pro --> Change Layout --> Hero Attribute --> Edit --> and there is option: LearnedCode and SavedCode but that's all.
Anyway thanks for your help. I use sharptools rather than hubitat dashboard. I might have to change my habits.
I have 8 independent circuits in my garden. I would like to have each of them on a separate button. As i did in hubitat dashboard (8 buttons from one virtual device via the corresponding "button number").
In the example I provided, each of the icons (or labels) on the Super Tile acts like its own button controlling its own circuit in your garden.
That being said, you can use the same rule concept I mentioned above and if you want individual tiles rather than a Super Tile (with multiple garden circuits individually controllable on a single tile), you can use the Hyperlink Tile with the same $.runRule() syntax mentioned above.
You can use the Editable Hyperlink so you don't have to create a Hyperlink resource in advance and you can just edit the URL to modify the $.runRule() syntax directly.
--
One of the really neat features of the Super Tile is you can control multiple devices (even different devices) from a single tile. And you could even upload an image of your garden as an 'icon' and move it to the lowest layer of the tile like a background and then add icons/labels on top of that so you have a nice visual layout of your garden.
In SharpTools, buttons are considered sensor devices in that they are typically physical buttons that are only actuated when you physically press them and thus only report status. As such, you would need to use a rule to be able to send the press() command for a particular button number.
You could create an individual rule for each button and then add the rule directly to your dashboard. This is probably simpler in terms of grasping the first-time setup, but I find the parameterized rule approach mentioned above much simpler to maintain when you have multiple button numbers to press (and is quick to grok with a reference example).
I am looking for an IR Blaster to use for my Aquarium light. It has a remote with a lot of buttons on it. I would like to have 4 buttons programed in (learned) and use Hubitat to control them. Will the RM4 mini work for that?
Hi Tom, love what you have created.
Bit of background - I'm very new to Hubitat and slowly adding devices. I have a large fancy picture window with inside the glass venetian blinds and controlled by RF remote. to open the blinds I need to press a up button several times and to close them the down button several times.
To raise the blinds I need to press and hold the up button (probably for about 6 seconds) and then it realises and it switches to raise. and then I can release the button. the same for lowering the blinds, press and hold the down button until it gets into 'lowering the blinds' mode and I can release the button.
I tried learning the continuous hold and it looks like its just a continuous sending of said button
I have installed the app and driver for my Broadlink RM 4 pro device and successfully added an up button and down button to the dashboard (I saw it on this thread and used add button and the button number is the saved code name)
so 4 questions really -
is adding it as a button and using the saved code name as the button number the best way to set it up in the dashboard?
how can I do 5 or 6 presses with one command for either button (probably a Hubitat question really)
how can I send a continuous hold of the "button"? (I've tried using the button options - Hold, double tap, press or release but all result in a short press and the blinds tilt one way or the other.
Thanks for your nice words, and welcome to Hubitat.
Yes, for a single button press that is the easiest way.
For RF codes, the only option is actually to send a command like sendSavedCode multiple times. To do that, you might want to create a different virtual button and put that button on your dashboard. Then you can write a Rule Machine rule (or whatever you use for automation) that is triggered by pressing the virtual button and for which the action is sending the sendSavedCode command to the Broadlink virtual device multiple times.
This is tricky. What is the difference between pushing multiple times and holding it, as far as you can tell?
Maybe emulating holding the physical button is just the same as sending sendSavedCode a few times in quick succession?
I would check to see if holding the button on the original remote actually sends a different code than a quick press.
Just learn the code while holding the button and see if doing a testLearnedCode with the result does the same thing as holding the button on the original remote.
That is very kind. If you feel so inclined, please find a way to pay it forward with someone in your local community!
I can't quite tell if one of the things you need to do involves pressing the same button on the remote multiple times, but if so, then look through tom's BL app documentation here for info on the "sequence" option -- it makes multiple same-button presses easy.
I'm using it in a couple of my rules and it works great.
It is a generic aquarium light with many IR buttons. I only need about 4 to 6 of them so I can use hubitat to control the light. I want to know if the RM4 can learn that many codes. The user manual show learning for a generic curtain which only allows one button, on/off. I want to know if there are multiple devices it can learn, and how many so I could use each button as it's own device. So for example, the remote has Daylight, Sunrise, moonlight and off. I want to set up hubitat to turn on the light as sunrise at 10am for 1 hour then at 11 full brightness until 10pm then 1 hour of sunset then moonlight for 5 hrs then off. Repeat. So the buttons need pushed are 4. There are other things like storm that I could have hubitat do if it's stormy outside but not necessary. I just don't want to buy the RM4 and find I can only turn it on or off.
You can learn as many codes as you want using my integration.
There are detailed steps in the readme (linked in the first post of this thread), but essentially this works directly between Hubitat and the Broadlink device and does not rely on the Broadlink app itself.
So, you can tell the device to start learning for IR (learnIR command) and then hit it with an IR code from your remote. You'll get an indication on the device page if a code was learned successfully, and then you can play back that code to make sure it works (testLearnedCode).
If that works, you can give it a name and saveLearnedCode. And then you can play back the code on demand using sendSavedCode in automations or push from a dashboard.
And you can repeat that process as many times as you want to get coverage for all of your buttons.
I guess a shorter summary is that the way I supported this for use with Hubitat is very generic. It's just about saving and replaying codes by name, so you have a lot of flexibility on how you use it.
yes, I tihnk you';re right I would love to try out the sequence option.
but at the moment it goes way over my head.
use apush command and repeat with delays etc.. all sound good.
what have I created on the dashobard - is the "button availablel outside the dashboard?
how do I push codes? I have no idea where I use them in hubitat.
I will keep rereading and see if it goes in:-)