Originally posted by simonmason
View Post
Announcement
Collapse
No announcement yet.
IF-THEN-ELSE Action
Collapse
X
-
To begin with I have several plugins that don't work in HS4 so need to find solutions for those or write something to replace them. Second, I have a lot of scripts that I know won't work out of the box (based on what I read in the forums) so will have to work on each of these one by one to fix them. Third, when converting to HS3 it took months to get everything working so I assume this will be 2X. One of these days I will be brave enough to give it a shot.
Comment
-
Originally posted by simonmason View PostIt would be ideal for a lot of my events to be able to set devices only if they are not already at the state I am about to set them to?
It's available with Set Device to Expression and Set Group of Devices to Expression.-Wade
Comment
-
Frankly, I am not familiar with "Send command only..." but it seems to me this is preventing a value from being set if it doesn't change (is the same). This is important because you can trigger events either when a value is set even if it's the same value or if a value changes. So the way I understand this is that EasyTrigger doesn't even set the value if it doesn't result in a change. What the 'if-then-else' or conditional events are really about is "Do Action x" "if device y meets this condition".
Comment
-
Originally posted by mulu View PostFrankly, I am not familiar with "Send command only..." but it seems to me this is preventing a value from being set if it doesn't change (is the same). This is important because you can trigger events either when a value is set even if it's the same value or if a value changes. So the way I understand this is that EasyTrigger doesn't even set the value if it doesn't result in a change. What the 'if-then-else' or conditional events are really about is "Do Action x" "if device y meets this condition".-Wade
Comment
-
Originally posted by Wade View Post
Please don't call me Frankly. I was responding to the part of simonmason's post that I quoted in my reply. Spud added the "Send only..." option after I and others requested it to reduce z-wave traffic when sending a command to a large group of devices. In my case, when sending an off command to many devices (75+) such as at bedtime, there were significant delays and frequent missed commands. Since only a handful actually needed to be commanded off at any given time, this option fixed the problem. I realize this is only a specific condition added to certain types of actions, but it may address the stated need.
Comment
-
Originally posted by simonmason View PostIs this only HS4?
Comment
-
Ok, I've been lurking but curious how anyone would use an IF-THEN-ELSE in an event being the IF is a trigger
So,
If you put an Else statement as a result of an IF (In other words it didn't trigger) wouldn't the ELSE just be continuously firing??
If time is 12:00am
Then Turn on the light
Else Turn off the light
So if it's not exactly 12am HS would turn off the light every second..
Even ANDIF's and ORIF's would result in the event being triggered or not, so the ELSE would always be true every second wouldn't it?
Can someone come up with a case use of how an ELSE can be use in conjunction with an triggering IF statement with a valid even example?
Now if you mean embedded IF's inside an already triggered event, isn't that what scripting and the complex logic it provides all about?
Comment
-
Originally posted by George View PostOk, I've been lurking but curious how anyone would use an IF-THEN-ELSE in an event being the IF is a trigger
So,
If you put an Else statement as a result of an IF (In other words it didn't trigger) wouldn't the ELSE just be continuously firing??
If time is 12:00am
Then Turn on the light
Else Turn off the light
So if it's not exactly 12am HS would turn off the light every second..
Even ANDIF's and ORIF's would result in the event being triggered or not, so the ELSE would always be true every second wouldn't it?
Can someone come up with a case use of how an ELSE can be use in conjunction with an triggering IF statement with a valid even example?
Now if you mean embedded IF's inside an already triggered event, isn't that what scripting and the complex logic it provides all about?
The only way I can see it working is like you say embedded IFs, i.e. multiple conditions must be met:
IF time is 12:00am THEN
...........IF device x value = y THEN do this ELSE do that ENDIF
ENDIF
The initial trigger is time, the THEN/ELSE decision is based on the value of device x. So if the time is not 12:00am the event does not meet the conditions and neither THEN or ELSE happen. If the time is 12:00am the the THEN/ELSE action is determined by the value of device x.
IF/THEN, AND/NAND, OR/NOR logic can be very confusing at times. I think HS made the right decision to not provide ELSE. Like you say if you that level complexity in events then it's probably best to use a script.iCore5 Win 10 Pro x64 SSD
HS3 Pro Edition 3.0.0.435 Windows
BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:
Comment
-
Originally posted by George View PostOk, I've been lurking but curious how anyone would use an IF-THEN-ELSE in an event being the IF is a trigger
So,
If you put an Else statement as a result of an IF (In other words it didn't trigger) wouldn't the ELSE just be continuously firing??
If time is 12:00am
Then Turn on the light
Else Turn off the light
So if it's not exactly 12am HS would turn off the light every second..
Even ANDIF's and ORIF's would result in the event being triggered or not, so the ELSE would always be true every second wouldn't it?
Can someone come up with a case use of how an ELSE can be use in conjunction with an triggering IF statement with a valid even example?
Now if you mean embedded IF's inside an already triggered event, isn't that what scripting and the complex logic it provides all about?
As for scripting, sure you can do this but now you are asking people to learn a .NET language, knowing all the stuff to include, knowing how to read decipher debug files when things don't work (and they won't from the get-go). HS is for advanced home automation people (and more and more 'regular' folks which is a good thing) but scripting should be left for really hardcore users. I have written some scripts but I try to avoid them as much as I can because neither my wife nor my son could be bothered fixing those scripts if they break.
- Likes 1
Comment
-
Maybe people need to open a service ticket to get this implemented. It was already in the development plan anyways
https://dev.homeseer.com/servicedesk/customer/portals
- Likes 1
Comment
-
Originally posted by mulu View Post
As for scripting, sure you can do this but now you are asking people to learn a .NET language, knowing all the stuff to include, knowing how to read decipher debug files when things don't work (and they won't from the get-go). HS is for advanced home automation people (and more and more 'regular' folks which is a good thing) but scripting should be left for really hardcore users. I have written some scripts but I try to avoid them as much as I can because neither my wife nor my son could be bothered fixing those scripts if they break.
I'm not questioning the ability to add greater flexibility but it has to be balanced against the probability of significantly increasing the technical support load on HST because of the point mentioned above. Unintended actions or triggers on complex events.
As for scripting, I agree that the current state of the scripting documentation and examples are a severe mess and totally lacking.
Your example of what to include, what the statements are is a very valid point.
If the scripting functions were detailed as they were in HS1. There was/is a very well thought and laid out of all the function and more importantly for each and every function call there was a complete snippet example of how to use it. So the issue of what to add, how to encapsulate it a function you wanted to perform was a non-issue. This in contrast to the sparse or non-existent documentation currently provided which is basically just the Function or Object declaration statement with no narrative as to what it addresses, what each of the parameters do and more importantly an real example of how to use it.
Just saying. CAPI.Control(Stuff,"Crap",True,0,False,Sigmund is NOT documentation! What the heck are the trues, false's and more importantly what are the implications of setting something true or false.
I believe that is a major reason for the drop in institutional user knowledge, sharing and advancement of the user base with many of the gifted coders that have either moved on or simply lost interest in helping people. Lot of time to code, not a lot of time to go back and do or fix the documentation. Why bother to do documentation when you can just code more stuff and make it more complex ??????
- Likes 1
Comment
Comment