Premise Premise newbie seeking answers

Motorola Premise

dinki

Member
Hey guys. I'm currently a Homeseer user and am mostly pleased with it, but as the persistent tinkerer, I'm giving Premise a spin. I've set up my X10 devices and am able to control them via the web application. Here's a list of things I do with Homeseer that I'd like to try and accomplish with Premise:

1) On weekdays, if someone enters the living room between 6:00am and 6:45am, the living room lights come on. Otherwise, the living room lights come on at 6:45am and go off at 7:30am.

2) On pressing a button on an X10 keychain remote, all lights in the living room come on. On pressing the off button, two lamps go off while the other stays on for 20 seconds to give me enough time to make it to the bedroom before the living room is totally dark.

3) Fifteen minutes before sunset, my daughter's lamp turns on 70% brightness and stays on until 30 minutes after sunrise.

4) On pressing a button on my IR remote, my HTPC (separate from the Homeseer server) accepts the command and connects to the HS server and runs the event mentioned above that turns on all LR lights. Another button on the IR remote runs the turn off LR lights mentioned above.

Can someone point me in the right direction for accomplishing the above tasks? I'm in no means asking for a step-by-step but more so what I need to do to accomplish these tasks (do I need to set up a scene, a script, macro, etc?) Is it possible to use an automated method to get the webserver to do what I am doing with HS?

A couple of other questions:

1) Is there a power failure recovery option that will issue commands after power is restored? Example: Power goes out at 6:30am and then comes back on at 6:50am. Will Premise know it missed sending the 6:45am all lights on in living room command?

2) Does an Instant Messenger 'bot' exist that can send status messages and receive commands via MSN, ICQ, AIM, etc? I'm wanting to incorporate the existing security wiring we have in the house with a Weeder digital IO board and would like to be alerted via IM while at work.

Any information is greatly appreciated. Thanks!
 
dinki,

Welcome to the Premise forum!

Please be aware that, in contrast to Homeseer, Premise is a discontinued product and completely user-supported. Premise has its strengths but if you've already invested in Homeseer I'm not sure there's a compelling reason to switch away from it. Assuming you're still interested, let's answer some of your questions.

1) On weekdays, if someone enters the living room between 6:00am and 6:45am, the living room lights come on. Otherwise, the living room lights come on at 6:45am and go off at 7:30am.
Two parts: a Script triggered by the Living Room motion sensor and a Scheduled Scene.
  • The script checks the current time, and day-of-week, and activates the lighting accordingly.
  • The Scheduled Scene controls the lights according to the desired times.
2) On pressing a button on an X10 keychain remote, all lights in the living room come on. On pressing the off button, two lamps go off while the other stays on for 20 seconds to give me enough time to make it to the bedroom before the living room is totally dark.
Two scripts activated by the button presses; one for the On button and another for the Off Button. The big problem here is that you probably currently use a W800RF32 to receive wireless commands and Premise does not have a driver for it (only MR26A).

3) Fifteen minutes before sunset, my daughter's lamp turns on 70% brightness and stays on until 30 minutes after sunrise.
A Scheduled Scene or even a Logic Diagram will do the trick.

4) On pressing a button on my IR remote, my HTPC (separate from the Homeseer server) accepts the command and connects to the HS server and runs the event mentioned above that turns on all LR lights. Another button on the IR remote runs the turn off LR lights mentioned above.
At least three ways to tackle this problem:
  1. You can run an IR receiver (from wherever your HTPC is located) back to the Premise server and control it directly. There's a module that let's you use any IR remote to execute scripts.
  2. You could have the HTPC call a a URL in response to a received IR command. The URL would point to the Premise server and trigger a script. This is a little tricky to implement because it is not a 'standard feature' within Premise.
  3. You can write a .NET application that runs on the HTPC and communicates directly with the Premise Server.
1) Is there a power failure recovery option that will issue commands after power is restored? Example: Power goes out at 6:30am and then comes back on at 6:50am. Will Premise know it missed sending the 6:45am all lights on in living room command?
Not to my knowledge. Assuming we're talking about X10, I think Premise may refrain from transmitting the X10 command because it'll notice that the CM11A has lost connection. But you'd have to put in logic to handle 'missed events' once power is restored.

2) Does an Instant Messenger 'bot' exist that can send status messages and receive commands via MSN, ICQ, AIM, etc? I'm wanting to incorporate the existing security wiring we have in the house with a Weeder digital IO board and would like to be alerted via IM while at work.
A .NET application was created several years ago that allowed for bi-directional communications via MSN Messenger. Unfortunately, it no longer works because MSN changed the communications protocol. The source-code is available but it is a bear to decipher.
 
Hey guys. I'm currently a Homeseer user and am mostly pleased with it, but as the persistent tinkerer, I'm giving Premise a spin. I've set up my X10 devices and am able to control them via the web application. Here's a list of things I do with Homeseer that I'd like to try and accomplish with Premise:

Welcome!I'm sure others will chime in w/ answers to your questions

1) On weekdays, if someone enters the living room between 6:00am and 6:45am, the living room lights come on. Otherwise, the living room lights come on at 6:45am and go off at 7:30am. With an occupancy detector and using the scheduler, this is quite easy

2) On pressing a button on an X10 keychain remote, all lights in the living room come on. On pressing the off button, two lamps go off while the other stays on for 20 seconds to give me enough time to make it to the bedroom before the living room is totally dark. Can be scripted to do this or perhaps thru the use of Logic Diagrams
3) Fifteen minutes before sunset, my daughter's lamp turns on 70% brightness and stays on until 30 minutes after sunrise. Yup. Either script or thru the drag and drop scheduling interface
4) On pressing a button on my IR remote, my HTPC (separate from the Homeseer server) accepts the command and connects to the HS server and runs the event mentioned above that turns on all LR lights. Another button on the IR remote runs the turn off LR lights mentioned above.

Can someone point me in the right direction for accomplishing the above tasks? I'm in no means asking for a step-by-step but more so what I need to do to accomplish these tasks (do I need to set up a scene, a script, macro, etc?) Is it possible to use an automated method to get the webserver to do what I am doing with HS? Premise is a very full featured HA solution, well ahead of its time (and prob still ahead of its time even now), so the answer is yes. It has a number of built-in features, which 123 has documented well within these forums....

A couple of other questions:

1) Is there a power failure recovery option that will issue commands after power is restored? Example: Power goes out at 6:30am and then comes back on at 6:50am. Will Premise know it missed sending the 6:45am all lights on in living room command? I'll have to check this, but I believe the answer is yes. Premise has a built-in failure recovery option that reloads an slserver.xdo on startup. As Premise runs as a service, it can be set to restart whenever the server is rebooted (such as after a power failure). Given the Premise ability to preserve state and look at events within its state, I believe the answer to be true. For instance, if you have a light that is on at sunset 'true' and off at sunrise 'false', if the Premise server is taken down by a power outage, its state is preserved so that when it fires back up, the state of the light will still be 'false' and if its past sunset, will set the light to 'true'.

2) Does an Instant Messenger 'bot' exist that can send status messages and receive commands via MSN, ICQ, AIM, etc? I'm wanting to incorporate the existing security wiring we have in the house with a Weeder digital IO board and would like to be alerted via IM while at work. There was an MSN IM module, not sure what happend to it; Premise does sport an email server and can be used to send email
Any information is greatly appreciated. Thanks!
 
Thanks for the help guys. I've regained almost all the functionality I have with Homeseer using Premise. I've even added some additional 'features' that I was having trouble doing in HS. I've used the logic ObjectDiagrams to accomplish some pretty cool conditional things.

I am still learning and would like a little more information on:

[*]You could have the HTPC call a a URL in response to a received IR command. The URL would point to the Premise server and trigger a script. This is a little tricky to implement because it is not a 'standard feature' within Premise.
I'm assuming that if I hit a certain webpage then I can get it to set the state of an object. In particular, I have my X10 remote button 'ButtonWithTrigger' that I would like to be able to change the logic to true or false depending on what I want to do. Right now if I push the ON on the remote, 'ButtonWithTrigger' becomes true; if I push the OFF on the remote 'ButtonWithTrigger' becomes false. I'd like to replicate that through the webserver. Is that possible?


With an occupancy detector and using the scheduler, this is quite easy

Any chance on telling me how to access the occupancy detector? I have the module loaded and it does show an Occupancy Trigger with valid triggered information but I don't know how to do what you mentioned above. In fact, I'm unable to find anything having to do with using the occupancy information for triggering in any place I've been dwelling in (scheduler tasks, ObjectDiagrams, etc). Can you give me a little push?

Thanks again for the help. I've used your suggestions along with the information in the videos.
 
Turning devices on/off via a URL is something that has eluded me using the default AutomationBrowser. Premise uses a Javascript function to invoke an object's method (i.e. set the state of a light object). On the other hand, the Xbrowser module does provide the means of using an URL to get the job done ... but it is ugly because the URL must contains the object's GUID and not its name. When I have more time, I'll try to explain how to do this in greater detail.


I think Chuck meant an occupancy/motion sensor and not the Occupancy Module. You can write an OnChange property script for the Living Room's occupancy/motion sensor that turns on the light but only if triggered between 6:00 and 6:45 AM. Check the online help for "times.systime".
 
neat. another new person :icon_pai: Welcome to the site. I just started using premise two months ago and love it. Eventhough I never used a home automation program before, I have always been impressed with premise. Chuck and 123 have helped me a lot by answering my questions. If it wasn't for this forum, learning premise would have been very difficult for me.
 
dinki,

Here's a quick and dirty way to get the URL of an object's method.

MiniBrowser is a module that let's Premise display a "low-tech" user-interface for phones, web-enabled PDA's and other devices. It uses pure HTML without frames, JavaScript, Java, ActiveX objects or any other doo-dads that could trip up a simple browser. In theory, it should work on any web-enabled device built in the last ten years. If you've installed the AutomationBrowser module then you already have MiniBrowser installed (MiniBrowser is considered part of AutomationBrowser).

MiniBrowser's shortcoming is its inability to render all Home objects. For example, it can't display Keypad, SecuritySystem, or Appliance objects. However, it can be enhanced; I posted an enhancement to add support for Appliances in another thread. Let's assume it renders what you need ...

Assuming you are using a browser on your Premise Server and it is configured to use port 80, you can display the MiniBrowser user-interface using this URL: http://localhost/ppc ("PPC" means pocket-PC).

If you click a Light object, you'll see a Power button, an Up Arrow button, a Down Arrow button, and a Percentage value (indicating the brightness level). Each button activates methods belonging to the Light object. If you had the URL for the Power button, you could invoke it from another program and effectively toggle the light's power-state. So how do we get the button's URL?

In IE, simply right-click the button, select Copy Shortcut, and then paste the URL into a text-editor. Here's the URL for a Light object's Power button on my test PC:
http://localhost:86/sys/%7B80CEDFDA-8E47-473A-A066-21D3F4F4FF36%7D?d??mbTogglePower(IDA74A397E4E4E414EB53A904A095E9B1C)
Not exactly, human-readable but it means trigger the "mbTogglePower" method of the object whose ID is "7B80CEDFDA-8E47-473A-A066-21D3F4F4FF36" ... which happens to be a Light. I've never figured out the purpose of the ID passed to the method other than it is unique and does not represent an existing object.

Paste the URL into your browser, press the ENTER key, and you'll toggle the light's power state. An external program could use this URL to accomplish the same thing.

Here's the URL of the Down Arrow button. Note that it triggers the "mbDimDown" method.
http://localhost:86/sys/%7B80CEDFDA-8E47-473A-A066-21D3F4F4FF36%7D?d??mbDimDown(ID1753E9753C7841ED928535C7CB9235DF)

Hope this helps.

PS
Calling the URL will trigger the method and display the associated web-page. This shouldn't present too much of a problem for an external program because it can simply ignore or discard the HTML code returned by MiniBrowser.
 

Attachments

  • How_To_Get_The_URL.png
    How_To_Get_The_URL.png
    58 KB · Views: 17
Thanks! This is close to perfect. I say close to perfect as it would be really cool if I could say ON or OFF, but this will definitely work. Another thing off the bunch list. Woohoo! :huh:
 
Anyone know if the Intro to Scripting video exists anywhere? I've watched a handful of the videos and would really like to see the scripting one.
 
1) On weekdays, if someone enters the living room between 6:00am and 6:45am, the living room lights come on. Otherwise, the living room lights come on at 6:45am and go off at 7:30am.

I've got this working using the following script triggered by my living room motion detector OnChangeMotionDetected:

Code:
'Checks to see if it is between 6am and 7am and
'Table lamp is not on and
'current day is a weekday
If times.sysHour >= 6 and times.sysHour < 7 And _
	Home.House.LivingRoom.TableLamp.PowerState = False And _
	times.sysDayOfWeek > 0 and times.sysDayOfWeek < 7  And _
	Schema.Modules.Default.Variables.hasRunMorning = False Then
		Home.House.LivingRoom.TableLamp.PowerState = True
		Home.House.LivingRoom.FloorLamp.PowerState = True
		Schema.Modules.Default.Variables.hasRunMorning = True
end if

I had to add a variable 'hasRunMorning' to keep track of if the script has already been run. I use the Schedule to reset this value to False later in the day so that it is ready to run the next morning. Is there a way I can accomplish this within the script rather than having to go the long way around like I'm doing now? I'm doing this so that if I send a command to turn the lights off it will not turn the lights immediately back on when it senses motion in the living room. I'd like this to fire only once. Also, I am using a similar set of conditions for the evening which turns the lights on.

As you can see, I am checking the time for between 6:00am and 7:00am. Is there an easy way to check if it is between 6:00am and 6:45am?

On a different subject, can I add a lights on function/command and a lights off function/command to the Minibrowser so that I don't have to depend on the toggle on/off working like I would expect it?

Finally, is there an easy way to log when devices come on and off, motion detected, etc? I'd like to doublecheck on the way things are going.

By the way, I've been running Premise for two weeks and have it doing more than I had Homeseer doing. I love it and can see that once I wrap my head around everything a bit more that I'll really be able to make it sing. Thanks for all the help guys!
 
I had to add a variable 'hasRunMorning' to keep track of if the script has already been run. ... I'm doing this so that if I send a command to turn the lights off it will not turn the lights immediately back on when it senses motion in the living room. I'd like this to fire only once.
That's a highly specialized case so you'll need to use a flag to keep track of it (like you've done).

Is there an easy way to check if it is between 6:00am and 6:45am?
Try this:
Code:
if times.sysDayOfWeek > 0 and times.sysDayOfWeek < 7  then ' Weekday
	if (time > #06:00#) and (time < #06:45#) then ' Morning Period
		if Schema.Modules.Default.Variables.hasRunMorning = False then
			Schema.Modules.Default.Variables.hasRunMorning = true
			with Home.House.LivingRoom
				.TableLamp.PowerState = True
				.FloorLamp.PowerState = True
			end with
		end if
	elseif (time > #18:00#) and (time < #18:45#) then ' Evening Period
		if  Schema.Modules.Default.Variables.hasRunEvening = False then
			Schema.Modules.Default.Variables.hasRunEvening = true
			with Home.House.LivingRoom
				.TableLamp.PowerState = True
				.FloorLamp.PowerState = True
			end with 
		end if
	end if
end if

... can I add a lights on function/command and a lights off function/command to the Minibrowser so that I don't have to depend on the toggle on/off ...
Yes; I did this as a test. I'll post the technique at a later date.

... is there an easy way to log when devices come on and off, motion detected, etc?....
You can try the Logging Module posted in the Downloads section or wait until I release my LogMaster module. LogMaster records the activity of several types of Home objects (i.e. Lights, Door Sensors, Temperature Sensors, etc) into an Access MDB file. You can use Access or Excel to analyze the data. Logmaster can be extended to support other objects (like Coffeemakers, Fountains, etc). You can also disable logging on a per object basis (i.e. log the Living Room FloorLamp but not the TableLamp).
 
Back
Top