Open letter to user community

265 views
Skip to first unread message

barrygordon

unread,
Sep 24, 2012, 12:13:20 PM9/24/12
to comman...@googlegroups.com
I have been working with A/V systems and remote control systems for many years now, I have been programming professionally for over 50 years.  Some of you may know of me from RemoteCentral.com where I was very active in the Pronto PRO BBS.  I have been using CF for about a year now and wish to offer some free advice to the hobbyists out there as the Pro's (Custom Installers) probbaly already know this.
 
If you are serious about this hobby (and even if you are not but enjoy building control systems) learn how to program in Javascript. In the long run it will make your life so much easier and your work more fruitful. On the Philips Pronto PRO it was called Prontoscript, but it really was Javascript with extensions by Philips in much the same way that CF extended Javascript on the iPad et. al. with the CF object and all its variables and functions.
 
Programming is not that hard, it just has a learning curve. If you already know a programming language (any programming language) the learning curve is not that steep.  There is a lot of information regarding programming in Javascript on the web, and in readily available books. When buying a book try and ascertain if it is tutorial in nature (one written for learning) or reference in nature (one written for looking things up).
 
The benefits are multifold. IMHO there is nothing you can not do in iViewer using javascript, and fairly simply once you get the hang of it.  I am more than willing to help beginners but you have to do your share and spend the time to learn the language and understand the basics.  My web site has systems posted that are built more for learning and understanding than efficiency and speed but they do all work. I just did not necessarily uses the cleanest fastest Javascript code but rather what I felt would be easiest to understand. 
 
All the CF systems I develop now share common Javascript modules. The modules I write form my private library. The GUI portion of the system (the part I use guiDesigner to build) has all of the graphics and relies on Javascript for all the heavy lifting.  A button essentially calls a Javascript action routine with the name of the button and any parameters e.g. AVP.actions("Volume","Up");  AVP.actions("Volume","Down");  AVP.actions("Volume","Mute");  AVP.actions("Volume","Mute","On");  AVP.actions("Volume","Mute",Off"); are the commands that handle the volume functions for my AV Processor (an Anthem 50v). The Javascript action routine ends up performing a CF Send to a control system that is handling an iTach for IP to serial RS232 conversion. (In actuality, in my home all commands are sent to a PC that controls all components of the theater or the PC that performs all Home Automation functions.  This makes migration to new components easier IMHO. However the principle is the same, just the code is a little different) . Feedback is always handled the same way.  CF is told to accept all characters that arrive at the control system (^*) and pass them to a feedback routine written in Javascript.  I use a different feedback routine for each device (component) but all IR work is handled by a single feedback routine since all IR is done via a Global Cache device. The feedback routine does all of the heavy lifting obeying the unique protocol of that device.
 
My web site www.the-gordons.nethas a couple of good (IMHO) examples of how to use Javascript with iViewer. Two good ones to learn by are the two that handle a Jandy Aqualink pool control system.  One of the two is fairly simple, the other more complex in that it handles the automatic discovery of Global Cache devices. I am a big fan of table controlled system since changing values in a table is generally easier and less error prone than changing code. The Jandy Aqualink examples are good examples of table driven functionality. There is a table entry for each sub component of the pool system (Pump, SPA jets, lights, heater, temperature, Set Point,  etc.) The table states which graphic is to reflect the state of that sub component (holds its join value). In the Jandy example I use opacity to show state as that works well for on/off and degree e.g. brightness. The system treats all feedback as asynchronous changing the approriate graphic wheter or not the page the graphic is on is visible.
 
Take it from an old man with lots of experience in this field, Learn Javascript.
 
Every man has the wit to know and the will to learn, but the key to knowledge is the open book

CF_Craig

unread,
Sep 24, 2012, 1:50:14 PM9/24/12
to comman...@googlegroups.com
As a relative CommandFusion novice, I want to heartily agree with Barry.  I came to CF after hitting the limitations of my previous remote control system.  (It wasn't really the system's fault, but my applications can be quite complex.)  At first, I tried to do everything in CF without using Javascript, simply because I wasn't very good at it.  That was a BIG mistake.  I found more and more things that could ONLY be done using Javascript, so I was forced to learn the language.  As my Javascript skills have improved, I am moving more and more in that direction, to the point where almost everything will be done that way.  The combination of iViewer and Javascript is extremely powerful.  Take Barry's advice.  Learn Javascript FIRST.  It will actually help you in the long run.

Craig

Florent Pillet

unread,
Sep 24, 2012, 4:12:32 PM9/24/12
to comman...@googlegroups.com
+1 on what Barry wrote. I wholeheartedly agree.

And by the way, thanks to you Barry for all the effort and patience you put in helping others, and particularly in documenting your work and setting up the website. The documentation in itself and the steps you describe to reach the goal are an invaluable resource for everyone serious about iViewer JavaScript programming.

Florent

On Sep 24, 2012, at 6:13 PM, barrygordon <ba...@the-gordons.net> wrote:

> My web site www.the-gordons.nethas a couple of good (IMHO) examples of how to use Javascript with iViewer.
<snip>
> Take it from an old man with lots of experience in this field, Learn Javascript.
>
> Every man has the wit to know and the will to learn, but the key to knowledge is the open book

--
Florent Pillet - Software Engineering Lead
www.commandfusion.com



xAPPO

unread,
Sep 24, 2012, 4:20:29 PM9/24/12
to comman...@googlegroups.com


+1
 
I think the key point is that using an application like CF to control your home is more than a buy and click undertaking. If you invest it rewards.  You have purchased a great tool, you should use it.

Home Automation still , and probably always will, require you invest in understanding what is actually needed to accomplish your magic .  Yes you can rapidly achieve much the same as one of the universal infra-red remote replacements but the tenet of CF is more to empower the user with the magic to simplify , not an 'out of the box' simplification in itself.   You have a dashboard and an engine and you need to create the linkage.  Because of the number of engines, old models and a large disparity in how they work your particular task will undoubtedly require customisation and JavaScript is your tool.

If you wish to craft that really neat solution then invest in learning the right tools or alternatively perhaps employ a craftsman to do it for you.   Like all things it's not a hard as it might first seem...  Alternatively you only scrape the surface of the huge potential that iViewer offers... but that might be all you need too.

Kevin

Paul Minott

unread,
Sep 24, 2012, 5:08:32 PM9/24/12
to comman...@googlegroups.com
Barry - I am a newbie to programming but am willing to put in the time to learn. Is there a recommended Javascript 'Tutorial' that would start from scratch as I have no programming experience ......... yet!!

Thanks Again,

Paul

--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/ZLUrH7rLoAYJ.
To post to this group, send email to comman...@googlegroups.com.
To unsubscribe from this group, send email to commandfusio...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/commandfusion?hl=en.

Florent Pillet

unread,
Sep 24, 2012, 5:59:39 PM9/24/12
to comman...@googlegroups.com
There are a few resources you'll find links to in our own documentation:

http://www.commandfusion.com/docs/scripting/resources.html

I frequently use the Mozilla MDN site as a reference, it is very well done.

Florent

On Sep 24, 2012, at 11:08 PM, Paul Minott <pmi...@gmail.com> wrote:

> Barry - I am a newbie to programming but am willing to put in the time to learn. Is there a recommended Javascript 'Tutorial' that would start from scratch as I have no programming experience ......... yet!!

Barry Gordon

unread,
Sep 24, 2012, 6:34:12 PM9/24/12
to comman...@googlegroups.com
For a tutorial try (neither of which have I perused, but heard good recommendations):

Eloquent JavaScript: A Modern Introduction to Programming by Marijn Haverbeke

Or

Learning JavaScript: A Hands-on Guide to the Fundamentals of Modern JavaScript by Tim Wright


For a reference ( this is the one I use as my reference):

JavaScript: The Definitive Guide by David Flanagan



I prefer a book to the web so I can relax with it various places. Both are available for the Kindle and I assume the iPad.

The problem I have with JavaScript books is that since JavaScript is used very heavily in web page development the books generally spend a lot of time on that aspect where what you want is a book that stresses the programming aspects of JavaScript as a language.

When I was teaching programming in graduate school Javascript wasn't invented yet and we used a language called Pascal which was developed as a language for teaching the fundamentals of programming.

I am sure there must be some basic tutorial resource on the web that can be perused as pointed to by the CF documentation.




Sent from my iPad
> --
> You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.

CF_Craig

unread,
Sep 24, 2012, 8:23:59 PM9/24/12
to comman...@googlegroups.com
Barry,

Glad to hear from a fellow Pascal guy!  I've been a Pascal programmer for years.  (Of course, it's Delphi now.)  Compared to all the other languages I have seen or used, Pascal is so elegant.  Making the transition to Javascript was difficult for me because there is no real IDE, no compiler to check for syntax errors, etc.  I'm working through it though.

Craig

Barry Gordon

unread,
Sep 24, 2012, 9:32:35 PM9/24/12
to comman...@googlegroups.com
You might want to look into the  Cpoint JavaScript editor. I have been using it for several years. It does syntax checking, and color codes the text to aid in getting things correct. Has all sorts of great features, most of which I don't use. Installed under windows, you assign the JS extension to launch it and you're on your way.

Sent from my iPad
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/vryJGc2QuaEJ.

YourMe

unread,
Sep 26, 2012, 10:15:16 AM9/26/12
to comman...@googlegroups.com
That is the purpose of programming in any language, re-usability makes it perfect. i have been doing programming since childhood barry and i agree with you 100% on this report.

Roman

unread,
Sep 26, 2012, 11:55:37 AM9/26/12
to comman...@googlegroups.com

I'm 34+... My first try iViewer was about year ago. My first script in iViewer was a week from first try and it was after I've seen Barry's posts and site. Thank you, Barry!

26.09.2012 18:15 пользователь "YourMe" <yo...@woodstockelectronics.com> написал:
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/5KQ5QdH8bjUJ.

simon...@gmail.com

unread,
Oct 4, 2012, 2:15:25 AM10/4/12
to comman...@googlegroups.com
And for those of you who do your JavaScript on a Mac like me, have a look at Komodo Edit which has very similar features to CPoint (which Barry put me on to a few years ago for Pronto programming!!). Saves me hours of looking for badly matched curly braces!!!!

Florent Pillet

unread,
Oct 4, 2012, 4:21:43 AM10/4/12
to comman...@googlegroups.com
Haven't heard of Komodo - I work on Mac too, and I mostly use WebStorm to work on JavaScript code (or TextMate for quick edits), it does a lot of checking and cross-references your code.

I also recommend a tool named CodeRunner that you can find on the Mac AppStore. It allows you to make quick pure JavaScript tests (try your code before your put it in your GUI) but of course you can't use CF API calls, unless you fake them.

Florent

On Oct 4, 2012, at 8:15 AM, simon...@gmail.com wrote:

> And for those of you who do your JavaScript on a Mac like me, have a look at Komodo Edit which has very similar features to CPoint (which Barry put me on to a few years ago for Pronto programming!!). Saves me hours of looking for badly matched curly braces!!!!

Automated Atmospheres

unread,
Feb 5, 2014, 6:49:42 PM2/5/14
to comman...@googlegroups.com

I’ve been struggling to understand JavaScript and some of you may be in that same sinking ship…

I’ve tried to follow Barry’s and Fiasco’s Code, but just couldn't comprehend the fundamentals.

Although I purchased all the recommended books (The Definitive Guide, Sams Teach Yourself) I always went cross-eyed after a couple of hours and thought “I’ll just wait for the movie” ;)

I realized that a lot of my problem in learning this new language is that I have no understanding of the vocabulary, terminology or the syntax which is the foundation.

I was reading symbols instead of the language. 

I found this good tutorial sight that had step by step videos:

http://thenewboston.org/list.php?cat=10

It’s starting to make more sense when you understand “what” is being said and not just what it does.

Just thought I’d share...

Again Thank you Barry and the many others for sharing all of your time and wisdom!

Cheers, 

Scott 

thechad

unread,
Feb 5, 2014, 7:09:54 PM2/5/14
to comman...@googlegroups.com
Scott, nice link.  I will have a watch of these.

Mods, I wonder if there is value in creating a sticky/wiki entry for javascript training couses.

Perhaps it could be added to here? http://www.commandfusion.com/wiki2/software/training

Steve NJ

unread,
Feb 7, 2014, 7:48:48 AM2/7/14
to comman...@googlegroups.com
Scott,
 Thanks for the link, I too am trying to get my head around JS but find myself getting no where fast.

Steve
Message has been deleted

Wayne

unread,
Feb 7, 2014, 12:00:47 PM2/7/14
to comman...@googlegroups.com
I found a Kindle book called "A Smarter Way To Learn Javascript: The new approach that uses technology to cut your effort in half", there is a website where you can take interactive tests after each chapter. I am new to Command Fusion and Javascript so I can't really judge it compared to other learning methods but the price of the Kindle addition book is only $2.99 right now.

Les Bridges

unread,
Feb 13, 2014, 12:06:41 PM2/13/14
to comman...@googlegroups.com
Scott thank you I'm exactly where you were ill give it a shot.

Cheers

Les
Reply all
Reply to author
Forward
0 new messages