App - If -> Then Relation

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

App - If -> Then Relation

Post by Isaksson »

Hello.

It seems that the App If -> Then Relation is not functional the way it supposed to, or at least it does not work when using it in this way.

Create HTTP Device (Create virtual device based on HTTP data)
Set Interval in seconds between polling requests to 1

Now in the App If -> Then Relation set event source to the created HTTP Device and then set one of your Z-Wave switches as Actor.

Enable this and the system will now start to flood with GET, SET against the device you have as Actor, my guess is that every second that the HTTP Device get a reading (even that it not have changed) enables the rule agains the Actor.

If the value not have changed it should not trigger the Actor again.
User avatar
PoltoS
Posts: 7579
Joined: 26 Jan 2011 19:36

Re: App - If -> Then Relation

Post by PoltoS »

To hard to understand. Please clarify
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

Re: App - If -> Then Relation

Post by Isaksson »

Okay, here comes my second try.

This is tested with version: v2.0.1-rc33
* Go to http://ipofRaZ:8083/smarthome/
* Add Local App - HTTP Device (Version 1.0.0 by Z-Wave.Me)
select switchBinary
URL for action On - some url
URL for action Off - some url
URL to get value - url that will provide you with text on or off
Interval in seconds between polling requests - 1
HTTP method to use - GET

Now we have a HTTP device that will check it status every second.
Next step is to make a Z-Wave device to be On when the HTTP device is on or Off when HTTP device is Off.

* Add Local app - If -> Then Relation (Version 1.0.0 by Z-Wave.Me)
List of event sources:
Add created HTTP device
List of actors:
Add Z-Wave device that should be controlled from status from HTTP Device

Save this App and go to http://ipofRaZ:8083/expert/#/network/queue and see that you will fill the queue with GETs and SETs to the device added under List of actors.

Here is a video that is also describing this issue.
https://youtu.be/DVU69Fiw4co
User avatar
PoltoS
Posts: 7579
Joined: 26 Jan 2011 19:36

Re: App - If -> Then Relation

Post by PoltoS »

Ookey, now I got you. This make sense:

If -> Then binding is executed every time value changes. In terms of internal events it changes ever 1 second, since a getter is called. What we need to do to fix your problem is to add a flag to CodeDevice and HTTPDevice to skip value update if new getter value is same as previous. Make sense - we will do it soon.

https://github.com/Z-Wave-Me/home-automation/issues/249
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

Re: App - If -> Then Relation

Post by Isaksson »

Yes, this will solve the issue. Thanks for great support.
Post Reply