@martinhjelmare No problem, I'll try to get some more data. Regarding HA version, I'm always on the latest version (with one or two days delay).
Posts made by abmantis
-
RE: Delay processing messages
-
RE: Delay processing messages
@martinhjelmare Have you looked into this? I've been noticing delays very frequently
I don't have those delays with other components, and also had not had them when using Pimatic instead of HA. -
RE: Pooling battery relay
@martinhjelmare How cool! That solves my problem! You developed the component for HASS? Great work dude! Really, thanks for it.
I hope to be able to contribute more in the future, for now I've only done some small PRs.
-
RE: Pooling battery relay
@martinhjelmare that is great!
So if I have, say, a switch and turn it ON on HA, when the node sends an heartbeat HA will send the ON command to the node? -
Pooling battery relay
I want to make a relay/switch which needs to be battery powered. Because of that it can't be constantly listening for messages. Since it is not critical for it to be instant, I was thinking that the node could be sleeping for like 60 seconds, and the send and heartbeat (or other message) to the gateway and wait for a reply. When receiving that, the gateway would send the current state to the node, and the node would then return to sleep. It would be similar to the option that exists in MYSController, that waits for a node to speak to send it a message.
Is this possible to do using Home Assistant?
-
RE: Delay processing messages
Thanks. I've been debugging it, and it seems that sometimes "self.handle_queue()" in run() takes one or two seconds. It is not very frequent, but it seems to be the cause of my issues.
Also, my node is sending the message twice sometimes (I have yet to check why), and that increases the time also. -
RE: Delay processing messages
@martinhjelmare have you found anything? I've had a quick look at the code and found nothing relevant. The 1 second timeout you're referring to is just a connection timeout, right? It shouldn't affect communication after connecting I guess.
I'll try to add some debug prints to see if I find anything. -
RE: Delay processing messages
@martinhjelmare yes, I'm using the serial gateway. It should be possible to make it better, since I had no issues with the same gateway on Pimatic. I'll try to have a look at the code and let you know if I also find anything
-
Delay processing messages
Sometimes I notice that there is some delay in Home Assistant processing or receiving MySensors messages.
For example, I have a node with two switches. I press switch A and right after switch B. Looking at the debug logs from HA's MySensors component, switch B state is updated about a second after switch A.I have never noticed this delay when using Pimatic instead of HA.
-
RE: [Solved] Auto reset motion sensor state
@martinhjelmare great idea! Thank you.
-
[Solved] Auto reset motion sensor state
Is there any way to set the state of a motion sensor (binary_sensor) to "off" from Home Assistant?
My sensor sends a TRIPPED=0 when there's no movement, but if the message is lost or the sensor goes out of battery, I want it to appear as "off" in HA after some time. -
RE: [solved] Sensor missing after restart
@martinhjelmare I just updated to the latest version and now they appear correctly after rebooting! Thank you very much.
-
RE: [solved] Sensor missing after restart
@exxamalte The sensor appears correctly after sending values. Also, the .json file is correctly filled with the sensor data.
@martinhjelmare Well, I'm using 0.33.4! I'll try updating and report back Thanks.
-
[solved] Sensor missing after restart
After restarting Home Assistant, my motion and light sensors do not show up until they send values again. They are being correctly saved on the persistence .json file, so I expected them to show up.
-
RE: Battery Sensor with stepup and on/off transistor
@n3ro Couldn't you power the step-up from one of the arduino's digital pins? Then set the pin to HIGH/LOW to power the sensor on/off?
Maybe it draws too much power? -
RE: PIR sensor starts to trigger constantly after some time
@LastSamurai Here is the code for my PIR and Light sensore node:
https://github.com/abmantis/MySensors-Sketches/blob/master/MotionLightSensor/MotionLightSensor.inoIt is a bit complex, sorry. Also, ignore the temperature parts since that is a WIP and is untested.
-
RE: Node stops working and does not recover if communication fails
@Boots33 But for my node it should be connected in 5 seconds. Range is not a problem. The problem happened because I had to reboot my raspberry, and someone pressed the switch
Lets say it looses connection for some reason. The next time I press the switch (and the gateway is on), it will have 5 seconds to reconnect, which should be enough. If the gateway is still of, I can just press the switch again when it is turned on.
-
RE: PIR sensor starts to trigger constantly after some time
My code is a little different, since I only send 0 when the PIR reports 0, instead of sending it right after 1.
If you want I may post the code later.
-
RE: Node stops working and does not recover if communication fails
Thanks for the help and explanation.
I suggest the following:
if(!isTransportOK()){ wait(5000); // transport is not operational, allow the transport layer to fix this } sleep(30000); // transport is OK, node can sleep
That way, if it still can't connect during those 5 seconds it will sleep, and try again the next time.
-
RE: Node stops working and does not recover if communication fails
@Boots33 Yeah, my node sleeps! It may be that. I see that the development branch has a fix for that already. Is it ok to use that branch?
-
Node stops working and does not recover if communication fails
I've noticed a problem recently, which I haven't seen before (not sure if it was a recent update or is a problem with 2.0).
If a node sends data to the gateway while the gateway is powered off, the node seems to stop communicating with the gw (after the gw is turned on, of course) until the node is restarted. I have 2 nodes, both with 2.0 and MYSBootloader 1.3, and they both exhibit this behavior.
Since one of them is inside the wall switch, and the other in a small box, I have not yet had the chance to debug it further.Any tips?
-
RE: PIR sensor starts to trigger constantly after some time
Try with a fresh battery! Do you have any step-up converter for the PIR? I've also had the same problem recently, and I think (still need to test a bit more) that it was caused by the battery getting a bit discharged (after an OTA update).
It usually triggers the PIR when the radio sends something. I think it is because the radio makes the voltage fluctuate when it sends.
A simple workaround is to wait 3 seconds (the time my PIR takes to reset/settle after triggering) after sending data, and only then check if it has triggered. But I only wait if the previous state was zero (no motion), since I want it to fire instantaneously when motion is detected. So:- Get state;
- Send state data;
- If state was 1, sleep 3 secs;
- Send new state if it changed from 0 to 1 (during 3 secs sleep);
- Sleep with interrupt;
-
RE: HC-SR501 motion sensor
@mrwomble Yeah, the issue was probably due to the battery getting discharged during the OTA update, since that keeps the radio awake for a long time. So, should we use a 3.3V step up converter for this sensor?
-
RE: HC-SR501 motion sensor
Another question: how does the sensor work when the batteries start to provide less than 3V? How low can it go?
-
RE: HC-SR501 motion sensor
@adrianmihai83 Hey. Did the potentiometer change solved it for good? I've had some issues with the HC-SR501 where it would constantly change from high to low.
I have one that has been working great for some months. Today I've made a simple update to the sketch (via OTA, so no physical contact), and now the sensor keeps triggering constantly. It was not a change in the sketch that caused this, I'm sure of that.
I've reduced the sensitivity and it seems to have stopped now... Still, it is weird because it was working before, with that same sensitivity level! -
RE: Advice on testing communication/range
@mfalkvidd Thank you! The sketch on that thread should work
-
RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta
@yd-kim Yes, just touch Arduino's pin 10. Dunno if it is a particularity with this Arduino or radio. It updates the node in about 20 seconds!
-
Advice on testing communication/range
Do you guys have any sketch to test communication and/or range? Something like ping should do it.
-
RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta
@Anduril Haven't tried serial yet. The old bootloader seemed indeed a bit faster. I also noticed that if I touch pin 10 with my finger, it gets really fast! It just sends the packages continuously without stoping. As soon as I stop touching pin 10, it pauses.
The gw and the node were like 1 meter, so it is not a distance problem. Also tried moving them closer and apart.
-
RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta
@yd-kim Ah that! Nope, unfortunately it stills takes a long time to flash. We probably need an updated bootloader.
-
RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta
Yeah, the bootloader works well with the v2.0 release.
The major issue it has currently is that sometimes it takes quite a long time to flash a sketch. It seems that when the wireless connection is not perfect, it stops for 2 or 3 seconds multiple times. Like, send 10 packages, stop 3 seconds, send 5 packages, stop again. -
RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta
@ะะปะตะบัะตะน-ะััะฐัะพะฒ Thank you! Will try that soon
Any updates regarding the bootloader? -
RE: Smartsleep implementation
@martinhjelmare Yeah I did noticed that! But since I've never seen any heartbeat messages before, I tough that it was normal and didn't though that it was related to the change.
-
RE: Smartsleep implementation
I made an issue: https://github.com/mysensors/Arduino/issues/468
I would gladly do the implementation, but I won't have enough time to work on it soon
-
RE: Smartsleep implementation
Yes, the node could send the heartbeat and wait for a "no commands" message from the GW. We could have a timeout like we have now, but most of the times the node would be sleeping much sooner.
-
RE: Smartsleep implementation
I have made a PR for that: https://github.com/mysensors/Arduino/pull/465
By the way, I think the default MY_SMART_SLEEP_WAIT_DURATION is too high (500ms). Using MYSController, a reboot command is received using only 100ms. I've not tried a lower value yet.Also, couldn't we implement a smarter way to do this? Instead of just waiting and listening for the reboot command (or any other), the node could ask the GW if there's any command pending. The GW would always reply, and the node would sleep right after the reply (or execute the command if requested). That way, there is no need to wait when there are no commands.
-
RE: MYSBootloader 1.3 pre-release & MYSController 1.0.0beta
I have a node with the NRF already soldered. Since Arduino as ISP uses some of the pins used by the NRF, is there anything I can do to flash the bootloader without unsoldering the NRF? Thanks!