lprhodes / homebridge-broadlink-rm

Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
570 stars 285 forks source link

Track real-world device status with an RF Receiver #290

Open tamasvicsotka opened 6 years ago

tamasvicsotka commented 6 years ago

Hi, thank you for your great job in this project!

I have a feature idea for the window covering part. I have a little problem with the architecture, because if I want to use the original RF remote controller, the % status of the blind doesn't updated. It will be possible to listen to the RF signal of the original remote control and update the blind status.

The best will be, if the broadlink device can listen to the RF signal.

If it's not possible there is a cheap RF receiver for Rasperry Pi and a homebridge plugin. With this solution I can listen to the original remote rf signals and I can make rule in the home app that triggers the right (open, close, stop) switch, which is coupled to the blind accessory in your plugin. (For this I need switches (up, down, stop) which is coupled to the original blind accessory.)

Better solution if you can integrate the whole RF listening part in the plugin and we just have connect the RF receiver to the Raspberry Pi and we don't have to create a rule in the home app.

If it works than it can extended to the other accessories.

I hope that it's possible and you can make it! It will be a real smart home solution!

lprhodes commented 6 years ago

Unfortunately homebridge plugins can't talk to one another.

lprhodes commented 6 years ago

As you say though I could incorporate it. The trouble is with recognising codes then knowing what to do with them.

tamasvicsotka commented 6 years ago

I think it's possible to create 3 rules(up, down, stop) for it within the home app. In this way the two plugin can communicate to each other.

For example the blind is closed, I press the up button on the original rf remote than the rf buttons plugin recognize that I pushed the up button and turn on a switch in the home app, than the up rule triggers a switch, which you create and It's start calculating the blind position. If I press stop than it stops the blind in the same way, and I have a correct calculated position in the app. If don't press nothing during the opening time, than it opens physically and also in the app. So I always have a correct position status, and it doesn't matter if I use the home app, or the rf remote.

lprhodes commented 6 years ago

That's a pretty messy work-around.

How about this, the receiver code is built into this plugin. Each accessory can then have new options:

"type": "window-covering",
"rfMonitor": {
  "open": "RF_CODE_TO_MATCH_AGAINST",
  "close": "RF_CODE_TO_MATCH_AGAINST",
  "stop": "RF_CODE_TO_MATCH_AGAINST",
}

When the receiver detects an RF code it shall iterate through each accessories' "rfMonitor" list and determine whether an action should occur. If it should then the accessory disables any sending of RF from it for X seconds so that it doesn't get in the way of what the RF remote is doing.

To combat the receiver code detecting the RM Pro RF codes as manual ones it would need to prevent the code being sent from being detected for X seconds.

The same functionality could technically be used with IR.

One problem is that this really only works for simple configs i.e. a single open hex and a single close hex.

Another is that I don't have the necessary hardware at the moment. I have a RaspberiPi Zero W and that's it. No RF remotes or accessories and none of the stuff needed to connect an RF Transceiver to the Rpi

tamasvicsotka commented 6 years ago

Sounds good. If this method sets and calculates the blind position, I think it's a good solution. I wrote that messy method before because it needs the less effort and work. 😄

lprhodes commented 6 years ago

It'd be helpful if someone can find a device that plugs into the wall and monitors RF. It would then need an API to retrieve RF codes from it.

It's obviously achievable via the rPi method mentioned but that's much less accessible to people.

lprhodes commented 6 years ago

This may do it.

https://www.iot-store.com.au/products/sonoff-rf-bridge-433-mhz-to-wifi

It's a shame the RM Pro doesn't have an always-on receiver

felipesalomao commented 6 years ago

Its exactly what i suggested on another topic.. monitore real world commands (using remote).. and sync acessories status.. Its really bad not have aways on received.. but and if you send command to listen hex each 5 seconds (i dont know exactly what is listen duration in seconds..).. then if command detected, it register what was command, see if have some acessorie with same hex, update status, then active listen mode agian and again, each few seconds?!

lprhodes commented 6 years ago

The Broadlink RM Pro doesn't seem to reliably work as a receiver so something else would need to be used.

lprhodes commented 6 years ago

That device would definitely allow for this so if anyone's interested and would like to contribute one (or the money to buy one) then I'd be happy to work on integrating support for this.

felipesalomao commented 6 years ago

create donation button on paypal.. I am sure that all would contribute for this.. beyond that to be more precise.. Your work is pricesless, would require devices much more expensive.. just put on index page (top position) (github) donation button.. once archieved value.. just buy..

lprhodes commented 6 years ago

Yeah I just placed requests for contributions on Github and in the code itself. We'll see what happens.

felipesalomao commented 6 years ago

Great! put here: https://github.com/lprhodes/homebridge-broadlink-rm on top.. Contribute to project and new features.. then link or button to paypal..

felipesalomao commented 6 years ago

First drink bought :) try give bigger highlight.. bigger and bold text..

lprhodes commented 6 years ago

Thanks @felipesalomao :)

zladukas commented 6 years ago

Cheers! ;-)

lprhodes commented 6 years ago

Hey - just a quick update. That sonoff bridge I mentioned above doesn't appear to have an always-on receiver either :( It seems like any solution will need to involved a great tutorial for adding RF to the raspberry pi.