Home Automation - Smartkit

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
47,847
You could use a Delay node. Change it to rate limit of say 1 message per minute and drop intermediate messages.

Wouldn’t I then end up waiting a minute for things to trigger?

If that’s the case then HA automation wins again with a simple semi-colon between two entities.
 

patrick123

Expert Member
Joined
Apr 10, 2005
Messages
2,894
Wouldn’t I then end up waiting a minute for things to trigger?

If that’s the case then HA automation wins again with a simple semi-colon between two entities.
The first message will go through immediately, and then subsequent messages are dropped until at least a minute, or whatever time you have set, has passed.
 

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
47,847
The first message will go through immediately, and then subsequent messages are dropped until at least a minute, or whatever time you have set, has passed.

But then that would still mean it triggers twice.

What happens now is...

ON + ON > ON...ON

It should be basically...

ON + ON > ON
 

Goobie

Expert Member
Joined
May 22, 2004
Messages
1,571
So running it off 12V makes no difference. I have now removed the device until a solution can be found.

The troubleshooting with Itead is going slow. Currently we are at "Please check if there are two different cables. One is to operate turning on and the other one is to operate turning off." I made a video clip (http://bit.ly/sonoff1) and sent it to them, hopefully we can skip over the "make sure it is powered" questions

A quick update on the relay bouncing at boot up issue

This is the final correspondence I got from them:
I submit your issue last week. The engineer said they developed a new firmware(3.0.1) that activate the relay for a little while in order to protect the circuit. That would be a problem if customers use it to control a garage door. They are trying to find out a solution now. I will come to you if there is any development.

My solution: I ordered this from banggood and will use it to keep the gate circuit open for about 10 sec until after the Sonoff booted up.

https://www.banggood.com/5-30V-10A-...p-1239976.html?rmmds=myorder&cur_warehouse=CN
 

patrick123

Expert Member
Joined
Apr 10, 2005
Messages
2,894
Yeah while a nice clean look certainly, I prefer the visual perception of seeing what’s going on with multiple nodes per person or even per action.

There is a time and place to use both options. For my use below, in my opinion, it would make listing all the gates overly busy.
GateNotify.PNG
 

patrick123

Expert Member
Joined
Apr 10, 2005
Messages
2,894
I really enjoy reading all your nodered posts. Learning things almost each time :)
I thought I knew a bit about Node-RED, turns out you know A LOT more.
Thanks, I promise you this is purely forcing myself to sit down and get something working, and I have just touched the surface.
The more I work with it, the more I'm getting impressed with it.
 

patrick123

Expert Member
Joined
Apr 10, 2005
Messages
2,894
No dice on this for some reason.

It just no longer works, from either node input.

Weird.
Yep, it should have worked, here is a test that I slapped together and it works fine:
Delay2.PNG


The code:
JSON:
[{"id":"332039ab.98a316","type":"inject","z":"4f6028d3.ea53a8","name":"7 Second Time Injector","topic":"","payload":"7 second test ","payloadType":"str","repeat":"7","crontab":"","once":true,"onceDelay":"0.1","x":663.5,"y":84,"wires":[["6ea3dd1f.2443d4"]]},{"id":"9b5bef0e.7e62d","type":"inject","z":"4f6028d3.ea53a8","name":"11 Second Time Injector","topic":"","payload":"11 second test","payloadType":"str","repeat":"11","crontab":"","once":true,"onceDelay":"0.3","x":670.5,"y":175,"wires":[["6ea3dd1f.2443d4"]]},{"id":"6ea3dd1f.2443d4","type":"delay","z":"4f6028d3.ea53a8","name":"1 Minute Delay and Drop the Rest ","pauseType":"rate","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":978.5,"y":135,"wires":[["70bfd79f.6d39e8"]]},{"id":"70bfd79f.6d39e8","type":"debug","z":"4f6028d3.ea53a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1226.5,"y":135,"wires":[]}]

Edit: What I did notice, is that while testing different scenarios, it would remember how far it was in its delay, and when I re-deployed again, continue from there every now and again instead of starting afresh.
 
Last edited:

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
47,847
Yep, it should have worked, here is a test that I slapped together and it works fine:
View attachment 690627


The code:
JSON:
[{"id":"332039ab.98a316","type":"inject","z":"4f6028d3.ea53a8","name":"7 Second Time Injector","topic":"","payload":"7 second test ","payloadType":"str","repeat":"7","crontab":"","once":true,"onceDelay":"0.1","x":663.5,"y":84,"wires":[["6ea3dd1f.2443d4"]]},{"id":"9b5bef0e.7e62d","type":"inject","z":"4f6028d3.ea53a8","name":"11 Second Time Injector","topic":"","payload":"11 second test","payloadType":"str","repeat":"11","crontab":"","once":true,"onceDelay":"0.3","x":670.5,"y":175,"wires":[["6ea3dd1f.2443d4"]]},{"id":"6ea3dd1f.2443d4","type":"delay","z":"4f6028d3.ea53a8","name":"1 Minute Delay and Drop the Rest ","pauseType":"rate","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":978.5,"y":135,"wires":[["70bfd79f.6d39e8"]]},{"id":"70bfd79f.6d39e8","type":"debug","z":"4f6028d3.ea53a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1226.5,"y":135,"wires":[]}]

Edit: What I did notice, is that while testing different scenarios, it would remember how far it was in its delay, and when I re-deployed again, continue from there every now and again instead of starting afresh.
You see the Node Types are different for me so that must be the issue.

imnHqzC.png
 

patrick123

Expert Member
Joined
Apr 10, 2005
Messages
2,894
You see the Node Types are different for me so that must be the issue.

imnHqzC.png
I'm trying to understand.
If person A or B meet the condition (true), then delay for 40 seconds and disarm, else disarm immediately?

You very likely need the delay between the persons and the switch.
 

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
47,847
I'm trying to understand.
If person A or B meet the condition (true), then delay for 40 seconds and disarm, else disarm immediately?

You very likely need the delay between the persons and the switch.

No no, if it's between 7am-9am then it delays for 40 seconds as it presumes I'm walking and therefore slower.

Any other time it just goes immediately as I would be in the car.

It works like that for either person.

The problem comes in that if both people rock up together then it sends double triggers slightly apart which brings it all crashing down as it does everything twice so the gate half opens and then stops and the garage half opens and then goes back up again.

Or worse it all opens happily and you think you are home free and pull in and **** starts closing.

In Home Assistant this doesn't happen as the colon between two triggers (the people) basically means OR instead of AND.

So that delay that is in place works perfectly. The one I was adding was on your recommendation looking like this.

1564567211713.png

What was weird was that it worked for Person 1 just fine, but last night Person 2 coming didn't do anything.

Let me try and fake it quickly.
 
Top