Thx Spud !
Ok, we've tried it Under HS2 and it gives us syntax errors, can you confirm what would be different in HS2 ?
Also, if you could give us an example of the variables you set in the script call, I cant find where to put my virtual devices codes in there.
For reference, here is our setup :
Humidity level device code : #8
Setpoint virtual device code : H5
Event name : Exchanger-heat-go
BAsically, we want the exchanger event to start when humidity level reaches the setpoint level that corresponds to the virtual device's H5 value.
Thx, almost there !
Announcement
Collapse
No announcement yet.
Device value conditions
Collapse
X
-
Thats great Spud! Exactly what I need but will it work under hs2, I am still running this version until all plugins are migrated. Thx a lot !
Leave a comment:
-
with HS3, the C# script below should work:
Code:public object Main(object[] parms) { string[] parmsArray = parms[0].ToString().Split(new Char [] {','}); int dvRef1 = Convert.ToInt32(parmsArray[0]); int dvRef2 = Convert.ToInt32(parmsArray[1]); string eventToTrigger = parmsArray[2]; if(hs.DeviceValueEx(dvRef1) == hs.DeviceValueEx(dvRef2)) { hs.TriggerEvent(eventToTrigger); } return 0; }
Leave a comment:
-
Device value conditions
Hey guys !
We are trying to set an event with conditional device value instead of specific values like (...in the range or less than ).
Basically, we created virtual devices for some special setpoints we adjust via hstouch. The virtual device holds the correct value that can be changed via touch.
We want an event to trigger at a specific device status but conditionnaly to this variable setpoint. The conditions only offer specific ranges or values but we need to read the virtual device's value in order for it to work.
We could probably have a simple script to do this in the actions instead of using the generic trigger conditions. Im sure someone has written this script but cant find any references for it in the forums.
Can someone point me to a good thread or the script directly ?
Thx ahead !Tags: None
Leave a comment: