Please login or register.

Login with username, password and session length

Author Topic: New X10Dispatcher Available!  (Read 6825 times)

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
New X10Dispatcher Available!
« on: January 18, 2014, 04:48:37 PM »

 :)% It's Back!!!! :)%
You can find it on Codeplex or my site.
The original Author has updated it!
The none functioning MSN Messenger is gone and Twitter is in its place.
It is also compatible with Windows 8.1
For more details see: X10Dispatch
 >!
« Last Edit: January 18, 2014, 04:51:58 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

pipeline

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: New X10Dispatcher Available!
« Reply #1 on: January 26, 2014, 09:09:36 PM »

Hey Tuicemen, I see your an admin here too...

Yes I needed to setup my dispatch box on a new windows 8.1 'server' so I rebuilt with a little future proofing.

Broken MSN is gone, Twitter has somewhat filled the role...
- Alerts are dispatched over twitter (if configured)
- Power Outage can alert to twitter
- A Twitter macro task lets you add twitter post functionality within your macros
- Statistics in several places (alerts and statistics screens) converted msn stats to twitter

Also reworked the web server 'custom web' to serve up descent websites which can interface with x10dispatcher via some new JSON web services I am providing now.

Currently don't have an ability to send commands over twitter but if there is enough interest I can look into it.  Looking at history I had probably abandoned this over five years ago!  So not sure people still use this but my cm15a and devices still work good so maybe so...

The main program was pretty tricked out so I don't think there's many features I need to add but for simple requests feel free to ask while I am refamiliarized with the code.  

You can get the link from tuicemen's site linked above or go to :
http://x10dispatcher.codeplex.com

There you can find binaries download, source code download, and a demo custom website to put in customweb subdirectory to demonstrate using the json webservices.
« Last Edit: January 26, 2014, 09:13:49 PM by pipeline »
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: New X10Dispatcher Available!
« Reply #2 on: January 28, 2014, 09:12:35 AM »

Hey Tuicemen, I see your an admin here too...
Yes, I help admin a couple of boards. ;)
Quote
Also reworked the web server 'custom web' to serve up descent websites which can interface with x10dispatcher via some new JSON web services I am providing now.
May be you could explain a little more about the custom web?
I'm a little lost with it and how to set it up B:( ::) :'
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

pipeline

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 2
Re: New X10Dispatcher Available!
« Reply #3 on: January 28, 2014, 06:41:51 PM »

- Years ago I first added simple web server functionality to serve up hardcoded pages (generated dynamically).  You have to enable this in the webserver tab page in options.
-Around the same time I added a 'Custom Web' functionality to (additionally) serve up real files stored in the CustomWeb subdirectory.  Simple way to transfer files but did not make available much x10 logic to put into custom web pages.   To enable this Custom Web logic you needed to click an additional 'Enable Custom Web' checkbox in WebServer tab of options.

Fast Forward to now :
In order to open up x10dispatcher for (somewhat) serious web development I needed to clean up the internals of how files were served up.  So I did and additionally I serve up some new JSON webservices as a mean for web developers to get access to x10dispatcher data/statistics which they can present however they want though their own web designs.  If you don't know basic web programming (HTML/JavaScript) you might not be interested in this functionality, but if all you know is web programming and want to join in the x10 hacking this might be a good way to do so.

JSON is similar to XML with different syntax/structure...  AJAX works with JSON to make data requests from javascript without reloading the webpage... which makes for dynamic webpages which can refresh data without losing context or reloading.

There are TONS of third party javascript libraries out there that can do anything from DataGrids, Image Carousels, Charting (jqplot, d3.js), and even 3d rendering of data with WebGL (using three.js).  

The specifics of what I did add to 4.0.0 Custom Web is :
- Supporting subdirectories for serving up javascript libraries which have their own folder structure.
- Fixed Mime Types and response codes to 'play better' with what ajax expects (as well as what browsers themselves expect)... CSS;JS;XML;SVG;JPG;PNG any many other popular media (MP4;AVI;MP3;MOV;etc) and other formats (XLS,DOC,ZIP,RTF) all return the proper mime type.
- Fixed Response codes which browsers/ajax expect as well as content length.

With that functionality established, I added some JSON webservices so I can get access to x10 activity and display in a web page.  These web services are :

/status.json  : making an ajax request for status.json returns a javascript object containing arm status, alertsRaised flag, whether email is configured, twitter configured, twitter ping configured, whether image panel is enabled and Boolean flags for image1exists, image2exists (and 3 and 4)... images are still requested using /image1.jpg (or 2,3,4)

/alertlog.json returns an object with 'Alerts' property which is an array of objects, each representing a raised alert.. these alert objects contain 'AlertTime (datetime), AlertType (x10, poweralert, webalert), Description, Sent Email flag, Sent Twitter flag.

/alertlog-jqgrid.json : same as above but formatted for consumption using jqgrid open source data grid (my downloadable example demos this)

/eventlog.json : returns an object with 'Events' property which is an array of raw event history.  Each event contains Transport, Transport Code, Device, Command, EventDateTime, AlertDescription (if triggers are defined it will display that description)

/eventlog-jqgrid.json : same as above but formatted for consumption using jqgrid.

/vars.json : x10dispatch variables designed specifically so a user (via web calls) can store and retrieve variables... any external program/script might read a digital thermometer (or whatever data acquisition they want) and call /serviariable.htm?Varname=VarValue    to 'push' variable values into x10dispatcher which I would display in the web server... or NOW into your page.  This JSON service returns 'Variables' array of objects with 'Name' and 'Value' properties (name might be 'temperature' and value might be '75').   x10 dispatcher in this mechanism is really just carrying around your variables, theres no logic that I do with these variables other than give them back to you (there are also commands available from the 'remote commands' tab on the main screen type help to play with)

Whew probably more than you wanted but pretty comprehensive in case I need to copy/paste later :)

I may improve this to send plc or other dispatch functionality in the future if anyone wants to web develop with this functionality.

Once I am confident about the 4.0.0 changes and status of the main code base I will probably improve my custom web demo site.  The demo site could be prettier and I should add timers to refresh automatically.  This demo site is a separate download available (zip file) from codeplex which you extract into the customweb subdirectory of x10dispatcher.
« Last Edit: January 28, 2014, 06:49:31 PM by pipeline »
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.