Another beginner project



  • Hi, I am currently reading a lot about home automation and want to start a project. I have an arduino uno for a few years now and started my new project by getting some 433 MHz wall outlets from the local diy store. I already managed to get the binary code from the remote and send it from my arduino via 433 MHz, so evey 10 seconds the lamp connected to the outlet switches on/off. Great :d

    Now I also own a raspberry pi 2 and so I am planning now to set up a home automation system:

    The RasPi will serve as the controller with OpenHab and the arduino uno will be the ethernet gateway and communicates via 2.4 GHz with a few sensors.
    Additionally I want to keep the 433 MHz wall outlets. So the gateway will also have the 433 MHz sender wired.

    But my quastion is: will this configuration work? I begin to understand the theory, but I can't imagine how all these things are set up and communicate with each other.
    For example I want to have a sensor in the corridor. The sensor consists of a PIR sensor and a light sensor. Data will be transmitted via 2.4 GHz to the gateway. Now I want to switch on the light (433 MHz light switch) when the sensor detects movement and the light in the corridor is below a specific value.

    I am currently waiting for a few parts, especially the 2.4 GHz modules and the ethernet shield, but I think I have to set all this up, maybe things get clearer then..


  • Hardware Contributor

    Hi!

    You need two gateways, one for each channel (2.4ghz/433mhz). They report to the controller (openhab). The controller will watch the 2.4ghz motion detector and when its detected normally a script activates and sends the on command through the 433 gateway.

    I use this with Domoticz as controller and it works great. Motion is detected in MySensors network and a lua script fires and turns my 433mhz outlet on.

    I dont know exatcly which support openhab has, but someone else might be able to answer that.



  • Is the gateway always one way? So it will receive the data from sensors and transmits it to the controller? What if I want to expand the system with a light switch? The light switch works also with 433 MHz, but it should not directly control the light. Instead it should send the signal to the controller, which then sends the signal to the receiver. Do I need a gateway per frequency band or a controller per task (receiving gateway / transmit gateway)?


  • Hardware Contributor

    No the gateway is always two ways. It communicates with the controller and sends/recieve from/to the nodes. Yes, it will recieve data from sensors and transmit it to controller.

    Works the same way, 433mhz switch sends to gateway, and then to controller. Scripts fire and controller sends back the same way.



  • I've gone same route as you are starting. After all I'm at Domoticz + MS gateway + RFlink. Works beautifully.



  • So it should work like this (german, but I hope you can understand)

    unbenannt.png



  • Exactly, different GWs, different Frequency and protocols.



  • Thanks 🙂
    can't wait until the parts arrive..



  • @Astrofotograf said:

    can't wait until the parts arrive..

    Hi! Which "Funklichtschalter (Sender)" are you going to use?



  • @HenryWhite said:

    Hi! Which "Funklichtschalter (Sender)" are you going to use?

    I ordered this one: "Smartwares SmartHome Funk-Einzelwandschalter 1-Kanal, SH5-TSW-A"

    together with this one: "Smartwares SmartHome Funk-Einbauschalter 1000 W, SH5-RBS-10A"

    and this one: "Smartwares SmartHome Funk-Fernbedienung 4-Kanal, SH5-TDR-F"

    But didn't try them yet, so no further experiences with them yet



  • @Astrofotograf nice, didn't knew they were that cheap nowadays. How are you going to get the (binary) code from these 433mhz switches? Do you have any useful links/tutorials for that? 😄



  • With an arduino + 433 MHz receiver. The library is rc switch. There is a receive example sketch coming with it


  • Hardware Contributor

    Are you sure this library are supported by openhab? Might be worth checking out first.
    A quick google shows atleast there are RFXCom bindings (protocoll for gateway to talk to controller) for openhab



  • When I used OpenHAB as a controller , I used the pilight plugin.
    If you setup a pilight-instance, you can connect it to OpenHAB and let that read out states and send commands.
    I didn't look dor a way to directly control an arduino from OpenHAB, seeing as pilight worked fine.

    EDIT: just to clarify: pilight has an arduino sketch you can upload to a nano (which is what I used) to act as a gateway.
    You won't need the expensive RFXCom.



  • So you add the 433 MHz modules directly to the rapberry GPIO pins and use the arduino just for the sensors?



  • @Astrofotograf said:

    So you add the 433 MHz modules directly to the rapberry GPIO pins and use the arduino just for the sensors?

    Besides pilight there's also rcswitch-pi, basically rcswitch for the raspberry pi.



  • But in general, I could save the second gateway with that?
    I'm not sure if I understand all of that correctly. Just spent a few hours to get the demo of openHAB running and still get some errors (persistence service not available) where I don't know whether it is normal to get these errors..



  • @Astrofotograf
    Pilight can use 433MHz senders and receivers connected to the GPIO-pins of the Raspberry Pi.
    Problem with that is that the pi will need to filter all of the frequency noise which leads to higher cpu-usage and slower processing of other tasks (OpenHAB is quite resource-heavy in my opinion - on a RPi B+).
    That's why they also have pilight-usb-nano which is a sketch/hex-file to upload to an arduino nano. This way the nano will filter out the noise and only feed recognizable commands to pilight, which in its way sends the commands to OpenHAB.
    In that regard it acts as a gateway for your controller.



  • Okay, thanks. Seems I just have to experiment a bit with it.



  • Hm, I installed OpenHAB now on my RasPi, also Mosquitto. I think I begin to understand this. So MQTT is just some kind of "forum", and when in the thread "livingroom/temperature" something changes, OpenHAB recognizes it. The sensor sends just its data to the gateway and the gateway writes the MQTT thread?
    Will the other way round work too, so OpenHAB writes data into a specific thread, the gateway recognizes it and sends a command so, say a servo node to move something?

    If that all is correct, I sould be able to connect the 433 MHz things just like a normal sensor node. The receiver acts as a normal sensor and the sender could use the servo sketch to send some commands via 433 MHz band?


Log in to reply
 

Suggested Topics

  • 8
  • 90
  • 1
  • 7
  • 5
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts