How to fix the my automation code?

MrSpeed

Member
I want a light to come one after dark if the back door is opened, I also want this light to go off 3 minutes later. However If I am entertaining and the light is already on then I do not want this rule to apply. This is the way I have done it so far and it has not worked;

18. WHEN Formal Living Room Back Doors NOT READY
WHEN Single Fan Patio OFF
AND IF DARK
THEN Single Fan Patio ON FOR 3 MINUTES

In this program if the light is on and back door is opened, the light will go off and automatically on every 3 minutes.


So I tried this;

18. WHEN Formal Living Room Back Doors NOT READY
AND IF DARK
AND IF Single Fan Patio OFF
THEN Single Fan Patio ON FOR 3 MINUTES


I thought that if it check to see if light was off and found it to be on then the condition was not met and it would bypass the 3 minute clock to turn light off. However that is not the case, the light goes off three minutes after door is open.
 
I want a light to come one after dark if the back door is opened, I also want this light to go off 3 minutes later. However If I am entertaining and the light is already on then I do not want this rule to apply. This is the way I have done it so far and it has not worked;

18. WHEN Formal Living Room Back Doors NOT READY
WHEN Single Fan Patio OFF
AND IF DARK
THEN Single Fan Patio ON FOR 3 MINUTES

In this program if the light is on and back door is opened, the light will go off and automatically on every 3 minutes.


So I tried this;

18. WHEN Formal Living Room Back Doors NOT READY
AND IF DARK
AND IF Single Fan Patio OFF
THEN Single Fan Patio ON FOR 3 MINUTES


I thought that if it check to see if light was off and found it to be on then the condition was not met and it would bypass the 3 minute clock to turn light off. However that is not the case, the light goes off three minutes after door is open.

I think the problem is that this rule only runs once, when the door opens (becomes not ready). i think if you closed/opened the door every 2:55 it would work :D You might want to wrap this in a timer somehow and check periodically.

Does having the door open mean you are "entertaining"? If there was a way to set a flag, that would be helpful.

Probably the best thing would be to put in a motion detector outside...

Chris
 
MrSpeed, we need a bit more information. What are you using as your lighting automation hardware? Do you have an automation program in the mix somewhere? this rule may be able to be off loaded to a HA app, and do exactly what you want.
 
Code:
18.	WHEN Formal Living Room Back Doors NOT READY
		AND IF DARK
		AND IF Single Fan Patio OFF
			THEN Single Fan Patio ON FOR 3 MINUTES

I thought that if it check to see if light was off and found it to be on then the condition was not met and it would bypass the 3 minute clock to turn light off. However that is not the case, the light goes off three minutes after door is open.

I have code nearly identical to this in my system and it works great. So something is up with your system. I can think of two possibilities: (1) old rev of firmware on your controller, or (2) it isn't tracking the status of the device properly. In other words, it doesn't know when the light is on, which is why the second check doesn't fail.

What kind of device are you controlling the light with? You might want to do a test where you turn on the light via any mechanisms that you have set up, and then look at its status on the console, or in PC Access, to see if the displayed status matches the actual status. If it's a non-HAI device, or if you are doing fancy stuff with links, you may have to put in some extra code to poll for the status of the device before you execute this code.
Something like this:

Code:
	WHEN Formal Living Room Back Doors NOT READY
			THEN Single Fan Patio REQUEST STATUS

This block would need to come before the other block, so it gets executed first.
 
My front door code is "almost" identical too, but I see the problem here. I am on the way out the door and I have a dinner to go to tonight so I can't spend too much time on this now but I will try to address it again tomorrow.

The problem:

The light is off, it is dark, the door opens. The light comes on and the timer starts.

1 minute later the door opens again, but this time the light is already ON so the second condition fails and the counter is NOT restarted.

3 minutes after the light came on, it goes off.

I am assuming you want the timer to restart for an additional 3 minutes every time the door opens. This way the light will only go off if the door stays shut for 3 minutes?

If you want it to stay on indefinitely when you turn it on manually, but when automatically activated by the door you want it to automatically go off after 3 minutes of no door activity, this can be done.

The trick is to use a flag that is set/cleared by the switch press, not the light going on. Replace the "AND IF Single Fan Patio OFF" condition with the flag check.

See if you can figure it out. If not I will post my solution tomorrow.
 
My front door code is "almost" identical too, but I see the problem here. I am on the way out the door and I have a dinner to go to tonight so I can't spend too much time on this now but I will try to address it again tomorrow.

The problem:

The light is off, it is dark, the door opens. The light comes on and the timer starts.

1 minute later the door opens again, but this time the light is already ON so the second condition fails and the counter is NOT restarted.

3 minutes after the light came on, it goes off.

I am assuming you want the timer to restart for an additional 3 minutes every time the door opens. This way the light will only go off if the door stays shut for 3 minutes?

If you want it to stay on indefinitely when you turn it on manually, but when automatically activated by the door you want it to automatically go off after 3 minutes of no door activity, this can be done.

The trick is to use a flag that is set/cleared by the switch press, not the light going on. Replace the "AND IF Single Fan Patio OFF" condition with the flag check.

See if you can figure it out. If not I will post my solution tomorrow.


I am using HAI 15 amp switches and controlled via UPB. Weird thing is as someone mentioned that unless I turn the light via pcaccess they do not get marked as on when I look at the status. Basically my second code works well for part of what i want to accomplish. If my kid goes out to throw the trash the light comes on and then goes off after the three minutes. The problem is and I will use last night as an example. I had a friend come over and we went out back to drink a beer, I turned the light on manually, opened the door and closed it, three minutes after we are sitting on the dark while trying to have a conversation. I had to open and close the door literally every three minutes in order to have light. So what I want is for the rule to be ignored if the light was turned on manually.

Maybe the panel does not know if the light is turned on manually, is it supposed to? Again all I have is HAI 600 watt switches and some 15 switches and I programed them with upstart and then later entered them into pc access.
 
Code:
18.	WHEN Formal Living Room Back Doors NOT READY
		AND IF DARK
		AND IF Single Fan Patio OFF
			THEN Single Fan Patio ON FOR 3 MINUTES

I thought that if it check to see if light was off and found it to be on then the condition was not met and it would bypass the 3 minute clock to turn light off. However that is not the case, the light goes off three minutes after door is open.

I have code nearly identical to this in my system and it works great. So something is up with your system. I can think of two possibilities: (1) old rev of firmware on your controller, or (2) it isn't tracking the status of the device properly. In other words, it doesn't know when the light is on, which is why the second check doesn't fail.

What kind of device are you controlling the light with? You might want to do a test where you turn on the light via any mechanisms that you have set up, and then look at its status on the console, or in PC Access, to see if the displayed status matches the actual status. If it's a non-HAI device, or if you are doing fancy stuff with links, you may have to put in some extra code to poll for the status of the device before you execute this code.
Something like this:

Code:
	WHEN Formal Living Room Back Doors NOT READY
			THEN Single Fan Patio REQUEST STATUS

This block would need to come before the other block, so it gets executed first.


I will try this, this might work!
 
Thanks. But if the device is an HAI device, it really shouldn't be necessary. Did you say you configured it with Upstart? Possibly you accidentally did something that messes up the status reporting. You might want to try doing a factory reset on it, and then letting the controller re-configure it. You can do this by putting the switch in setup, and then right-clicking on the unit in PC Access and telling it to configure the device.
 
Interesting posts overnight...

MrSpeed,

Two questions:

What model/version controller do you have?

Why don't you want to use the HLC mode?
 
Interesting posts overnight...

MrSpeed,

Two questions:

What model/version controller do you have?

Why don't you want to use the HLC mode?


PC access is 3.2.0.5.49 I am using omniproII 3.3 The reason I programed the switches with upstart is because they are dimable and my lights are the florescent that are not dimable. So with upstart I can make the switch be non-dimable. I bought could have purchased the non dimming switches, but I wanted the option of going back to dimming lights. On PCAccess I have them set as HLC.


Thanks everyone for all the replies and the assistance!
 
FYI: I personally don't think I have ever actually bought a non-dimming switch, other than relay switches. I do as you did and just set the switch to non dimming. The other common change I do is to turn off the LED for the switches in the bedrooms...

This is VERY a common situation and the recommended way of handling it is to set the switch up using the controller as HLC, then go into upstart and change the one setting to non-dimmable... Doing it this way all of the status reporting/tracking is set up properly, and it is MUCH easier than doing it the other way around.

HLC was designed to make configuring your devices pretty much fool proof. It is an entire schema that allocates links for rooms and scenes and full status tracking. It provides for the ability to differentiate between a light coming on because of programming or a button press, or a link. Finally it is EASY!

In all fairness HLC doesn't work for everyone and sometimes manual configuration is necessary. But unless you have more than 31 rooms in your house, or more than 7 individual loads in a room HLC will probably work for you.

First, in PC Access define your rooms on the 8's:

Unit 1: Living Room
Unit 9: Kitchen
Unit 17: Foyer

Then go back and add in the loads in each room:

1: Living Room
2: light
3: fan
4: corner
5: table
9: Kitchen
10: light
11: fan
12: sink
13: cabinet left
14: cabinet right
15: pantry
17: Foyer
18: light
19: table

Then write the configuration to the controller. Now go to each switch, tap it on 5 times to put it in to the setup mode. Then go to a console, find the switch and press the configure button, or find it in PC Access on the status page and click configure. It takes about 45 seconds then do the next one.

Once all the switches have been configured, then I would use upstart to scan/learn the UPB network. Once it has read everything in you can just click on the units that need tweeking and change them to non-dimming or turn of the LED, or whatever. But this is MUCH easier than setting up everything by hand.

You might want to check out the HAI knowledge base there is a lot of useful information available that will help you get the most out of your HAI controller.
 
FYI: I personally don't think I have ever actually bought a non-dimming switch, other than relay switches. I do as you did and just set the switch to non dimming. The other common change I do is to turn off the LED for the switches in the bedrooms...

This is VERY a common situation and the recommended way of handling it is to set the switch up using the controller as HLC, then go into upstart and change the one setting to non-dimmable... Doing it this way all of the status reporting/tracking is set up properly, and it is MUCH easier than doing it the other way around.

HLC was designed to make configuring your devices pretty much fool proof. It is an entire schema that allocates links for rooms and scenes and full status tracking. It provides for the ability to differentiate between a light coming on because of programming or a button press, or a link. Finally it is EASY!

In all fairness HLC doesn't work for everyone and sometimes manual configuration is necessary. But unless you have more than 31 rooms in your house, or more than 7 individual loads in a room HLC will probably work for you.

First, in PC Access define your rooms on the 8's:

Unit 1: Living Room
Unit 9: Kitchen
Unit 17: Foyer

Then go back and add in the loads in each room:

1: Living Room
2: light
3: fan
4: corner
5: table
9: Kitchen
10: light
11: fan
12: sink
13: cabinet left
14: cabinet right
15: pantry
17: Foyer
18: light
19: table

Then write the configuration to the controller. Now go to each switch, tap it on 5 times to put it in to the setup mode. Then go to a console, find the switch and press the configure button, or find it in PC Access on the status page and click configure. It takes about 45 seconds then do the next one.

Once all the switches have been configured, then I would use upstart to scan/learn the UPB network. Once it has read everything in you can just click on the units that need tweeking and change them to non-dimming or turn of the LED, or whatever. But this is MUCH easier than setting up everything by hand.

You might want to check out the HAI knowledge base there is a lot of useful information available that will help you get the most out of your HAI controller.


Thanks for the assistance, I will reprogram the switches per your suggestion as it makes more sense! Will post back when done with the results!
 
Ok I programed the switches with HAI, I see them their status update in PC access "on,off". I fired up upstart and it mapped the switch network, the problem I am seeing is that upstart did not use the names that I assigned to the switches via Omnipro, Simply gives them the name unit 1, unit 2 etc...

So if I make changes in upstart "led color" and then I upload the changes via upstart. Wouldn't it also over write the name of the switches to unit 1, instead of saying breakfast nook? Or do I need to manually write down all the names that I used in PC Access and then over write all the names that upstart assigned to the switches?

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
20 minutes later.


I fixed the names in upstart and things still seem to be working fine with Omnipro, it is still detecting when the load is on or off!!! I will let you all tonight if the code works :)
 
After you re-programmed the switch from the controller, did you tell Upstart to re-read the configuration from the switch? If not, that would explain why Upstart didn't get the name. The controller doesn't really care what the switch is named (I don't think), but if Upstart overwrote the received links table, that may cause you problems later if you try to control that switch with a scene switch.
 
After you re-programmed the switch from the controller, did you tell Upstart to re-read the configuration from the switch? If not, that would explain why Upstart didn't get the name. The controller doesn't really care what the switch is named (I don't think), but if Upstart overwrote the received links table, that may cause you problems later if you try to control that switch with a scene switch.


Yeap, I told upstart to read from the switch and it got the right info maybe from three out of 22 switches. By the way, even after programing the switches, neither of the original codes posted work the way I want them to, the switches do report correctly when they are on or off. I am about to try cornutt suggestion.
 
Back
Top