PowerHome Tidbits

TonyNo

Active Member
While playing around porting e's GasBuddy script to PowerHome, I discovered some interesting things about HomeSeer...

People that use HS put variable data into device strings.

This is so that the info can be observed in the main web page without extra coding, and because device strings are not lost when HS is exited.

PH has a link to Global Variables in its standard web page, so this is not necessary. Also, PH's global variables are stored in a database, so they are persistant between sessions.
 
Just to be clear, I didn't intend to create a thread of why it's better. I would, however, consider those items to be better. :blink: I just wanted to point out a couple things that I discovered, found interesting, and thought others may also; I always wondered about putting data into device strings.

I evaluated the different packages a long time ago and don't recall much. :blink:

I guess the porting and posting of some other scripts would be good exercise for me and allow people to better see how PH works and what it offers.

Maybe one of the things is the macro language. I see lots of scripts for HS, but no macros that I can recall. All of my PH stuff is done in macros.
 
I just thought of another one: Multi-X. I remember e lamenting the fact that it was not supported directly in HS when I told him about it.

Multi-X control allows a sequence of X-10 commands for control (access 256 macros from your palm pad by pressing 2 buttons, 64 macros from your keychain remote by pressing 3 buttons.)

The Multi-X function returns a string with codes for the last n commands from the house code defined as Multi-X. There is also a Multi-X timeout that you can set.

For example, I have two Hawkeyes near a doorway which I use as an entry/exit sensor (occupancy). When 1 then 3 fires, that means someone went in. When they fire in the opposite order, that means someone has left.

The logic for this is handled like so...

There are two triggers set up to call this macro (F ANY ON and F ANY OFF).

Code:
COMMENT Read last two Multi-X commands
GOTO LABEL ph_multix ( "F", 1, 2 )

LABEL F0102F0302
COMMENT We get here if #1 turned on then #3 turned on: In
SET GLOBAL VARIABLE Occu Occu+1
GOTO LABEL Out

LABEL F0302F0102
COMMENT We get here if #3 turned on then #1 turned on: Out
SET GLOBAL VARIABLE Occu Occu-1
SET GLOBAL VARIABLE Occu if(Occu<0), 0, Occu)
GOTO LABEL Out

LABEL Out
 
I was under the impression you could do this without any scripting (that's how you made it sound). I currently do the same thing with HS, it's just that I had to write a few lines of code (VBscript), that's all :blink:
 
I was under the impression you could do this without any scripting
Well, there needs to be logic or else nothing would happen. :blink: Are you saying that HS has something besides macros and scripts for conditionals?
 
Are you saying that HS has something besides macros and scripts for conditionals?

HS has an interface that allows you to point and click to generate conditions. I am not sure if it is capable of doing Multi-X but you can use short condtion statements in certain fields of the interface eliminating the need for extra vb files.

I am not so sure how multi-x really works but it sounds like the x10 interface waits for multiple inputs and then concatenates them and interprets them as a a unique ID. Is that what you are describing?
 
Ah, ok. That makes sense now. Kind of like a wizard that walks you through it.

I think you nailed Multi-X. There is a timeout that is used for the concatenation; anything within that time is added on. The function returns a string with as many of codes as you want to check.
 
Back
Top