If this is your first visit, be sure to check out the FAQ. You must register before you can post. Your first post will be checked for appropriate content
(SPAM) - please allow a bit of time for that. After that, you'll be able to post at will!
Short answer; no you cannot create if then else events.
The homeseer event engine is set up around discrete triggers that are true for a specific short interval preforming a specific action. IE If the Time is 7am do X is true at 7am and X gets executed once. If you tried to add an If Then Else Y the event would be true for every time except 7am. So every millisecond Y would be executed. Say Y is turning off a light; imagine the network traffic sending an off command to that light every millisecond.
The event engine is similar to programming, and like any other programming languages there are rules that need to be followed. While it might remind you of another language you are familiar with, there are differences and nuances.
HS4 Pro on Shuttle NC10U, Win10; Z-NET
Number of Devices: 449
Number of Events: 210
Thank you, I totally understand that example for timed events. I was hoping there was an easy way without have to create a ton of events.
While I have your ear, it seems that in the Then clause, if you kick off other events they are all done in parallel, is there any way to force serial execution? (the only way I came up with was to WAIT for 1 second, between each event kickoff.)
How are you firing off the other events? If you use the Run Event after x Time, the x Time is measured from when the original event was triggered.
Also, running an event actually just schedules the running of that event. By putting in the 1 second wait time, the system will then (usually) have time to kick off that second event while the first one is paused.
Examining the system (Homeseer) log will show you what is happeing.
HS was going to implement conditional actions/THENs which in effect would be an If-then-else. Unfortunately, they dropped it from the upcoming features list. If that is something you would like to have then send them a feature request. https://dev.homeseer.com/servicedesk/customer/portals
HS was going to implement conditional actions/THENs which in effect would be an If-then-else. Unfortunately, they dropped it from the upcoming features list. If that is something you would like to have then send them a feature request. https://dev.homeseer.com/servicedesk/customer/portals
I'm not sure that's a viable option. I'm sure there is more than one way to do it, but what immediately comes to mind is to use the HS database and only send out a command/make a change if it's indicated. That solves the network congestion/command spamming problem. The main drawback with this solution is what happens if the database is out of sync. With newer devices this is less of a problem but it can and does still happen. It would definitely be an issue for people with 300 series zwave switches/dimmers as that was before widespread instant status reporting. There is certainly more than one way to skin a cat... I'd be interested in other peoples thoughts on how to implement if-then-else.
NC-Lou; yep, you hit the nail on the head, putting a wait 1 sec will set up serial execution.
HS4 Pro on Shuttle NC10U, Win10; Z-NET
Number of Devices: 449
Number of Events: 210
I go around difficult constructions and extra devices by just using one event and that event calls a script. In the script i use a suitable scripting language that can handle IF/THEN/ELSE structures.
Conditional action capability is available with EasyTrigger. Here's a simple example where devices 123's and 234's values are condition for setting of a device value. If 123 = 1 and 234 = 0 then set device = 100 else set to device 345's value.
IF [whatever]
THEN set [device] to expression IF($$DVR:123: = 1 AND $$DVR:234: = 0; 100, $$DVR:345)
Nested expressions are allowed so adding another IF in the 3rd expression parameter provides for ELSE IF. Operators can be used as well. If logging is important you'll need to add it manually, as standard HS event logging gives no indication of whether the conditional action fired--only that the event ran.
Comment