My project is in running phase, I posted detailed description of functions, code and pictures on Openhardware site here: https://www.openhardware.io/view/55.
Best posts made by Mihai
MySensors and Home Assistant - using MQTT
I have successfully built and tested MySensors 1.5 and 2.0.0 beta with Home Assistant using MQTT with slightly modified sketches , few more words here: http://forum.mysensors.org/topic/2747/home-automation-multi-sensor-nodes.
The node ID was declared manually for each node.
The topics description was not very clear from the beginning, but finally I got them and now several examples of many sensors types are included in the configuration.yaml file.
I did not succeed to make them to work together using the Serial Gateway, but MQTT is just fine (may be better from some points of view).
RE: Multiple sensor node freeze
@parachutesj Inserting just Delay() into the code doesn't help always, while it may insert some other troubles, but trying to send messages with some other line code between next sending help a little bit.
My error messages was revealed after a lot of testing and stress of the nodes.
I am waiting for the MySensors library improving, I saw a lot of work there, so I will keep the actual config, minimize the testing nights for now. Of course I am hard resetting nodes from time to time, when they fail to respond. The gateway seems to works fine.
RE: Multiple sensor node freeze
It's strange, but activate the debug option the freezing just go off, but the debug should be off during the "commercial" usage. I have checked most of advice's and more than that I already add capacitors to the NFR24 (100uF + 100nF) and also to relay shield (100uF) and Arduino Nano (100uF +220nF) even if they are not explicitly requested, but I was thinking they may help.
My problem may be related to the power supply and also to the Arduino Nano, may be also the message re-arrangement helps also.
After some testing time I plan to publish my project (most of code is always published on GitHub and links available on MySensors and HomeAssistant).
Thank you for advice's, any help is always very welcome!
RE: Connect sensors directly to the Gateway (again)
I did it: https://github.com/Mihai258/MySensors2-HomeAssistant-MQTT
Tested and working fine, examples included.
RE: Extending the Relay capabilities - Request
I have a "manually" sketch for relay, you may add any number of relays, choose the PINs you want on Arduino. Of course you are limited by the type of the board you are using. You just have to copy/paste the same code and change the relay number 1, 2, 3, 4 etc: https://github.com/Mihai258/HomeAssistant-MySensors-MQTT/blob/master/Single sensor/MySensorMQTT_REL/MySensorMQTT_REL.ino
Of course you have also to take care about already used PINs (some of them are used for the NRF24 module, some for LEDs if case etc).
RE: Gateway and Mega 2560
I have tested Arduino UNO + Ethernet shield for theMQTT Gateway and they work just fine together. But if you are considering for the future to install several sensors on the Gateway (will be possible in the next release, now available on the development branch) you may run out of memory and must go for Mega.
I succeed to use UNO with few sensors, and they fit, but if you need more sensors or temperature with DS18B20 they don't fit.
If you do not plan to add any sensor on the Gateway, the number of nodes will not affect the Gateway, so no need for Mega in this case.
RE: Home Automation - multi-sensor nodes
I have updated my project to use MySensors 2.0.0 beta from development branch with the following main changes:
- MQTT broker is external, you may use mosquitto for example;
- the Gateway allow sensors; examples included with several sensors on the gateway
- Arduino Mega may be used for the Gateway and/or nodes; in the Gateway sketch I have mention the connections for NRF24
- multi-sensor nodes examples.
I have tested all of them and they are worked.
The project is presented here: https://github.com/Mihai258/MySensors2-HomeAssistant-MQTT
@maxtox: my expertise level in IoT is not so high for your project, I am still learning in this area.
RE: Combining MySensors examples
I have also developed multi-sensor nodes based on MySensors 1.5, they works fine on the table, few more details here: http://forum.mysensors.org/topic/2747/home-automation-multi-sensor-nodes
The 1.6 version will follow soon, I hope.
Home Automation - multi-sensor nodes
My Home Automation project use My Sensors 1.5 and Home-Assistant, communicating via MQTT.
I plan to install in each room several sensors (Gas/Smoke, PIR, Water leak, Temperature, Humidity) and Relays (2 to 4, local control also using IR remote).
While the project is still beta, I would like to share with you what I have achieved until now, mainly the code for gateway and nodes. The code is here: https://github.com/Mihai258/HomeAssistant-MySensors-MQTT , it contains the standard gateway from MySensor site and modified nodes to use one or several sensors, a lot of combinations are presented. A configuration file for Home-Assistant is also presented, it helps to understand how to manage the messages from MySensors.
The gateway contains Arduino UNO + Ethernet shield + NRF24, the nodes contains Arduino Nano + NRF24 + sensors.
I have tested my nodes and they works fine on the table. I will come back with more information and details, but it will take some time to get all components and to build the whole system. I also plan to move to MySensors 1.6 (my tests are on-going here).
RE: MySensors 1.6 availability?
Thanks, I already succeed to test the MQTT Gateway 1.6 and it seems to work (subscribe ok to mosquitto, send and receive some commands), but still looking for the Serial API related to 1.6 for better understanding how to program HomeAssistant to work together.