Author |
|
funbobbybaby69 Groupie
Joined: April 01 2008
Online Status: Offline Posts: 88
|
Posted: February 16 2009 at 11:06 | IP Logged
|
|
|
What would the easiest way to turn a 2476S into a timer for a bathroom fan.
I think using a Trigger, right? How would i set it to turn off after 30 mins?
The manual says "action style" and put it in the queued? but i cant see that list in the newest version...
Thanks
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: February 16 2009 at 12:11 | IP Logged
|
|
|
Define a Trigger that fires from Trigger Type Insteon Group In, Trigger ID Number 1, Trigger Value On, Action Type Macro. The Trigger invokes a Macro that does a Wait for 30 minutes, then turns the SwitchLinc off. With PH there are always multiple ways of doing things. You could create a Timed Event in the Macro that turns the SwitchLinc off 30 minutes later.
__________________ Lee G
|
Back to Top |
|
|
funbobbybaby69 Groupie
Joined: April 01 2008
Online Status: Offline Posts: 88
|
Posted: February 16 2009 at 12:30 | IP Logged
|
|
|
Thanks Lee, Im trying your first way.
I have created a macro (called fan off) command = insteon, ID = bathroom fan, Value = Off.
I created a trigger "action type"= macro, "action"= fan off, "trigger type" = Insteon Group in, "Trigger ID number" = any (not sure about this number) and "trigger value" = on
I still dont see where i put in the 30 mins?
Sorry, and thanks!
Rob
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: February 16 2009 at 12:49 | IP Logged
|
|
|
In the Macro definition, Insert a new row and select the Wait command from the Command column pulldown. The wait value is in seconds. Set the Seq number of the new row to a value before the Insteon command row. PH will resequence the rows and reassign Seq numbers when you Save the Macro. The Macro will wait for the duration of the Wait command before issuing the Insteon command in the next row. I would suggest testing with say 30 seconds, then change to 30 minutes (1800 seconds) when you know the Macro is working as you want. Also be sure you have linked the SwitchLinc as a Controller to your PLC/PLM controller as a Responder. Although the SwitchLinc will control the local load (fan) without any link, it will not send a Group message sequence unless the device is linked as a Controller.
EDIT: the "any" value will work. It is the Group number and the SwitchLinc has a single Group, 1.
Edited by grif091 - February 16 2009 at 12:51
__________________ Lee G
|
Back to Top |
|
|
funbobbybaby69 Groupie
Joined: April 01 2008
Online Status: Offline Posts: 88
|
Posted: February 16 2009 at 12:54 | IP Logged
|
|
|
as soon as you hit save it automatically sets the Seq number to 10 and 20.
o, and why do you need to use an insteon group command?
Edited by funbobbybaby69 - February 16 2009 at 12:56
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: February 16 2009 at 13:10 | IP Logged
|
|
|
You could also create a trigger except change MACRO to Raw Formula and stick this in the Action then change “your light”.
ph_createtimedevent1("LIGHTOFF",1,0,0,1,30,DATETIME(TODAY(), NOW()),0," ph_insteon(“your light”,ioff,0)”,"1")
This would not involve a Wait.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: February 16 2009 at 13:22 | IP Logged
|
|
|
If you’re asking why the Trigger is using Insteon Group In, because the SwitchLinc is sending a Group message sequence when the paddle is pressed (assuming the SwitchLinc is linked, otherwise no message is sent). All Insteon devices when functioning as a Controller (I'm sure someone will have some example of where that statement is wrong) send Group messages when turned On/Off. If you link the SwitchLinc to a LampLinc, for example, the SwitchLinc sends a Group message sequence to the LampLinc to turn On/Off.
As Pete just posted, that is an example of creating a Timed Event within the Trigger itself, eliminating the Macro altogether. Thanks Pete.
EDIT: the forumla defines a Timed Event that runs 30 minutes after defined, turning off the SwitchLinc.
Edited by grif091 - February 16 2009 at 13:26
__________________ Lee G
|
Back to Top |
|
|
funbobbybaby69 Groupie
Joined: April 01 2008
Online Status: Offline Posts: 88
|
Posted: February 16 2009 at 13:23 | IP Logged
|
|
|
Sorry, i tried this but when i verify it i get "!"
Do i change both the "LIGHTOFF" and the "your light" or just one and do i leave the quotes?
Sorry, still learning....
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: February 16 2009 at 13:30 | IP Logged
|
|
|
"LIGHTOFF" is the name of the Timed Event, can be whatever you want. "your light" is the ID of your SwitchLinc. If you want to know where quotes are needed, check the help section for each command. If it is a String parameter, then you need quotes. I believe both are String parameters.
__________________ Lee G
|
Back to Top |
|
|
funbobbybaby69 Groupie
Joined: April 01 2008
Online Status: Offline Posts: 88
|
Posted: February 16 2009 at 13:37 | IP Logged
|
|
|
feel free to say... "good luck" to me... but that formula (when i cut and paste) and changed the two names... i still get the "!" error when i check it....
Edited by funbobbybaby69 - February 16 2009 at 13:42
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: February 16 2009 at 13:55 | IP Logged
|
|
|
When you have a complex formula that will not verify, break it down into its individual pieces, verifying each piece until you find the part that is wrong. In this case the quotes around "your light" look like they were typed under some spell check tool or perhaps Word which uses a quote not recognized by PH. Retype all the quote marks while under PH.
EDIT: also anytime a quoted string appears inside a quoted string, as is the case of the ph_insteon command, the inside quoted string is done with single quotes.
"xxxx 'yyyy' xxxx"
"ph_insteon('your light',ioff,0)"
EDIT2: the following verifies on my system
ph_createtimedevent1("MyTimedEvent",1,0,0, 1,30,DATETIME(TODA Y(), NOW()),0,"ph_insteon('ICON SWITCH TEST',ioff,0)","1")
Don't know if it works but it does verify. Watch out for added blanks. The post keeps adding a blank inthe word TODAY
EDIT3: also note when you get it to verify once it will not verify the second time because a Timed Event was created the first time under the name specified and a second verify will fail trying to create the same named Timed Event.
Edited by grif091 - February 16 2009 at 14:13
__________________ Lee G
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: February 16 2009 at 14:33 | IP Logged
|
|
|
I would suggest that the name of the device does not match… When you get further into it I’ll show you how to cancel the timed event in the event you want to recreate it.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: February 16 2009 at 14:57 | IP Logged
|
|
|
Rob, what is the name (ID) of your switch?
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
funbobbybaby69 Groupie
Joined: April 01 2008
Online Status: Offline Posts: 88
|
Posted: February 16 2009 at 20:41 | IP Logged
|
|
|
hey, my light switch is called "Main Bathroom Fan" and my trigger is called "fan".
This is weird... Lee, I tried to copy and paste your line that worked and i change the two names and i still get the "!" when i verify it... hmm. i am sofa king we tarded...
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: February 16 2009 at 21:01 | IP Logged
|
|
|
The problem is with ph_insteon. Since 24 Is about to start I’m gone.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: February 16 2009 at 21:13 | IP Logged
|
|
|
Did you take the space out of the word TODA Y. I just did a copy from my last post with the "working" example, did a paste into a trigger and did a verify. After removing the blank from TODA Y it verifies here and does schedule a Timed Event. Of course the ph_insteon command has my device ID. When I bring up PowerHome Status it shows the Timed Event MyTimedEvent as scheduled. I'm running 2.1b. Perhaps you should go back to the Trigger/Macro option.
__________________ Lee G
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: February 16 2009 at 23:13 | IP Logged
|
|
|
Lee, you hit the nail on the head. I suspected that was problem. Rob use underscore as blanks ph_insteon("Main_Bathroom_Fan" ,ioff,0)
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: February 17 2009 at 10:20 | IP Logged
|
|
|
There was another problem with this construct even though it did verify. The parameter before the "ph_insteon" parameter had a value of 0. This indicates the Timed Event action is a macro, not a formula. That value should be a 2 to execute the "ph_insteon" formula. Although I changed the time interval to 1 minute from 30 minutes for test purposes, The Trigger fires from the "ICON SWITCH TEST" device turning On, creates a Timed Event that runs 1 minute later which turns the same device off. This works on my system.
ph_createtimedevent1("fan",1,0,0, 1,1,DATETIME(TODAY(), NOW()),2,"ph_insteon('ICON SWITCH TEST',ioff,0)","1")
__________________ Lee G
|
Back to Top |
|
|
BeachBum Super User
Joined: April 11 2007 Location: United States
Online Status: Offline Posts: 1880
|
Posted: February 17 2009 at 10:58 | IP Logged
|
|
|
I almost had it correct. Good job. Now I find sometimes I want to extend the time after being there awhile. What I do is kill the waiting Timed Event and create a new one. Here is an example of the kill:
PH_DIRECTSQL("DELETE FROM TIMEDEVENTS WHERE FREQUENCY = 0 AND ACTION = 'fan")
You could also edit the existing Event but I find that more complicated.
__________________ Pete - X10 Oldie
|
Back to Top |
|
|
funbobbybaby69 Groupie
Joined: April 01 2008
Online Status: Offline Posts: 88
|
Posted: February 18 2009 at 06:37 | IP Logged
|
|
|
Getting closer... now when i turn the fan on, it turns off right a way... now just have to work on the timming...
yes i did remove the space in Today, and no i didn't use underscores for spaces. I still get the "!" when i verify it.
|
Back to Top |
|
|