Author |
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: April 06 2007 at 15:41 | IP Logged
|
|
|
Detecting PH device changes from a external application.
'---------------------------------
If there is a good way to do this then someone tell me... (aaaahhh CAT FIGHT!!! with REAL cats! Yep, outside my window as I write this) OK, back to the issue.
Anyway...
If I have my way. I suggest a UDP broadcast. That way anybody listing will know about it. A simple PH message structure might be:
UNIQUE_MSG_ID:MSG:PARAMS
Just a thought...
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: April 11 2007 at 21:31 | IP Logged
|
|
|
Steve,
Ive been churning on this idea for a little while myself and had ultimately come to the same conclusion as you...a UDP broadcast.
The thing Im trying to decide upon is using a single port for ALL PowerHome broadcast messages (Control Center change, device status change, trigger firing, table change, etc.) or using multiple ports for each type of broadcast message so that an app doesnt have to weed out the messages it's not interested in.
Would like to hear from you and any other developers/interested parties on what approach they think would be best. Right now Im leaning towards multiple ports.
Thanks,
Dave.
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: April 11 2007 at 21:51 | IP Logged
|
|
|
Hey Dave.
I think the multi ports is the way to go if you do have allot of different categories of messages you want to send. Although a single port would work.
I have done allot of commercial UDP work in the past and if I can make a suggestion. Prefix all UDP messages with a unique ID and broadcast them 3 or 4 times with a slight delay. The reason being. On a busy network you will loose around 50% of your messages. (UDP is not guaranteed to arrive) The unique message id is for the receiving application. That way it can tell if it has already received the message.
--Steve
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
eHomeCreations Groupie
Joined: February 02 2007 Location: Ukraine
Online Status: Offline Posts: 64
|
Posted: April 28 2007 at 13:15 | IP Logged
|
|
|
Hey Dave.
Getting any other feedback about this?
I am getting to a point in my eHome dev work that I have almost finished my importing of devices, global vars and macros from PH and also sending commands to PH. My touch screen interface is about 75% done.
Just wondering if you have a time line on this at all.
Thanks.
__________________ --Steve http://www. ehomecreations.com
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: April 29 2007 at 23:06 | IP Logged
|
|
|
Steve,
Heh, didnt get any other feedback so went ahead and implemented your suggestions.j
The next version of PowerHome will have a UDP broadcast server. So far Im broadcasting 4 different types of PowerHome events. It should cover pretty much everything.
The first UDP broadcast is for PowerHome Control type messages. This includes startup, shutdown, reinitialize, timed event start/stop, etc.
The second UDP broadcast is all triggers. Anywhere a trigger would be checked (whether or not a trigger actually exists), a UDP broadcast is made with the same information that would be used for a trigger check. Device changes, global variable changes, IR, etc. will all be broadcast.
The Third UDP broadcast are Device Status changes. This will be strictly for devices that show on the Device Status screen and will contain only devices that have changed.
The Fourth UDP broadcast will be Control Center changes. Anytime the Control Center changes from any of the ph_setccobj functions, the resulting data will be broadcast.
The upcoming remote CC/Device Status client will utilize these broadcasts.
Per your suggestion, the broadcasts will all have a unique ID and will be sent 3 times.
Im hoping to have this release out in 2 or 3 weeks.
Hope this helps,
Dave.
|
Back to Top |
|
|
TonyNo Moderator Group
Joined: December 05 2001 Location: United States
Online Status: Offline Posts: 2889
|
Posted: April 30 2007 at 07:35 | IP Logged
|
|
|
Is there a way to do something like this for plugins?
|
Back to Top |
|
|
cmhardwick Senior Member
Joined: July 08 2006 Location: United States
Online Status: Offline Posts: 290
|
Posted: April 30 2007 at 09:59 | IP Logged
|
|
|
Or can we just have the format of the messages to use (capture) in other apps?
__________________ Cicero, Enjoying automation!
|
Back to Top |
|
|