Premise [download] syslight.zip

Motorola Premise

jimspr

Member
index.php
File Name: syslight.zip
File Submitter: JimSpr
File Submitted: 1 Jul 2009
File Category: Premise
Author: Jim Springfield
Contact: [email protected]
Version: 0.1

Initial implementation of SysLight UI using Silverlight.

Install:
Put syslight.xap and syslight.html into c:program filespremisesysweb
Put syslight.xdo into c:program filespremisesysschemamodules

Using SYS Builder, load the syslight module.

Open a web page such as [URL="http://mysysserver/syslight.html"]http://mysysserver/syslight.html[/URL]

Click here to download this file
 
Works great in Firefox 3.0.11. Unfortunately my iPhone doesn't support Silverlight yet ;)

Will this be themeable?
 
SysLight looks great and works well on my test PC. It has the makings of an excellent substitute for the Automation Browser. Here are my observations:

  • Pollling
    Given that it doesn't use the SYSConnector, it cannot provide real-time status of Home objects. Therefore some sort of user-defined polling will be needed to periodically refresh the display.
  • Themes
    I agree with Sam that theming would be a valuable feature. I believe the impetus to adopt Silverlight is to allow for easier customization. I assume all of the magic is currently locked up in the XAP file.
  • Hidden Objects
    The current version of SysLight mimics one of AutomationBrowser's oversights, namely it doesn't correctly handle hidden Locations and Home objects. I reported this error, and the correction, in this post. I use a hidden Location to prevent certain objects from being rendered by AutomationBrowser. Here's the modified version of GetContents that handles the case where the object's Navigation property is set to zero (i.e. Hidden):
Code:
'set children = this.GetObjectsByType("sys://Schema/Home/Location", false)
set children = this.GetObjectsByTypeAndPropertyValue("sys://Schema/Home/Location", "Navigation", 0, false)

for each child in children
	name = name & "Location," & child.DisplayName & "," & child.Path & "," & child.Class.Name & ";" 
next

'set children = this.GetObjectsByType("sys://Schema/Device/Lighting/Lighting", false)
set children = this.GetObjectsByTypeAndPropertyValue("sys://Schema/Device/Lighting/Lighting", "Navigation", 0, false)

for each child in children
	if (child.IsOfExplicitType("sys://Schema/Device/Dimmer")) then
		name = name & "Dimmer," & child.DisplayName & "," & child.Path & ";"
	else
		name = name & "Light," & child.DisplayName & "," & child.Path & ";"
	end if
next

method.GetContents = name
 
This works fine on my system: windows xp x64 with: firefox, ie 32 bit, ie 64 bit. Overall, I like the feel of it. Keep up the great work and thanks!
 
Also works perfectly on a MacBook Pro in both Safari and Firefox. I'm loving this direction ;) Thanks Jim.
 
Thanks for the suggestions 123. I took your script and incorporated it.

Regarding polling -- I am hoping to not do that and actually implement the back channel subscription mechanism that the AutomationBrowser uses. I think it is possible, although I will have to write a fair bit of code (on the Silverlight side) to do this. I spent a good bit of time tonight trying to get this going, but it isn't working yet. The subscription is getting set and data is coming back when a property changes (I can see it in a network monitor), but the Silverlight class I am using (HttpWebRequest) isn't returning any data. I think this is because SYS is keeping the socket open, which it needs to do.

Theming is definitely a component of Silverlight, although I am no expert on this.

Also, thanks to etc, Wayne, and Sam for trying it out on different platforms. I'm glad to hear it is working.

No new bits to try out as I didn't get anything useful completed tonight.
--jim
 
...Regarding polling -- I am hoping to not do that and actually implement the back channel subscription mechanism that the AutomationBrowser uses. ...
I didn't think that would be possible but I'm delighted to hear that there may be a way of doing it.

The whole concept of "subscriptions" is predicated on the client's ability to receive events transmitted by the server. I always thought the "SYSBridge" ActiveX component maintained an open socket with the SYS server so that the IE browser could receive status updates from the SYS server. I'm no web expert but aren't existing web protocols 'stateless' and data-exchange is initiated by the client (i.e. "pulled") as opposed to the server (i.e. "pushed")?

I know just enough to be dangerous! Can you elaborate on your strategy?
 
...Regarding polling -- I am hoping to not do that and actually implement the back channel subscription mechanism that the AutomationBrowser uses. ...
I didn't think that would be possible but I'm delighted to hear that there may be a way of doing it.

The whole concept of "subscriptions" is predicated on the client's ability to receive events transmitted by the server. I always thought the "SYSBridge" ActiveX component maintained an open socket with the SYS server so that the IE browser could receive status updates from the SYS server. I'm no web expert but aren't existing web protocols 'stateless' and data-exchange is initiated by the client (i.e. "pulled") as opposed to the server (i.e. "pushed")?

I know just enough to be dangerous! Can you elaborate on your strategy?

Yes it does keep the socket open and that is what I will need to implement as well. Silverlight provides basic network/socket support that I can use.
 
... Silverlight provides basic network/socket support that I can use.
A few thoughts:
  • The communications protocol between SYS and SYSBridge (and Minibroker) was never published. But if anyone knows it, you'd be one of them.
  • Publishing this protocol would open the door for developers to build apps that communicate directly with SYS (without the need for the ActiveX SYSBridge or the COM-based Minibroker). For example, a full-fledged .NET MiniBroker or the ability to talk to SYS from non-WinTel-based computers.

Perchance to dream ..
 
Now that silverlight is working on android via moonlight (and I think on iOS too)...
http://jeffreystedfast.blogspot.com/2011/04/moonlight-on-android.html

I hope Jim is kind enough to give us an update :) I think this is worth pursuing now that the tablet world has completely changed (since 2009 anyways).

I'm willing to make a generous donation and I suspect others would be too. Imagine having one user interface across windows (firefox or ie), iPad and android for Premise? I also like the idea of using silverlight to play video content; this would definitely bring SYS up to date!
 
I hadn't thought of using Silverlight...I do have MP3s playing in the MiniBrowser - I had a couple of bugs to fix - refresh stopped the playback (fixed); using the 'up' button takes you to nowhere (still in work). Once that is fixed, I'll put it up. I must say, I'm tickled
biggrin.gif



Looking at MP4s, I have been looking at FlowPlayer, which is a Flash-based; still working on it. Maybe Silverlight is the answer...

Haven't heard from Jim in quite a while...
 
I think silverlight is the only way to go if we want something similar to what Homeseer and other platforms have and want it to work a many types of devices. I wonder if Jim was able to get around polling...
 

Similar threads

C
Replies
0
Views
777
chucklyons
C
C
Replies
0
Views
1K
chucklyons
C
Replies
16
Views
3K
chucklyons
C
C
Replies
2
Views
1K
chucklyons
C
Back
Top