
Many shutter controllers come with RF remotes but without WiFi connectivity, so they cannot be easily paired with Home Assistant. Luckily, it's always possible to simply inject remote button presses and intercept LED states with a simple WiFi module addon modification. Here I will show how to do it step by step in OpenBeken.
Project was done by @DeDaMrAz, I'm just doing support and documentation.
So, there are 5 shutters in total. They have one common remote.
Remote has 5 buttons:
- right/left (to select shutter)
- top/down (to open/close)
- middle (stop)
Futhermore, the RF remote has also a simple LED feedback (five LEDs) which tells us which shutter we're currently controlling.
The LEDs are either indicating room index (one of LEDs is lit), or a special "all rooms" mode (all LEDs are lit then).
That's a total of 10 GPIOs - 5 outputs (to control buttons), and 5 inputs (to read LEDs).
Let's open the remote and look inside:


We can also overlay both images on single picture for more clarity:

The next step is to figure out how to read LEDs and control buttons. We need to find points where we can solder wires:

We didn't want to break the remote, or make it unusable without WiFi addon, so we decided to route out the signals to the male pin header:

It's time for some soldering. First, the wires were soldered to the pins:

Then, they were carefuly shorted and soldered to the appropriate pads:



Next step is the WiFi part. We can use any OBK device, but he had some NodeMCU mods at hand. @DeDaMrAz decided to use PC817's for buttons, however, in my opinion, that was not necessary - it depends on how the buttons are connected.

So, here is the WiFi board:


The board can be seamlessly connected to the remote and the remote is still intact:

Just please note that I'd recommend taking out the battery before connecting external supply.
Now the hardware part is ready. It's easy to write a script for OpenBeken. No C coding required!
GPIO config:
Code: C / C++
So, we start by enabling custom buttons:
startDriver httpButtons
Then we add change handlers to make 'button' channels go back to 0 after a short moment:
addChangeHandler Channel1 == 1 addRepeatingEvent 0.2 1 setChannel 1 0
addChangeHandler Channel2 == 1 addRepeatingEvent 0.2 1 setChannel 2 0
addChangeHandler Channel3 == 1 addRepeatingEvent 0.2 1 setChannel 3 0
addChangeHandler Channel4 == 1 addRepeatingEvent 0.2 1 setChannel 4 0
addChangeHandler Channel5 == 1 addRepeatingEvent 0.2 1 setChannel 5 0
The above code assumes that channels 1-5 have Rel roles (output pins).
Then we handle reading from dInput pin channels to read LED states:
//test for reading LED's from remote
addChangeHandler Channel6 == 1 setButtonColor 6 BLUE
addChangeHandler Channel6 == 0 setButtonColor 6 GREEN
addChangeHandler Channel7 == 1 setButtonColor 7 BLUE
addChangeHandler Channel7 == 0 setButtonColor 7 GREEN
addChangeHandler Channel8 == 1 setButtonColor 8 BLUE
addChangeHandler Channel8 == 0 setButtonColor 8 GREEN
They are just setting colors of buttons so we know which room we control.
Finally, the buttons:
//buttons
setButtonLabel 1 "STOP"
setChannelLabel 1 STOP
setButtonColor 1 RED
setButtonEnabled 1 1
setButtonCommand 1 "setChannel 1 1"
setButtonLabel 2 "UP"
setChannelLabel 2 UP
setButtonEnabled 2 1
setButtonColor 2 ORANGE
setButtonCommand 2 "setChannel 2 1"
setButtonLabel 3 "DOWN"
setChannelLabel 3 DOWN
setButtonColor 3 ORANGE
setButtonEnabled 3 1
setButtonCommand 3 "setChannel 3 1"
setButtonLabel 4 "LEFT"
setChannelLabel 4 LEFT
setButtonColor 4 GREEN
setButtonEnabled 4 1
setButtonCommand 4 "setChannel 4 1"
setButtonLabel 5 "RIGHT"
setChannelLabel 5 RIGHT
setButtonColor 5 GREEN
setButtonEnabled 5 1
setButtonCommand 5 "setChannel 5 1"
In the code above, the 5 buttons mimic the buttons of the remote.
We also have extra buttons, which are used to signal which room is active:
setButtonLabel 6 "OFFICE"
setChannelLabel 6 OFFICE
setButtonColor 6 GREEN
setButtonEnabled 6 1
//setButtonCommand 6 ""
setButtonLabel 7 "ROOM 1"
setChannelLabel 7 ROOM 1
setButtonColor 7 GREEN
setButtonEnabled 7 1
setButtonLabel 8 "ROOM 2"
setChannelLabel 8 ROOM 2
setButtonColor 8 GREEN
setButtonEnabled 8 1
// NOTE: we didn't actually add here room 3, but it could be easily implemented if needed
They don't have click events set, they just change colour when given room is active.
Finally, we add extra button to remember last chosen room:
setButtonLabel 9 "LAST SELECTION"
setButtonColor 9 green
setButtonEnabled 9 1
Once a given LED lits up, we change the label:
addChangeHandler Channel4 == 1 if $CH9==0 then NONE
addChangeHandler Channel5 == 1 if $CH9==0 then NONE
// last selection
addChangeHandler Channel6 == 1 setButtonLabel 9 "OFFICE"
addChangeHandler Channel7 == 1 setButtonLabel 9 "ROOM 1"
addChangeHandler Channel8 == 1 setButtonLabel 9 "ROOM 2"
addChangeHandler Channel9 != 0 setButtonLabel 9 "ALL"
We also have the feature to track checking whether remote is connected to OBK:
setButtonLabel 10 "NOT DETECTED"
setChannelLabel 10 DETECTION
setButtonColor 10 RED
setButtonEnabled 10 1
addChangeHandler Channel10 == 1 setButtonColor 10 GREEN
addChangeHandler Channel10 == 0 setButtonColor 10 RED
addChangeHandler Channel10 == 1 setButtonLabel 10 "DETECTED"
addChangeHandler Channel10 == 0 setButtonLabel 10 "NOT DETECTED"
We also need to handle an extra state, where all LEDs are lit, this indicates that all shutters will be controlled now:
again:
if $CH6==1&&$CH7==1&&$CH8==1 then "setChannel 9 1" else "setChannel 9 0"
delay_s 1
goto again
And here is OBK panel (some buttons are not in English but it's just a demonstration):

It's important to keep in mind that first buttons are indeed clickable and they send events, while the futher buttons just mimic the state of LEDs.
We're also working on HA integration, but it's not fully read. Here's how automatic HASS Discovery sees this device:

The following already gives us ability to control shutters from there, but there is much more to be improved soon.
Futher improvements may include:
- generic logic changes, better state tracking (if we detect any futher edge cases...)
- better OBK page, maybe via rest interface:
https://www.elektroda.com/rtvforum/topic3971355.html
- better HA interface (probably via custom yaml)
Of course, it should be also possible to control RF directly (with some RF receiver/sender modules), but that was not the scope of this topic.
To, to sum up - this approach allows you to "hijack" any device remote and convert it to WiFi. It's not just limited to shutters, the same can be done for heating, cooling, air conditioning, PV monitoring, etc and so on systems.
The project shown here is already functional but soon we may improve it even more and post extended version - stay tuned!
Cool? Ranking DIY Helpful post? Buy me a coffee.