Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Programming help! Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
rtt3821
Newbie
Newbie
Avatar

Joined: September 07 2009
Location: United States
Online Status: Offline
Posts: 6
Posted: September 07 2009 at 20:02 | IP Logged Quote rtt3821

I'm trying the trial version and am a real dummy when it comes to C#. I want to turn ON a motor at 0900 and OFF at 1700 between November 1st and April 30th. I cannot seem to get the formula right. Can anyone help?
Back to Top View rtt3821's Profile Search for other posts by rtt3821
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: September 07 2009 at 20:30 | IP Logged Quote TonyNo

Welcome aboard!

What technology are you using, i.e. UPB, Insteon?

...and you don't need to know C#.

Edited by TonyNo - September 07 2009 at 20:31
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
rtt3821
Newbie
Newbie
Avatar

Joined: September 07 2009
Location: United States
Online Status: Offline
Posts: 6
Posted: September 08 2009 at 12:14 | IP Logged Quote rtt3821

I'm using Insteon.
Back to Top View rtt3821's Profile Search for other posts by rtt3821
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: September 08 2009 at 13:44 | IP Logged Quote grif091

You can create a PowerHome Timed Event using the Powerhome Explorer. Have it fire on a daily basis starting Nov 1, 2009 09:00. Use a Type of Raw Formula, the ID field would contain ph_macro("YOURMACRONAME"), and the following formula in the Boolean field...

if((month(today()) >= 11 and month(today()) <= 12) or (month(today()) >= 1 and month(today()) <= 4), 1 , 0)

EDIT: a case statement is less involved than if ...

case( month(today()) WHEN 11,12,1,2,3,4 THEN 1 ELSE 0 )

The Timed Event will invoke the macro only if the month is Nov, Dec, Jan, Feb, Mar or April. The macro will have the Insteon command(s) to control whatever you want to accomplish at 9:00 AM.   Code a second Timed Event that fires on a daily bases starting Nov 1, 2009 17:00, invoking the same or different macro to accomplish what you want to do at 17:00. You can code logic in the macro to determine time of day so that you do On versus Off logic or code two different macros, one for On logic and one for Off logic.

There are many ways to implement something in Powerhome. This is only one of many approaches.     
.     

Edited by grif091 - September 08 2009 at 19:59


__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 
rtt3821
Newbie
Newbie
Avatar

Joined: September 07 2009
Location: United States
Online Status: Offline
Posts: 6
Posted: September 08 2009 at 14:35 | IP Logged Quote rtt3821

Thanks grif091. I will give it a go! Sure appreciate the help.
Back to Top View rtt3821's Profile Search for other posts by rtt3821
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum