@foad62
Sorry for late reply... If you use MQTT Gateway you need an MQTT broker. I was using mosquitto as a broker. At HA site they mention it at MQTT component page: https://home-assistant.io/components/mqtt/ but now they also have one internal broker available, so they are many available possibilities.
Posts made by Mihai
-
RE: Home Automation - multi-sensor nodes
-
RE: MQTT Gateway retained flag
I did not work too much with github and still find it somehow a little bit annoying for me, but I was trying to do this.
I also have updated the new inserted constant as you advice.The new definition should be moved to the MyConfig.h , but now it was easier to modify only one file.
My tests were done on MQTT Gateway made by Arduino Uno (clone) + Ethernet shield 5100 and it works very nice.
-
MQTT Gateway retained flag
I succeed to add the retained flag for the MQTT Gateway.
To access this flag, I have inserted few modification into the file MyGatewayTransportMQTTClient.cpp
The whole code and instructions for use are here: https://github.com/Mihai258/MySensors_MQTT_retained/tree/master -
RE: 💬 Building a Raspberry Pi Gateway
@eyesoft
As far as I understand, MySensors relay on PubSubClient for MQTT and it does not allow to publish messages with QOS=1 or 2, only 0.
Retain is different that QOS, it offers the possibility to recover the state for a device that loose connection for a while (e.g. after a restart). I find it very usefull. For example I have to restart the controller. When come back I got all states to their real values if retain=true. Otherwise they goes to the default, usually 0.
I have now 6 nodes, each with several sensors and relays. -
RE: 💬 Building a Raspberry Pi Gateway
@eyesoft
Thank you for the answer, I am happy to get a confirmation about sensors works on a Pi Gateway. Since at least one of my sensor is analogue, I still have to add an Arduino board to the gateway, I plan to connect it via USB.
I have tested and get very good results with Home Assistant controller running on a Pi where I add sensors directly on Pi and to an Arduino (USB to Pi).
The Ethernet Gateway do not use IRQ: https://www.mysensors.org/build/ethernet_gateway
Nor the nodes: https://www.mysensors.org/build/connect_radio Even if the wire is connected at Arduino pin 2, is mentioned: Note: The IRQ is currently not used by the MySensors library so it can be left un-connected
If you know how to connect and manage this IRQ on Arduino sketch, please let me know.
I have built this some time ago and works without the IRQ connected. Now I have updated the MySensors to 2.1.0 , IRQ is still unconnected and works the same. As far as I see, it is used for the Pi Gateway. I plan to migrate to this configuration of Pi Gateway, but I would like to get more info before change my working system:- this IRQ improve the reliability? (sometimes I have encountered problems due the load of NRF24 network with many messages)
- I would like to set retain=true for the MQTT Gateway, this will improve the reliability.
I already addressed the last question somwhere else, still waiting for more info if somebody know.
Thank you
-
RE: What kind of capacitor is need for the NRF24L01+
I used two capacitors in parallel with big capacities, just to be sure here is no problem with power: electrolytic of 100uF + ceramic 470nF, presented here: https://www.openhardware.io/view/55 in the third picture.
For a smaller module, I think you can add a ceramic of 100nF to filter higher frequencies and a tantal or even electrolytic of 10uF, if you choose lowest voltage for them they should be smaller. -
RE: Multiple Gateways for redundancy
@dbemowsk
If it is used as an alarm system, not only for intruders, but for smoke detection, water leak etc you must count on its reliability close to 100%.
Also as mfalkvidd mention, you may not want to stay outside automated closed door... -
RE: 💬 Building a Raspberry Pi Gateway
The Pi MQTT Gateway with IRQ connected may handle better the messages into a loaded network than Ethernet MQTT Gateway where IRQ is not used? (with NRF24)
Also I would like to know if I can use the other pins of RPi to connect some digital sensors directly there. -
RE: Radio network questions
@hek
Please let me know if in v.2.1.0 the ACK is enabled by default for NRF24 or if we may enable/disable it (where?).
Also I am interesting about the retain flag management from the gateway toward the mqtt broker: is it possible to manage it? How?
Thank you -
RE: 💬 Infrared Sender and Receiver
I use this IR transmitter toward my LG Tv and it works at a distance of ~3.5 m, but IR LED must be well pointed to the Tv, otherwise it doesn't work.
-
RE: Question about step-down-module.
They specify in Description section: Output Current: 12A, so this is maximum, still ok if you need 10A
-
RE: Does HA ignore repeat sensor values?
It would be very nice to be able to choose between HA interface update/don't update for the same value. For me, I am looking for last time value change/receive also as a confirmation of node running in good shape. Thank you.
-
RE: Connect sensors directly to the Gateway (again)
@DirkB19 It may take some time to follow the debounce procedure for each of the 16 inputs. For me, I have no big problems with delay, the commands act almost instantly. I do not use debounce, since no physical input there, while my node use 4 relays, several sensors, IR receiver (this take some time, but no big delay).
-
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: Connect sensors directly to the Gateway (again)
@DirkB19 , I just compile again this file and it works fine for me using Arduino IDE 1.6.5 on Linux, MySensors 2.0.0 beta, set Arduino/Genuino Mega or Mega 2560:
Sketch uses 40,046 bytes (15%) of program storage space. Maximum is 253,952 bytes. Global variables use 1,404 bytes (17%) of dynamic memory, leaving 6,788 bytes for local variables. Maximum is 8,192 bytes.
I saw this library is continuously changed, while still beta and still the same version number from long tome ago! You may remove some important definition or included libs, or the actual MySensor development version need something different into the code. I may ZIP and send to you my working version of MySensors, but should this be the right approach?
-
RE: Home Automation
configuration.yaml file updated on GitHub https://github.com/Mihai258/MySensors-HomeAssistant-Live
-
RE: Handling ACK from MySensors
In HomeAssistant, if you use MQTT switch for example, with state and command topic, the command is send to the gateway when requested from the interface, but the switch on the interface change itself when it receive back the status from the gateway. If the message doesn't reach the destination and comes back with the new status, the interface doesn't change the switch state.
I encounter this situation a lot of times. After many tests, my findings show that the messages are lost between the nodes and the gateway, but I never miss a message between the gateway and the controller.
So, while it will be nice and useful to have an end-to-end implementation with ACK and automatically retries, the real problem can be solved if such mechanism will be available between nodes and gateway. -
RE: Home Automation - multi-sensor nodes
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.
-
RE: Home Automation
@maslinar Right now it is capable of email notification and it does its job. Next planned step in this area is to use SMS notification (waiting for the module). I will take a look to GCM, but not sure about integration here.
-
RE: Multiple sensor node freeze
I have checked the free memory of a node based on http://playground.arduino.cc/Code/AvailableMemory , the results are the following:
While normal usage, low messages rate, the measurement is the following and it remains constant:freeMemory()=825
After a burst of messages, the time when it doesn't block (I mention that because it blocks quite often while handling many messages) I got this:
freeMemory()=2195
Other measurement close to blocking point:
freeMemory()=-28671 freeMemory()=-27900 freeMemory()=-27900 freeMemory()=-27900 freeMemory()=-27900 freeMemory()=25761
The problem could be related to variables that exceed their memory limits or loose free memory by fragment it and not able to recover.
I observed once after some errors I got Radio init successful and the freeMemory get back its value of 825 in my case. -
RE: Multiple sensor node freeze
I have tested 4 switches/relays on the gateway and they work fine, no blocking during stress test (mostly group switch, like I did for node test).
-
RE: Multiple sensor node freeze
While monitor also the NRF25 power (from other source than Arduino itself) I see it get ~11-13mA while working and goes to zero when the node blocks.
-
RE: Handling ACK from MySensors
I have checked the serial monitor while stress the node with a lot of switch on/off and from time to time I got some errors like:
read: 0-0-10 s=9,c=1,t=2,pt=0,l=2,sg=0:ON send: 10-10-0-0 s=9,c=�J*�pt=0,l=2,sg=0,st=ok:ON send: 10-10-0-0 s=9,c=1,t=2,pt=0,l=2,�+�Vt=ok:ON send: 10-10-0-0 s=9,c=1,t=2,pt=0,l=2,sg=0,st=ok:ON
More info here: http://forum.mysensors.org/topic/3144/multiple-sensor-node-freeze/2
So the missing messages could be related to this: some of them goes out with errors, if they go. -
RE: Handling ACK from MySensors
I think the problems may occur if a lot of messages are sent inside the NRF24 network. Sometimes it happened that two (ore more?) nodes (including the gateway) start sending almost in the same time.
One example is group switch: the controller send several messages shortly one after other; the node get the first message, set its relay accordingly and send back to the controller the new state; in this moment the controller should change also the corresponding switch on its interface; but the node may be busy to receive other messages or may be during reply transmission.
For me it happens that the node message doesn't reach the controller, the corresponding switch on the interface doesn't change even if the node get the message from the controller and perform the right command (for example a light on).
I propose several settings on MySensors side that could improve this a little bit, not to solve:- increase the transmission speed from 250kb/s to 1 or even 2 Mb/s; this will shorter the transmission time by 4 or 8, so decrease the probability of collisions; the drawback is shorter radio range;
- increase the interval between node updates; the examples start with 30s, in my opinion it is not necessary to get temperature of a room so often, may be 1, 3 or 5 min is enough for most situations;
- node send the same message 2 or 3 times at very short random intervals without test anything else, like ACK (still testing here, may be ~20-100ms is ok).
All of those are quite simple actions.
I don't know how to modify the gateway to send the messages to the node as I mentioned - several times, only from the node to the gateway. Any advice (or better - example) could help.
For WiFi gateway, my opinion it that WiFi may not made troubles because its higher speed allow to exchange a lot of messages with the controller via broker, so no bottle neck here.
I have mentioned on the Bug Reports that the gateway act also for its relays if they have the same CHILD_ID as other node, this also could have a negative influence in message sending.
Of course, an automated mechanism end to end will be the best, but here the problem seems to be on the NRF24 network side, so some improvements are needed here.
An automated ACK between nodes and gateway that include resending of the message few more times at short random interval will help a lot. -
RE: Multiple sensor node freeze
I succeed to retrieve the error message!
Setup: MQTT gateway connected via Ethernet to the broker, only one node in the same MySensors network (development), HomeAssistant, switching very aggressive a group of 4 switches, in my sketch each message is sent three times with wait() between them.
The last few messages are:read: 0-0-10 s=4,c=1,t=2,pt=0,l=3,sg=0:OFF send: 10-10-0-0 s=4,c=1,t=2,pt=0,l=3,sg=0,st=fail:OFF send: 10-10-0-0 s=4,c=1,t=2,pt=0,l=3,sg=0,st=ok:OFF read: 0-0-10 s=9,c=1,t=2,pt=0,l=3,sg=0:OFF send: 10-10-0-0 s=9,c=1,t=2,pt=0,l=3,sg=0,st=fail:OFF send: 10-10-0-0 s=9,c=1,t=2,pt=0,l=3,sg=0,st=ok:OFF read: 0-0-10 s=1,c=1,t=2,pt=0,l=2,sg=0:ON send: 10-10-0-0 s=1,c=1,t=2,pt=0,l=2,sg=0,st=fail:ON send: 10-10-0-0 s=1,c=1,t=2,pt=0,l=2,sg=0,st=ok:ON read: 0-0-10 s=2,c=1,t=2,pt=0,l=2,sg=0:ON send: 10-10-0-0 s=2,c=1,t=2��J*���+�x00�=fail:ON send: 10-10-0-0 s=2,c=1,t=2,pt=0,l=2,sg=�+�� 99rex00x00��0-10 s=4,c=1,t=2,pt=0,l=2,sg=0:ON setIK`}Starting repeater (RNNRA-, 2.0.0-beta) Radio init failed. Check wiring.
The gateway and node was not moved at all. Resetting the node from the power (keep its position to check if the wires made some problem) the node come back alive. Shaking the node while change switches from interface less aggressive: the node continue to works fine.
Sending again a lot of messaged by changing the switches it gives some errors from time to time, but it recover from them and continue to work:
read: 0-0-10 s=4,c=1,t=2,pt=0,l=3,sg=0:OFF send: 10-10-0-0 s=4,c=1,t=2,pt=0,l=3,sg=0,st=fail:OFF send: 10-10-�0 s=4,c=1,t=2,pt=0,l=3,sg=0,st=ok:OFF read: 0-0-10 s=9,c=1,t=�Jx000,l=3,sg=0:OFF send: 10-10-0-0 s=9,,�|΢x00�x00x00x00�Y�x00�3�]x00�(Starting repeater (RNNRA-, 2.0.0-beta) Radio init successful. send: 10-10-0-0 s=255,c=3,t=15,pt=0,l=2,sg=0,st=ok: send: 10-10-0-0 s=255,c=0,t=18,pt=0,l=10,sg=0,st=ok:2.0.0-beta send: 10-10-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=fail:0 read: 0-0-10 s=4,c=1,t=2,pt=0,l=2,sg=0:ON
So from time to time, after a burst of messages, some messages have some errors and the node made a init of radio and some times it doesn't succeed to recover from there to start over, it blocks itself.
-
RE: Handling ACK from MySensors
@martinhjelmare
Thanks for the idea, I have to check about the wait function, how it works with few messages waiting to be sended again.
The template in HA may work with ACK, I will try them. -
RE: Handling ACK from MySensors
@martinhjelmare
I found some info about ACK in MySensors here: http://forum.mysensors.org/topic/2189/serial-api-noack-when-sending-with-ack-failed/2
And find somebody code for resend the message in case of sending error: https://github.com/n3roGit/MySensors_n3ro/blob/master/examples/resend/resend.ino
A simplest way to improve the chance of message receiving is to transmit the same data several times even without confirm the delivery and with the drawback of increase the network load.
I have calculate one message duration is about 1ms (maximum message length is 32 bytes=256bits, transmission speed of 250kb/s) and I insert a random pause equivalent with few messages between transmission, so the proposal code into the sketch is a function to be used when delivery is important:void resend(MyMessage &msg) { byte tmin=3; byte tmax=9; for (byte i=0; i<3 ; i++) { send(msg); delay(random(tmin,tmax)); } }
The delay function is not the best choice, but the overall impact should not be very important because the delay is only few ms.
I plan to use it for PIR, water leak, relays and commands and not for temperature and humidity (even if the temperature value is monitored and a higher value trigger an alarm). -
RE: Handling ACK from MySensors
@martinhjelmare
Thank you for the answer. I have built a system with several sensors using NRF24 for communication between nodes and gateway, the gateway is connected with Ethernet cable to the network and use MQTT.
Sometimes, in rare cases, the message doesn't reach the other end and this happens in booth ways: nodes messages doesn't show on the controller interface, the commands doesn't trigger the node. Even if they are quite rare cases, they are annoying. I think the problem is on the radio side may be due some intefrerences (I check WiFi signals nearby and set a channel far fro them) or due to many messages in a short time, but I understand that ACK is a checking procedure end-to-end and it is not handled by MySensors libraries, it should be managed by the user code in the node and controller side.
I wil try some tests with QoS and ACK. -
Handling ACK from MySensors
Hi,
Please let me know how to handle ACK from MySensors messages using MQTT? Unfortunately in MySensors seems not to be automatically handled, users have to write a dedicated procedure for this. I think I can do that: set ACK to 1, send message, check the return ACK message and if not received send it again (may be into a 3 times loop). Does HA respond to a message with ACK if requested?
And how to handle the message sent from HA to node? Now I send the message from HA to node to switch a relay and the node send back one message with its new state; if this message is not sent or received properly by HA, the switch on the HA interface doesn't change.
Thank you. -
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: Multiple sensor node freeze
I have added a capacitor to the power supply - 1000uF, still blocking, then change the Arduino Nano and reduce the messages number and now it seems to work, only few continuous hours testing.
-
Check messages node-gateway
I understand that ACK is used to verify the message delivery from the node to the controller end-to-end, and the ACK bit management must be done in the sketch. What about the messages between node and gateway? Are there an automatic mechanism to check the delivery to the gateway? When the function send() is called, it send the message only once to the gateway or is trying several times? Thank you.
-
RE: Multiple sensor node freeze
I plan to modify my code to give some time to each message to be sent, so instead of:
Hum = dht.getHumidity(); Temp = dht.getTemperature(); send(msgTemp.set(Temp, 1)); send(msgHum.set(Hum, 1));
modify the sequence order like this:
Hum = dht.getHumidity(); send(msgTemp.set(Temp, 1)); Temp = dht.getTemperature(); send(msgHum.set(Hum, 1));
Could this help? Thank you.
-
Multiple sensor node freeze
I have built a network using the dev branch of My Sensors - MQTT Gateway and HomeAssistant. Each of my 5 nodes has several sensors and relays, so they have to communicate up to 16 messages each to the gateway.
If I stress the nodes with quickly successive commands, they freeze soon or later and do not get out from this state. The "stress test" was done via HA interface or using IR remote (the relays can be triggered using a remote) or triggering the water sensor. If I let them works, the freeze does not happens in few days, only rare. Is there a limit of messages to be send/received one time per node or per network? I suspect this happens when other node is updating its state, so when the network deals with many messages.
Could it be related also to the bug I have mentioned in other post: the gateway sensors react when sending commands to the nodes with the same Child_ID ? -
RE: Home Assistant v 0.13.1
@martinhjelmare Thank you for update. Please let me know if this change does apply also for MQTT devices. I am using MySensors with MQTT Gateway and declared sub-type is S_Status/V_Status, in HA one of my sensor looks like:
state_topic: "P/12/9/1/0/2" command_topic: "S/12/9/1/0/2"
Should I update the configuration file? Thank you
-
RE: Relay on MQTT Gateway 2.0 error
Until the problem will be solved, the solution is to use other range numbers for gateway relays, I go for single numbers in nodes (1, 2 ...) and high range for the gateway (101, 102...). I also have updated my examples on GitHub and use this approach to my project very close to final stage.
-
Relay on MQTT Gateway 2.0 error
Hi,
I have installed relays (and other sensors) on the MQTT Gateway, I a using the latest version of MySensors development branch, HomeAssistant 11 and 12 (I think this shouldn't matter, since use MQTT). If the CHILD_ID use the same number on the Gateway as any of nodes, the relay on the gateway react also when I use the relay on the node! When command direct the relay on the gateway, they works fine.
So, the relays on the gateway react if their CHILD_ID is the same with any nodes in the network, the gateway switches doesn't look for the NODE_ID.
Should I insert something special in the gateway sketch when use sensors/switches, like check the node number? -
RE: I need a dual communication example...
My sketches just do this, they are waiting for commands and they sends updates to the gateway periodically: http://forum.mysensors.org/topic/2747/home-automation-multi-sensor-nodes
You may modify them to update the relays status or not. -
RE: Home Assistant v 0.11.1 with switch support
Thank you, it works fine now. My main problem was related to the mqtt version: it must be 3.1.1, while linux default is an old version capable only 3.1.
-
RE: Home Assistant v 0.11.1 with switch support
Thank you! Please let me know if this new release is development or not, because I am looking every day on HA site for update (mostly for solving the delay for group switches) and there are no news about 0.11.
-
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: AC current meter
The sensors offer an analog value, so you have to use one of the Ax input of Arduino. I found an example of implementation here: http://www.homautomation.org/2013/09/17/current-monitoring-with-non-invasive-sensor-and-arduino/
I also plan to use such a device in my automation project in the near future and I am already prepared for that, I published few sketches with analog input usage, people have to use as they want the analog input values. -
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. -
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: Combining MySensors examples
I have updated my project. While still under testing, now it use MySensors 2.0.0 beta , external MQTT and tested examples of sensors on the gateway.
-
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: Gas Sensor Problem
I was using a different approach for smoke sensor read, if you are interested please take a look here: http://forum.mysensors.org/topic/2747/home-automation-multi-sensor-nodes
There are examples includes of single sensor node and multi-sensor node that include also MQ2 sensor and example how to read the associated MQTT message into HomeAssistant. -
RE: 1.6 gateway possible error
The LEDs are still active. I solve it by set all LEDs PIN no to 200 into MyConfig.h . Not a PRO solution, but I need the PINs and now I can use them.
-
RE: 1.6 gateway possible error
I use the development version downloaded about one hour before posting, then check several times with 1.6 and 2.0 versions. I change the LED pin to 2 for all three LEDs (Rx, Tx, Err) and then my switches that use old LED PINs works fine, while a LED connected to the PIN 2 was blinking.
-
RE: 1.6 gateway possible error
Problem found in 2.0.0-beta: the LED pins seems to be active on nodes even I didn't enable MY_LEDS_BLINKING_FEATURE in MyConfig.h, so I expect them to be unavailable and do not interfere with my sketch, but they did. How to disable them and keep the pins for my program?
In 1.6 they are not active. -
RE: 1.6 gateway possible error
I explain here what I see myself, may be I am wrong, I am not an expert in MySensors.
So, I add sensors to the gateway - MySensors 1.6, the gateway is the only powered module, the Serial Monitor shows the incoming message to be ON, OFF then ONF and it does not work anymore for the switch.
Power up a node and check it: it works fine, the messages are the right ones.
I have change the message for active state from ON to ONN to be the same length with the off state and it works for the gateway. -
RE: 1.6 gateway possible error
It could be related to, but I am not sure. I have encountered something similar but on node, I have posted on http://forum.mysensors.org/topic/2675/mysensors-1-6-availability/9 and later on it seems to disappear. The nodes works fine as I have tested and the tests were done with the same commands ON and OFF, so the problem I found is only in the gateway.
-
1.6 gateway possible error
I am testing MySensor 1.6 gateway with sensors and I got the following behaviour: sending ON and OFF commands receive the following on gateway:
Message load: ON Message load: OFF Message load: ONF
It seems like the gateway do not clear the message.data, just keep the previous value and overwrite it.
-
RE: Combining MySensors examples
Hi,
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: Suggestion for documentation
Thank you, I know, I already do this, but I am thinking for other users too. I was building a node with 4 Relays, temperature sensor, PIR, smoke sensor, IR sensor so I use a lot of Arduino inputs.
-
Suggestion for documentation
Hi,
I understand from the MySensors files that some PINs are not available for sketches in case some options enabled, for example in MyConfig.g PIN 7, 7, 9 or 4, 5, 6 are for LEDs, 17 (A3 ?) is reserved for ATSHA204 if enabled, 7 is reserved for soft signing if enabled.
I suggest to include this info into a documentation that could be useful for people when add more sensors to a node, this could be inside a chapter dedicated to more sensors into a single node or just comments inside examples. I already built test network with MySensors 1.5 then 1.6 and all nodes have several sensors. The code is not as nice as yours, but I can share it (already shared for 1.5, waiting for final version of 1.6, because changes may occur).
Thank you -
RE: MySensors 1.6 availability?
Thank you for hint, inside the provided link page I found another one: https://github.com/mysensors/Arduino/pull/317 and there I understand the issue was solved in the available development version, so I download it, install and it works now!
-
RE: MySensors 1.6 availability?
I cannot control relay from HomeAssistant to MySensors 1.6. I was built my own node sketch wit 4 relays and other sensors. The command for relays are "ON" and "OFF".
I have added the following line into the receive procedure for testing purposes:Serial.print("Message data: ");Serial.println(message.data);
And find out the messages reach the node as following:
read: 0-0-10 s=1,c=1,t=2,pt=0,l=3,sg=0:OFF Message data: OFFIRTempa
and it is the same for sensors:
read: 0-0-10 s=6,c=1,t=0,pt=0,l=3,sg=0:NAN Message data: NANIRTempa
(NAN is because the temperature sensor is not connected, never mind)
So the message contains the data plusoffset "IRTTempa". When I compare the data string with my expected value they didn't match: OFF is not the same with OFFIRTempa.
For 1.5 version I get them work fine over MQTT with exactly the right string.
Do you have any advice? Thank you. -
RE: MQTTGateway does not seem to start broker
You very welcome! I am happy that my work is useful for somebody else, you are the first with a feedback, so I am also happy about this. I hope my examples are simple and clear enough to build any sensor combination you need.
-
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.
-
RE: MySensors 1.6 availability?
Thank you for explanation, I was expected a regular sketch with setup and loop doing their jobs, I didn't know they could be empty.
-
RE: MySensors network static or dinamic?
Thank you for the answer! I setup my nodes ID static, because I have to manually declare them inside HomeAssistant. Is it ok if I start the node with ```
gw.begin(incomingMessage, NODE_ID, true)
or I must do it with
gw.begin(incomingMessage, NODE_ID, true, AUTO)
? (is it by default AUTO from MyConfig.h ? )
-
RE: MySensors 1.6 availability?
The link is about the Ethernet Gateway, not MQTT Gateway. However, none of them seems to be ready, the setup and loop are empty. I am using now MQTT Gateway from 1.5 version together with HomeAssistant, I have posted my code (now is under testing), but I cannot add other MQTT devices.
-
MySensors network static or dinamic?
Please let me know if the MySensors network configuration is static or dynamic.
I mean, if I install the Gateway and two nodes and they connect as following:
Gateway(0) - Node (1) - Node (2) (1 is repeater for 2)
Then I change something inside the network and move the Node2 closer to the Gateway, so the configuration have to become like this:
Gateway(0) - Node (2) - Node (1) (2 is repeater for 1)
The network will change itself or should I erase the EEPROM of the Gateway and nodes and upload again the sketches? -
MySensors 1.6 availability?
I am interested about the 1.6 version of MySensors, mainly for the MQTT Gateway using W5100, while this is not available today even in the development version. Do you have an estimation about this release availability or at least about the Gateway using W5100?
Until now, I succeed to implement the 1.5 version of MQTT Gateway with 5100 to work with Home Assistant, while the Serial Gateway doesn't work for me.
Thank you -
RE: MQTTGateway does not seem to start broker
I succeed to get a working system using MySensors with MQTT Gateway and Home Assistant, details here: https://github.com/Mihai258/HomeAssistant-MySensors-MQTT, or you may wait for the future release of MySensors who may work with any external mqtt broker, like mosquitto.
-
RE: Homeassistant problem? Error decoding message from gateway, probably received bad byte.
Thank you for advices, I was trying but no success after several days, so I left the ideea of using the Serial Gateway and moved to the MQTT Gateway + Home Assistant, I made it to work! I have published my work at https://github.com/Mihai258/HomeAssistant-MySensors-MQTT , I hope it will help other people to quickly implement their own projects and save their time.
-
RE: Homeassistant problem? Error decoding message from gateway, probably received bad byte.
I have the same issue using the following configuration:
MySensors 1.4 & 1.5 built with Arduino Nano 328.
Home-Assistant v.0.9.1
Python 3.4
PySerial 2.7
PC: Linux Mint 17.2 & 17.3
I have wrote also on HomeAssistant forum and waiting for some ideas to bypass this situation.
Any idea to solve it is very welcome... Thank you