Just thought I might try to give back a little here for those who may be curious about, or interested in, using mysensors. There is a lot of detail at mysensors.org, but I suspect some might find it a little overwhelming. If people are interested, I could upload some sample code for the sensors I use. Perhaps others could also say how they are using their mysensor kit with Vera and show their code…
Anyhow, for my environment I use the mysensors kit to provide low cost:
[ul][li]temperature monitoring for my fridge & freezers (making sure they aren’t running too warm which will allow food to spoil, or too cold which is a waste of energy)[/li]
[li]temp & humidity monitoring for the cellar[/li]
[li]door open/close sensors[/li][/ul]
DataMine2 also records info over time that I can view easily via the ImperiHome app. I’ve also recently started to create mysensor buttons to activate scenes - providing similar functionality as the Fibaro 'button", only for a fraction of the cost. I even have a sensor using a small passive buzzer and limit switch that plays a tinny version of the star wars imperial march if the freezer door is left open for over a minute (it’s loud, really annoying, and very effective in getting my kids to close the door properly).
Future projects for me include:
[ul][li]letter box notification that mail has been delivered[/li]
[li]RF bridge to control my projector screen (as well as sensors, you can create ‘actuators’ that can be controlled via Vera)[/li]
[li]BBQ gas bottle weight sensor (to let me know when it’s getting low)[/li]
[li]water tank level[/li][/ul]
The gateway cost under $10 to make, and each sensor is normally powered by AA batteries and cost under $5 to make.
So, how to do this. Basically, you create a physical mysensor gateway. Then you add that into Vera as a device. Then you create your physical sensor modules and ‘include’ each into the mysensor network, at which point they will appear as devices in Vera. The physical gateway can talk to Vera via IP (my recommendation) or serial. The sensors can be attached directly to the gateway, or can communicate with the gateway via either IP or (my preference) a dedicated 2.4GHz RF network.
In more detail:
- Create a mysensors gateway. You can use an Arduino for this, but (my recommendation) I used an esp8266 (specifically a WeMos D1) as it is about the same price as an arduino but has built in wifi, more onboard memory, and a faster processor. So when including the cost of a wifi module, it’s actually cheaper than an arduino as well as faster etc. Code is here: https://www.mysensors.org/build/esp8266_gateway#esp8266gateway-example. After physically assembling the gateway, you download the code to the device using a USB cable and the Arduino IDE (https://www.arduino.cc/en/Main/Software). As noted before, you can modify the code and attach sensors directly to this gateway, or (my preference as you don’t muck around with the gateway - and possibly break it - when adding in new sensors) have this as a dedicated gateway with multiple discreet sensors. Sensors can use wifi to communicate, but I like using RF as it allows for very small and cheap sensors that can run off batteries.
- Install the mysensors vera plugin - https://www.mysensors.org/controller/vera - and configure it to use your gateway
- Create a sensor, then add it in to Vera through the inclusion process (see also https://www.mysensors.org/controller/vera)
Pricing is a rough guideline ? I get my kit via aliexpress. Takes a while to arrive, but generally I find the quality to be good if you pick suppliers with solid feedback.
Gateway hardware - $10:
- WeMos D1R2 - $6.50
- NRF24L01+ Radio - $1 (generally bought in lots of 10 - range for these are good. If you find you have issues (I haven’t so far) you can get modules with better antennas)
- Ribbon cable to join things - $1 (can use dupont cables to minimise soldering)
- Micro USB cable & charger for power (free - most people have many of these unused at home)
- Case $1.50
Sensor hardware - $5:
- 3.3V Arduino pro mini - $2 (can also use an Arduino nano or a 5V pro mini, although they are less suitable for being powered by batteries). Cheaper when bought in bulk.
- Radio - $1
- Plastic project box - $1
- Double AA battery case - $0.50 and two AA batteries, or a hacked usb cable and charger. Yes I know that two AA batteries does not provide 3.3V, but it’s near enough and has not caused any issues for me.
- Sensor (eg door magnetic reed, momentary button, temperature probe, etc - $1.00)
You will also need (if using arduino pro mini for sensors) one FT232RL FTDI USB 3.3V 5.5V to TTL Serial Adapter, plus a soldering iron and some solder (I use 0.7mm 60% tin/40% lead - don’t be scared of learning how to solder - just apply the tip of the soldering iron to the joint between the pin and the board, then apply the solder wire to the tip of the iron. With some practise, the solder will melt and properly form a little inverse cone ). The FT232RL is simply used to temporarily provide a usb port for the pro mini to allow you to program it. If powering via batteries, I recommend using needle nose pliers to crush the little led on the Arduino pro mini to reduce power usage (unfortunately there is no software way to disable the light). I find my fridge/freezer sensors easily last 6 months ? and they are set to send info every 45 seconds or so ? and other sensors (that only send info as required, eg door sensors) last much longer again.