Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Anyone have any previous experience of rpi-rf on Home Assistant (Hass.io)?

  • 11-10-2017 7:09pm
    #1
    Registered Users, Registered Users 2 Posts: 2,359 ✭✭✭


    Anyone have any previous experience of rpi-rf on Home Assistant (Hass.io)?

    I am only dipping my foot properly into home automation, but looking to find anyone with previous experience with hass.io running on rpi and using 433MHz Superheterodyne for the transmitter and receiver connected via the GPIO pins to trigger the cheap 433MHz plug in sockets around the house.

    Anyone on here doing anything the same?


Comments

  • Registered Users, Registered Users 2 Posts: 7,278 ✭✭✭kenmc


    Not sure how far this will go to answering your question but anyway.....

    For quite a while I've used Energenie RF plugs for stuff like floor lamp in the sitting room, turning off the TV/Printer/DVD etc with one button; but I've never really spent much time getting it hooked up to something like hass.io or nodered  or whatever.

    The only thing I've done in terms of automating those plugs is using Arduino (actually ATTiny, battery powered) to read the temperature in what was my daughters bedroom and if it dropped below 16C to turn on an oil rad, and turn it back off when it reached 18. Her room would get very very cold during the winter, NE room of the house, must be f all insulation (renting) and when she was a baby/toddler needed to be sure the room was not too cold.

    In terms of automating the RF signals though, it's reasonably straightforward, there are programs like rpi-rf and similar Arduino libraries that can be used to firstly sniff the codes that your RF remotes send these switches, and then to subsequently send these codes to control the switches.

    During testing I've found some issues around range and reliability. Sockets I picked up in lidl appear to be more fussy or susceptible to timing errors in the codes somehow, and sometimes the signal doesn't make it through to the socket, whereas the energenie socket sitting beside the lidl one gets controlled fine.

    And that leads us to the main problem with the RF sockets - how to determine the state of the socket from your controller. It's essentially fire-and-forget, you could perhaps send the  command 3 or 4 times in a row and hope that the switch reacts (which is what I did in the bedroom controller - every time the temp is below 16, send 'ON', regardless of if I've already done so, likewise send OFF every time it detects temp above 18 - the assumption is that eventually the command will be received and the rad will enter the desired state), but that will only work for something which is not also likely to be controlled by a human - e.g. if you've a rule saying 'at midnight turn off all lights in the sittin room' but on some night you come back late and turn on the lights to watch tv or whatever, you don't want your home automation trying to force them off every minute or so, to be sure that the lights have actually turned off. Of course you could also have the raspi listening for signals from the remote control so it could detect that you've turned on a certain socket, but once again it's not reliable. And then if you actually press the button on the socket itself to physically turn it on, there's no signal at all sent....

    I've recently started looking at this stuff a bit more closely, and have a raspberry pi zero running OpenHAB, and I have this operating a Sonoff wifi power switch (which I've had for ages) in the hall over MQTT. The beauty of these sort of things is that they regularly call 'home' to the openhab and tell it the state of its' output, so even if I manually control it, openHAB will then reflect the status of the output in its' gui, even if you manually control the socket yourself, it sends its' new status to OpenHAB.

    I've also got a node-mcu flashed up with ESPEasy which can do the same thing, although I've not yet configured it to do anything useful, but in theory I could connect it to a PIR sensor or a relay or something and have it also start sending messages to the OPenHAB. In fact I have my weather network sending the temperatures of the outside, office and bedroom temps to my openhab also, again using MQTT. I'm planning on expanding this significantly over the next year or so, as I'm in the middle of a new build where I'll hopefully be able to make things a lot more permanently smart.

    Longer post than I expected to do, hope some of it is useful!


  • Registered Users, Registered Users 2 Posts: 7,278 ✭✭✭kenmc


    Meant to say, that there are several very-cheap wifi-enabled microcontrollers around, e.g. ESP8266, NodeMCU etc, and I think that these are really the way I'll be going, although I am still also trying to reliably detect the RF signal from my Owl Energy monitor and send that to my openhab setup.

    As it stands I have a freezer door sensor again using an attiny; when the door of the freezer opens, it releases a miroswitch which turns on the tiny. The only thing this does is sleep for 1 minute and then start beeping a piezo speaker. So if the door is left open for more than 1 minute, it will start beeping, else if you open it, take out something and close the door, then it will shut down again and not make any noise. I'm thinking of using my nodemcu board to do similar, but on wakeup, connect to my wifi, and then let me know the door is open if it's still open after a period of time.

    Oh and OpenHAB is not trivial to setup, the documentation is sparse; I've a very good understanding of programming, electronics etc and still am getting to grips with this beast. Seems to be very powerful though, and it has a cloud-enabled gateway where I can go to myopenhab.org and it reflects the locally running instance in my house, and I can control my hall light from outside the house, which is great.

    IN terms of actually controlling the switches, I found this
    https://www.letscontrolit.com/
    they have a thing called 'RFLINK' which is an arduino and a 433 tx/rx, but i've not yet tried it


  • Registered Users, Registered Users 2 Posts: 7,278 ✭✭✭kenmc


    I spent a bit time last night playing with this:

    https://github.com/1technophile/OpenMQTTGateway

    on a node-mcu. I was able to get it communicating with my energenie power plugs over mqtt/rf, so that I could:
    - control the sockets using the openhab interface
    - control the sockets using the RF remote control, and have openhab reflect the new status

    however :
    - it would be possible to get into a 'confused' state if you were to toggle the sockets using the physical button on the socket itself, as there is no message sent out that can be captured.
    - there's always the risk that an rf signal will be missed, leaving the openhab state out of sync with the physical sockets.
    - I have still not yet managed to get my lidl plugs working from openhab - they use a different protocol (2) than the energenie ones (1) and I had not quite worked out how to impart the protocol to be used in the mqtt message. I found that this morning though and hopefully will get it working tonight.


Advertisement