Welcome to myInstaller

myInstaller is Allonis' application that helps the integrator or the DIY user install all of the key software for the myServer suite. myInstaller connects to Allonis' software distribution file server and downloads the very latest released Allonis software. The application will check what's been installed on that PC and if there are any updates for that component.  myInstaller works with Allonis's Subscription Manager to show and download applications that the subscription covers.


System Requirements

  • Microsoft Windows 10, 8, Windows 7 with all the current service packs and security updates. (32 or 64 bit versions. 64 bit recommended). Windows 2008 Server OS or newer is supported. XP cannot be used.  Vista should not be used.
  • .NET 4.5.2 or newer installed prior to myServer software
  • Modern dual-core processor or better
  • 2GB main memory. (4GB or more recommended)
  • 100GB free disk space
  • optional: login account for Allonis's Subscription Manager

The ideal PC for using our software is a Core i5 processor with 8GB of memory with a SATA III hard drive running Windows 10 Home or Pro 64 bit. SSD drives are recommended for speed and reliability. For additional reliability, a RAID 1 operating system (where myServer software is typically installed) drive setup is best for redundancy.

Install myInstaller app on any PC where you need to install any other myServer suite software. Examples would be the primary myServer PC and optionally, a PC where myDesigner will be installed (your daily use desktop PC where you will be developing your web pages), the PC where myAgent is installed (optional remote zone support PCs).

At the bottom of the installation documentation will be links to install other Allonis software products in a typical sequence to success.  If you are exploring the software trial, follow the "Ultimate" links to experience most of the suite.

Installation

NOTE: It is recommended that you temporarily disable any anti-virus software during the install of the software. Once these products are installed it will be safe to re-enable your virus software. The installer modifies firewall permissions to allow the components to network properly.

It is also recommended for the PC to be running the latest Google Chrome browser.  Other browsers likely will work, but Allonis does all testing on Chrome and it is highly recommended.

Ensure you have applied all Windows service packs, updates and especially .NET latest files BEFORE installing Allonis software to it.

Step 1: User Access Control (UAC)

Windows 10, 8, Windows 7 and Windows Vista support a security mechanism called User Access Control. While meant to be a tool to keep users from doing harm to themselves it really hinders the users ability to freely install software on their PCs. The very first step is to make sure that you have turned off UAC. To do this follow these steps:

  1. Go into the Control Panel and select the "User Accounts" applet.
  2. Click on "Change User Account Control Settings"
  3. Slide the vertical slider all the way down to the "Never Notify" position
  4. Click OK. See the following illustration for an example.



Step 2: Allonis Installation Assistant

Download and install the Allonis Installation Assistant (myInstaller). You can download the latest version from HERE

Check the icon created on the desktop. It should have a shield graphic on it. If not, Windows 10 and 8 Users must now take one additional step. Right-click on the "I" icon that was created on the desktop to change the properties of the icon. Go to the compatibility section and make sure you check off the box that says "Run this program as an Administrator"

Step 3: Open Allonis Installation Assistant

  • Section A in the Allonis Installation Assistant table lists the prerequisite software that is required to run myServer5. You must install them in the order they are listed only once on the PC that will be running myServer. Note that if you have already installed myInstaller following these instructions, you don't need to install "#1" again.  To reinstall myInstaller, download the file, shut down myInstaller application and then manually launch the file from the myServer\Downloads directory.
  • Section B in the Installation Assistant table lists the software that is required to support the user interface of your choice.
  • Section C lists the optional Allonis App software.
  • Section D describes optional Agent software that is optional support software installed on myServer and additional PCs.
  • Section E lists the Allonis Drivers that support hardware devices that is installed on the myServer PC.
  • Section F lists the support software that supports the myServer installation. It is optional to download these components standalone as they are automatically downloaded during the "SQL Server 2014 and Data Migration App (in Section A) which is the normal installation path. For advanced users, you can download the SQL client application that allows you direct access to the myServerSQL database.
  • Section G lists beta and demo Allonis software that should not be installed unless recommended by Allonis.


Step5: Login to your Account

Click the Login button

Enter your Allonis website / forum user name and password.  Click Save.

If you have an Allonis Software Subscription, the file list will repopulate to include the optional updates (in blue).

Step 4: Install your software!

Follow all the instructions presented during the installation. The installer will automatically select the correct installation components 32bit or 64bit depending on the operating system in use. The default installation directory is c:\program files (x86)\Allonis\myServer. You can change the default drive letter (keep the directory structure same) but it's simpler long term to install to the defaults.  If you decide to NOT install to defaults, then you must install all of the software in the SAME myserver directory.  myInstaller, myAgent, myContent, myDesigner CAN be installed in secondary locations.  Note that each product will ask where you would like to install.  Be careful especially on that products first time install to set the directories correctly.  Subsequent updates the installer should Reinstall to the same directory you chose earlier.

  1. On myInstaller launch, if it is installed on an Internet connected PC, it should download the list of the most up to date components. It will also compare the versions installed on the same PC. If installed and old, it will be highlighted Red as an available update. If you have not installed that component, then it will never be red.
  2. Click the checkbox on software to be downloaded to that PC. You can select multiple choices.
  3. For the "Ultimate" / Trial installation, select: SQL Server, myServer, myContent, myDesigner, myUI, myUI for phone, myUI for Tablets, Calendar, GMusic, Horoscope, Internet Radio, Irrigation, myDrinks, myMovies, myMusic, myPhotos, myRecipes, Pandora, RSS, TuneIn, Weather, myAgent, A/V Driver, MediaPlayer Classic, Family Device Simulators for Climate, Lighting, Shades, Switching. 
  4. Once all choices selected, click the Download Selected button.
  5. Once all products are finished downloading review your choices for installation. If you would like to install them, click the Install Selected button.  You can also Clear Selections and select a different file to install by clicking on it.
  6. Each installer will launch, install, shut down. myInstaller will then kick off the next installer until all are done.  It is recommended to install the files to the default directory.
  7. myInstaller will update the install versions for all products on that PC.
  8. Shut down myInstaller application when all installers are finished.


Next Up:  Let's install the SQL Server database and myServer application!  Click HERE

The Update Database button grabs the list of the latest available updates from Allonis.  It also reviews the version of each file on the local system.  Be patient, this can take a few minutes where the app may seem unresponsive.

The View Downloads button will open File Explorer to the location your downloads will be saved.

Stop myServer will shut down the myServer app so you can install new applications and features.

myServer is used on a daily basis within the home or business it is controlling. When you are outside of the home, it can be very handy to be able to interact with your systems. Providing secure access to the home should be done in a deliberate way so as not to allow unauthorized use or monitoring of the system.

Security is important and is like layers of an onion.  Each layer adds another level of security.  Multiple levels are typically implemented.  Only you can determine to what degree of security is needed and the cost and time to implement.  With enough time, money and experience, all systems can be hacked if exposed to the Internet.

Read More

Here are some fundamental and common Linux commands with example usage.  Used for configuring a Raspberry Pi device (like myZWave Controller):

Setting up Linux

https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows

https://www.ubuntu.com/download/desktop

 

ADMINISTRATION

sudo startx

Launches the desktop on the Pi.

sudo reboot

Reboots the Pi.

sudo shutdown or sudo halt 

sudo shutdown -h now (or sudo halt)

You can’t use shutdown (or halt) unless you have sudo privileges.

-h means halt the system, now means do it immediately. You could also add number 10 to tell it to shut down in 10 minutes. You can even give a specific time 19:45 (in 24 hour format with a : colon).

Shuts down the Pi.

You should always gracefully shutdown the OS before pulling the power on the Pi.

("sudo" command for “run as admin” as the standard account is not an admin.  You can not shutdown or reboot the raspberry pi with a normal account)

FILESYSTEM

LS

Lists the content of the current directory (or one that is specified). Can be used with the -l flag to display additional information (permissions, owner, group, size, date and timestamp of last edit) about each file and directory in a list format. The -a flag allows you to view files beginning with . (i.e. dotfiles).

CD

Changes the current directory to the one specified. Can use relative (i.e. cd directory A) or absolute (i.e. cd /home/pi/directory A) paths.

PWD

Displays the name of the current working directory, i.e. pwd will output something like /home/pi.

MKDIR

Makes a new directory, e.g. mkdir newDir would create the directory newDir in the present working directory.

RMDIR

Remove empty directories, e.g. rmdir oldDir will remove the directory oldDir only if it is empty.

RM

Removes the specified file (or recursively from a directory when used with -r). Be careful with this! Files deleted in this way are mostly gone for good!

CP

Makes a copy of a file and places it at the specified location (essentially doing a 'copy-paste'), for example - cp ~/fileA /home/otherUser/ would copy the file fileA from your home directory to that of the user other User (assuming you have permission to copy it there!). This command can either take FILE FILE(cp fileA fileB), FILE DIR (cp fileA /directoryB/) or -r DIR DIR(which recursively copies the contents of directories) as arguments.

MV

Moves a file and places it at the specified location (so where cp performs a 'copy-paste', mv performs a 'cut-paste'). The usage is similar to cp, somv ~/fileA /home/otherUser/ would move the file fileA from your home directory to that of the user otherUser. This command can either take FILE FILE(mv fileA fileB), FILE DIR (mv fileA /directoryB/) or DIR DIR(mv /directoryB /directoryC) as arguments. This command is also useful as a method to rename files and directories after they've been created.

TOUCH

Either sets the last modified time-stamp of the specified file(s) or creates it if it does not already exist.

CAT

Lists the contents of file(s), e.g. cat thisFile will display the contents of thisFile. Can be used to list the contents of multiple files, i.e. cat *.txt will list the contents of all .txt files in the current directory.

HEAD

Displays the beginning of a file. Can be used with -n to specify the number of lines to show (by default 10), or with -c to specify the number of bytes.

TAIL

Displays the end of a file. The starting point in the file can be specified either through -b for 512 byte blocks, -c for bytes, or -n for number of lines.

CHMOD

Normally used to change the permissions for a file. The chmod command can use symbols u (user that owns the file), g (the files group) , o (other users) and the permissions r (read), w (write) and x (execute). Usingchmod u+x *filename* will add execute permission for the owner of the file.

CHOWN

Changes the user and/or group that owns a file. It normally needs to be run as root using sudo e.g. sudo chown pi:root *filename* will change the owner to pi and the group to root.

SSH

Secure shell. Connect to another computer using an encrypted network connection. For more details see SSH (secure shell)

SCP

Copies a file from one computer to another using ssh. For more details see SCP (secure copy)

SUDO

Run a command as a superuser, or another user. Use sudo -s for a superuser shell. For more details see Root user / sudo

DD

Copies a file converting the file as specified. It is often used to copy an entire disk to a single file or back again eg. dd if=/dev/sdd of=backup.img will create a backup image from an SD card or USB disk drive at /dev/sdd. Make sure to use the correct drive when copying an image to the SD card as it can overwrite the entire disk.

DF

Display the disk space available and used on the mounted filesystems. Usedf -h to see the output in a human readable format using M for MBs rather than showing number of bytes.

UNZIP

Extracts the files from a compressed zip file.

TAR

Store or extract files from a tape archive file. It can also reduce the space required by compressing the file similar to a zip file.

To create a compressed file use tar -cvzf *filename.tar.gz* *directory/*To extract the contents of a file use tar -xvzf *filename.tar.gz*

PIPES

A pipe allows the output from one command to be used as the input for another command. The pipe symbol is a vertical line |. For example to only show the first 10 entries of the ls command it can be piped through the head commandls | head

TREE

Show a directory and all subdirectories and files indented as a tree structure.

&

Run a command in the background freeing up the shell for future commands.

WGET

Download a file from the web directly to the computer e.g. wget http://www.raspberrypi.org/documentation/linux/usage/commands.mdwill download this file to your computer as commands.md

CURL

Download or upload a file to/from a server. By default it will output the file contents of the file to the screen.

MAN

Show the manual page for a file. To find out more run man man to view the manual page of the man command.

SEARCH

GREP

Search inside files for certain search patterns e.g. grep "search" *.txt will look in all the files in the current directory ending with .txt for the string search.

Supports regular expressions which allows special letter combinations to be included in the search.

AWK

Programming language useful for searching and manipulating text files.

FIND

Searches a directory and subdirectories for files matching certain patterns.

WHEREIS

Finds the location of a command. Looks through standard program locations until it finds the requested command.

NETWORKING

PING

Utility usually used to check if communication can be made with another host. Can be used with default settings by just specifying a hostname (e.g. ping raspberrypi.org) or an IP address (e.g. ping 8.8.8.8). Can specify the number of packets to send with the -c flag.

NMAP

Network exploration and scanning tool. Can return port and OS information about a host or a range of hosts. Running just nmap will display the options available as well as example usage.

HOSTNAME

Displays the current hostname of the system. A privileged (super) user can set the hostname to a new one by supplying it as an argument (e.g. hostname new-host).

IFCONFIG

Displays the network configuration details for the interfaces on the current system when run without any arguments (i.e. ifconfig). By supplying the command with the name of an interface (e.g. eth0 or lo) you can then alter the configuration (check the man-page for more details).

Allonis S 128

IFTTT ("IF This, Then That") integration with myServer

Read More about IFTTT HERE.

Originally posted by TMCGOWAN on the forum.

System Requirements

  • myServer
  • IFTTT account setup

Setup your router to ONLY forward port "X" to 6246 both TCP/UDP on whatever IP myServer runs. Make port X something unusual like 8567. This will be the example going forward.

Make sure your myServer PC has a static IP or use NoIP or something similar.

Start your trigger in IFTTT, and for the "that" use the Maker channel and:
Make a web request: http://mrsmith.noip.com:8567/command? command in myServer, macro, etc>>
Method = GET
Content Type = Text/plain
Body (leave blank)

And Viola - now you can use IFTTT. This can be used with the Amazon Echo, but there's limited echo "ifs" - but it works.

You can use the Amazon Echo Alexa Trigger Channel with the IFTTT recipe method (posted by artdustman on forum).

Welcome to the myServer Advanced User documentation

myServer represents Allonis's media management and home automation software components. myServer supports two way external integration that can be leveraged by advanced users and software developers.

Some of the documentation below has been gathered from user Forum contributions.

Watch CycleState

This Watch cyclestate is used for defining the A/V video playback devices that are available.This Watch cyclestate is used for defining the A/V video playback devices that are available. You must change this file to match the devices in use in your home. Each of the devices has a similar macro structure. Once you have configured the first device you can just copy and paste to the next one making the necessary changes for what is unique for that player.
 Here is an example of the macro for setting up for watching myMovies

Macro| SetVariable|{{zones_activezonename_{{clientname}}}}_source~myMovies! SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0! SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0! SetVariable|movies_activeplayer_{{clientname}}~0! If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0## AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##! If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0## Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##! WebCmd|{{clientname}}~LoadScene|Movies##  Now for an explaination
SetVariable|{{zones_activezonename_{{clientname}}}}_source~myMovies!


 This just defines the friendly name that is shown to the user on the scenes


SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!


 If you are using a multi-zone audio switcher like Russound, Nuvo or a high-end AV Receiver that is dedicated to this room then you will use this server variable to define the input # (Russound, Nuvo) or input name (Denon, Integra, Yamaha, etc.) that this source is feed into.
 For example. Let's say you have a Rusound MCA audio switcher. That Russound input for myMovies goes into input 6 on the Russound. Under that condition you would set the variables as follows:


SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~6!


 If you do not have any audio switching equipment in this room then leave the variable set to its default values of 0.


SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!


 Just like the rules for the audio switching the video switcher variable is for controlling the video input for the source. For example. Let's say you have a Shinybow HDMI switcher. myMovies plays through input #3 on the Shinybow. Under that condition you would set the variable as follows:


SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~3!


 If you do not use a dedicated switcher but you are using an AV receiver/amp then you would specify the name of the input to switch to. For example. Let's say you have a Denon receiver and myMovies plays through the HMDI2 input on the receiver. Under that condition you would set the variable as follows:


SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~HDMI2!


 If you do not have any video switching equipment in this room then leave the two variables set to their default values of 0.


SetVariable|movies_activeplayer_{{clientname}}~<<MOVIE PLAYER DEVICE ID>>!


 This variable tells the myMovies app the ID of the Media Player device to play the movie through. If you have multiple movie playback locations then it is better to not set this variable in this macro command. Rather you would incorporate the setting of the variable into the macro that sets up the room. See the Zones cyclestates example.


If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0## AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!


 This command is responsible for doing the actual switching of the audio source for the current active room (zone). You should not have to make any changes to this command. If there is an audio input defined for this source then the switch takes place. 

If|IsGT##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0## Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!


 This command is responsible for doing the actual switching of the video source for the current active room (zone). You should not have to make any changes to this command. If there is a video input defined for this source then the switch takes place. If you are using a piece of AV gear to do the video switching then remember to change the Switching| family prefix above to the AV| family prefix. 

WebCmd|{{clientname}}~LoadScene|Movies


 All the setup is complete. Take the user to the scene that controls this source. Movies in this example.
 Everything below this line is the actual commands that will get imported into the Watch cyclestates. Lines that begin with two  are treated as comments are are ignored. The lines are formatted as three tab delimited columns. Column #1 is the State Value. Column #2 is the State Name. And Column #3 is the server macro that gets executed.
 If you want to edit this file directly please use a good text editor like NotePad++ and you can easily break these lines into readable code. Or just input this file into myServer and make your edits there.

1 Movies Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Movies!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!?|SetVariable|movies_activeplayer_{{clientname}}~0!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Movies2 Netflix Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Netflix!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!?|SetVariable|netflix_activeplayer_{{clientname}}~0!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Netflix3 Amazon Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Amazon!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!?|SetVariable|amazon_activeplayer_{{clientname}}~0!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Amazon4 Cable TV Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Cable TV!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!?|SetVariable|GCIRID_{{clientname}}~!?|SetVariable|GCIRDevice_{{clientname}}~!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|CableTV5 DirecTV Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~DirecTV!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!?|SetVariable|GCIRID_{{clientname}}~!?|SetVariable|GCIRDevice_{{clientname}}~!?|SetVariable|av_activedvr_{{clientname}}~0!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|DirecTV6 Dish Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Dish!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!?|SetVariable|GCIRID_{{clientname}}~!?|SetVariable|GCIRDevice_{{clientname}}~!?|SetVariable|av_activedvr_{{clientname}}~0!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Dish

Listen

This cyclestate is used for defining the A/V Music and Radio sources that are available.This cyclestate is used for defining the A/V Music and Radio sources that are available.You must change this file to match the players in use in your home. Each of the playershas a similar macro structure. Once you have configured the first player you can just copy and paste to the next one making the necessary changes for what is unique for that player.
Here is an example of the macro for setting up for watching myMusic

Macro| SetVariable|{{zones_activezonename_{{clientname}}}}_source~Music 1! SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0! SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0! Music|SetSource~1! If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0## AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##! If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0## Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##! WebCmd|{{clientname}}~LoadScene|Music


Now for an explaination


SetVariable|{{zones_activezonename_{{clientname}}}}_source~Music 1!


This is the friendly name the user will see.


SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!


If you are using a multi-zone audio switcher like Russound, Nuvo or a high-end AV Receiver that isdedicated to this room then you will use this server variable to define the input # (Russound, Nuvo)or input name (Denon, Integra, Yamaha, etc.) that this source is feed into.
For example. Let's say you have a Rusound MCA audio switcher. That Russound input for myMovies goesinto input 6 on the Russound. Under that condition you would set the variables as follows:


SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~6!


If you do not have any audio switching equipment in this room then leave the variable set to its default values of 0.


SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!


Just like the rules for the audio switching the video switcher variable is for controlling thevideo input for the source. For example. Let's say you have a Shinybow HDMI switcher. myMovies playsthrough input #3 on the Shinybow. Under that condition you would set the variable as follows:


SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~3!


If you do not use a dedicated switcher but you are using an AV receiver/amp then you would specify the name of the input to switch to. For example. Let's say you have a Denon receiver and myMovies playsthrough the HMDI2 input on the receiver. Under that condition you would set the variable as follows:


SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~HDMI2!


This server variable will rarely, if ever, be used for any of the music or radio players but it is included just incase it is needed. If not in use keep the default value of 0.


Music|SetSource~1!


This tells the muMusic app to activate the player associated with Source #1. This is required.


If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0## AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!


This command is responsible for doing the actual switching of the audio source for the current active room (zone). You should not have to make any changes to this command. If there is an audio input defined for this source then the switch takes place.


If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0## Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!


This command is responsible for doing the actual switching of the video source for the current active room (zone). You should not have to make any changes to this command. If there is a video input defined for this source then the switch takes place. If you are using a piece of AV gear to do the video switching then remember to change the Switching| family prefix above to the AV| family prefix.


WebCmd|{{clientname}}~LoadScene|Music


All the setup is complete. Take the user to the scene that controls this source. Music in this example.
Everything below this line is the actual commands that will get imported into the Listen cyclestates.  Lines that begin with two are treated as comments are are ignored.The lines are formatted as three tab delimited columns. Column #1 is the State Value.Column #2 is the State Name. And Column #3 is the server macro that gets executed.
If you want to edit this file directly please use a good text editor like NotePad++ and you can easily break these lines into readable code. Or just input this file into myServer and make your edits there.
PLEASE NOTE: Please feel free to remove any of the Music and/or Radio players that you are not using


1 Music #1 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Music 1!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!Music|SetSource~1!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Music

2 Music #2 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Music 2!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!Music|SetSource~2!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Music

3 Music #3 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Music 3!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!Music|SetSource~3!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Music

4 Music #4 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Music 4!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!Music|SetSource~4!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Music

5 iRadio #1 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~iRadio 1!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!InternetRadio|SelectRadio~1!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|InternetRadio

6 iRadio #2 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~iRadio 2!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!InternetRadio|SelectRadio~2!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|InternetRadio

7 iRadio #3 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~iRadio 3!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!InternetRadio|SelectRadio~3!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|InternetRadio

8 iRadio #4 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~iRadio 4!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!InternetRadio|SelectRadio~4!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|InternetRadio

9 GMusic #1 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~GMusic 1!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!GMusic|SelectRadio~1!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|GMusic

10 GMusic #2 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~GMusic 2!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!GMusic|SelectRadio~2!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|GMusic

11 GMusic #3 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~GMusic 3!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!GMusic|SelectRadio~3!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|GMusic

12 GMusic #4 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~GMusic 4!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!GMusic|SelectRadio~4!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|GMusic

13 Pandora #1 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Pandora 1!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!PandoraRadio|SelectRadio~1!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Pandora

14 Pandora #2 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Pandora 2!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!PandoraRadio|SelectRadio~2!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Pandora

15 Pandora #3 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Pandora 3!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!PandoraRadio|SelectRadio~3!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Pandora

16 Pandora #4 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~Pandora 4!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!PandoraRadio|SelectRadio~4!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|Pandora

17 TuneIn #1 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~TuneIn 1!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!TuneIn|SelectRadio~1!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|TuneIn

18 TuneIn #2 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~TuneIn 2!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!TuneIn|SelectRadio~2!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|TuneIn

19 TuneIn #3 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~TuneIn 3!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!TuneIn|SelectRadio~3!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|TuneIn

20 TuneIn #4 Macro|SetVariable|{{zones_activezonename_{{clientname}}}}_source~TuneIn 4!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_input~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_input~0!TuneIn|SelectRadio~4!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}##0##AV|{{{{zones_activezonename_{{clientname}}}}_audio_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_audio_switcher_output}}##!If|IsNE##{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}##0##Switching|{{{{zones_activezonename_{{clientname}}}}_video_switcher_id}}~Switch~{{{{zones_activezonename_{{clientname}}}}_video_switcher_input}}~{{{{zones_activezonename_{{clientname}}}}_video_switcher_output}}##!WebCmd|{{clientname}}~LoadScene|TuneIn

Zones

This cyclestate is used for defining the A/V devices that are unique to each room (zone).This cyclestate is used for defining the A/V devices that are unique to each room (zone).You must change this file to match the rooms in your home and the A/V devices beingcontrolled in those rooms. Each of the rooms has a similar macro structure. Once you haveconfigured the first room you can just copy and paste to the next one making the necessarychanges for what is unique in that room.
Here is an example of the macro for setting up the Great Room

Macro| SetVariable|zones_activezone_{{clientname}}~Great Room! SetVariable|zones_activezonename_{{clientname}}~greatroom! SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0! SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0! SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0! SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0! SetVariable|GCIRID_{{clientname}}~! SetVariable|GCIRDevice_{{clientname}}~! SetVariable|movies_activeplayer_{{clientname}}~! SetVariable|netflix_activeplayer_{{clientname}}~! SetVariable|amazon_activeplayer_{{clientname}}~! SetVariable|av_activedvr_{{clientname}}~


That's a lot of commands. Let's break them down into logical groups.


SetVariable|zones_activezone_{{clientname}}~Great Room! SetVariable|zones_activezonename_{{clientname}}~greatroom!


These two variables define the room name and its server variable name.{{zones_activezone_{{clientname}}}}

is the variable that holds the friendly name for the room.This is what gets displayed on the user interface.
{{zones_activezonename_{{clientname}}}}

is the server variable that the server uses. Since servervariables cannot contain punctuation characters or spaces and must be lowercase this is simply thefriendly name with the illegal characters stripped out of it.

SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0! SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!


If you are using a multi-zone audio switcher like Russound, Nuvo or a high-end AV Receiver that isdedicated to this room then you will use these two server variables to 1) define the AV Family device ID for the switcher and 2) the decicated output from that device that feeds the speakers in the room.
For example. Let's say you have a Rusound MCA audio switcher. That Russound has been assigned deviceID 2 in the A/V family and the Great Room is on output #4 on the Russound. Under those conditions youwould set the variables as follows:


SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~2! SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~4!


If you do not have any audio switching equipment in this room then leave the two variables set totheir default values of 0.


SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0! SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!


Just like the rules for the audio switching the video switcher variables are for controlling thevideo for the room. For example. Let's say you have a Shinybow HDMI switcher. That Shinybow has beenassigned device ID 5 in the A/V family and the Great Room is on output #3 on the Shinybow.Under those conditions you would set the variables as follows:


SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~5! SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~3!


If you do not have any video switching equipment in this room then leave the two variables set totheir default values of 0.


SetVariable|GCIRID_{{clientname}}~! SetVariable|GCIRDevice_{{clientname}}~!


These two variables are for controlling an IR device in the room. Let's say you have a cable box thatmust be controlled via IR in that room and you are using the GlobalCache driver to send that IR.Set the {{GCIRID_{{clientname}}}} server variable to the Control Family device ID that is assigned tothe IR port on the GC for the cable box and set the {{GCIRDevice_{{clientname}}}} variable to theGlobalCache database IR device name. Something like:


SetVariable|GCIRID_{{clientname}}~22! SetVariable|GCIRDevice_{{clientname}}~Cox Cable!


If you do not have any IR equipment in this room then leave the two variables set to their defaultempty values or just delete the commands.


SetVariable|movies_activeplayer_{{clientname}}~! SetVariable|netflix_activeplayer_{{clientname}}~! SetVariable|amazon_activeplayer_{{clientname}}~! SetVariable|av_activedvr_{{clientname}}~!


These four variables are examples of how you would assign a video player to the room. Set these servervariables to the A/V family device id for each of the players that are being used. If you are not usingthese devices then leave them blank or just delete them from the macro. Use similar logic for other AVdevices that are unique to this room. Similar to the following:


SetVariable|movies_activeplayer_{{clientname}}~6! SetVariable|netflix_activeplayer_{{clientname}}~9! SetVariable|amazon_activeplayer_{{clientname}}~12! SetVariable|av_activedvr_{{clientname}}~31!


If you only have one playback device for the whole home then it would be best to move the settingof these variables into the watch cyclestates since you will only have to define the variable once.
Everything below this line is the actual commands that will get imported into the Zones cyclestates.Lines that begin with two are treated as comments are are ignored.The lines are formatted as three tab delimited columns. Column #1 is the State Value.Column #2 is the State Name. And Column #3 is the server macro that gets executed.
If you want to edit this file directly please use a good text editor like NotePad++ and you caneasily break these lines into readable code. Or just input this file into myServer and make your edits there.

1 Den Macro|SetVariable|zones_activezone_{{clientname}}~Den!SetVariable|zones_activezonename_{{clientname}}~den!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

2 Great Room Macro|SetVariable|zones_activezone_{{clientname}}~Great Room!SetVariable|zones_activezonename_{{clientname}}~greatroom!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

3 Kitchen Macro|SetVariable|zones_activezone_{{clientname}}~Kitchen!SetVariable|zones_activezonename_{{clientname}}~kitchen!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

4 Loft Macro|SetVariable|zones_activezone_{{clientname}}~Loft!SetVariable|zones_activezonename_{{clientname}}~loft!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

5 Master Bath Macro|SetVariable|zones_activezone_{{clientname}}~Master Bath!SetVariable|zones_activezonename_{{clientname}}~masterbath!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

6 Master Bedroom Macro|SetVariable|zones_activezone_{{clientname}}~Master Bedroom!SetVariable|zones_activezonename_{{clientname}}~masterbedroom!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

7 Office Macro|SetVariable|zones_activezone_{{clientname}}~Office!SetVariable|zones_activezonename_{{clientname}}~office!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

8 Study Macro|SetVariable|zones_activezone_{{clientname}}~Study!SetVariable|zones_activezonename_{{clientname}}~study!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

9 Theater Macro|SetVariable|zones_activezone_{{clientname}}~Theater!SetVariable|zones_activezonename_{{clientname}}~theater!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

10 Veranda Macro|SetVariable|zones_activezone_{{clientname}}~Veranda!SetVariable|zones_activezonename_{{clientname}}~veranda!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_audio_switcher_output~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_id~0!SetVariable|{{zones_activezonename_{{clientname}}}}_video_switcher_output~0!SetVariable|GCIRID_{{clientname}}~!SetVariable|GCIRDevice_{{clientname}}~!SetVariable|movies_activeplayer_{{clientname}}~!SetVariable|netflix_activeplayer_{{clientname}}~!SetVariable|amazon_activeplayer_{{clientname}}~!SetVariable|av_activedvr_{{clientname}}~

Naming the webclient:

To use functions specific to a given webclient, best is to name the client.  To do so, in the myUI.Phones (or Tablets) sample webpages, go to the Home page, click on the Menu, click on "Allonis".  You can set the clientname there.

Adding comments in Macros:

Put
?|
at the start of the line. Everything after that will be ignored until the next
!
delimeter

Shut off myServer Autostart on Windows launch:

Because myServer require elevated rights to run they cannot be started by placing a shortcut to the exe in the PCs startup folder. Instead, they get started as a Scheduled Task that runs on Windows Login. Go into the Control Panel / Admin Tools / Task Scheduler / Task Scheduler Library. You will see the task defined there that starts myServer on login. Delete that task. If you have already installed myServer you will see a task there for starting it too. Leave that one alone.

Macro

usage is 
sample.macro|p1value~p2value~p3value etc..

Inside the macro
p1value is <P1>
p2value is <P2>
p3valus is <P3>

Execute on myServer startup:

Create a Macro called System.Startup and that will automatically get executed every time the server starts up.

In the System.Startup macro if you need a delay then use the BackgroundMacro| command instead of Macro|. Then it won't tie up the system, waiting for the pause to complete.

BackgroundMacro|Pause|15!Do This!Then Do That....

Example:

Run|Program~<Program.exe>~<optional arguments>

or
Stop|<program name> (example:chrome)

You can also do something like:
Run|taskkill.exe~/F /IM chrome.exe

Playing sounds on the client device:

The sound files have to be in the path relative to the web app's root or a full URL.

For files local to the web app. For example create a folder called myServer\HTML\Ipad\Sounds then use 

WebCmd|{{clientname}}~Playsound|sounds/test.mp3

If the sound files are in the myServer\Sounds folder then you need to use the following full URL and grab the sound via the system web server. 

WebCmd|{{clientname}}~Playsound|http://<<myserver ip addess>>:6246/sounds/test.mp3

Shut down a chrome instance:

Run|taskkill.exe~/F /IM chrome.exe

Shut down myServer and Windows:

Use the myServer command Shutdown to gracefully shutdown myServer.

User the myServer command PowerDown to gracefully shutdown myServer and then gracefully shut down Windows and the PC.

Sending a popup message to all connected clients (or just the one addressed):

webcmd|all~toast|info~Hello~World~5000

Sending a request for the client to speak:

webcmd|all~Speak|hello world

Note you can target on client device:  webcmd|myclient1~Speak|hello world

Set the clientname on the device first (see above)

Schedule Tasks:

Create your scheduled tasks using the Task Schedules editor under the Schedules Tasks button on the server menu bar. Or use the Scheduler scenes that are part of the sample web apps. Much easier way to create and maintain the scheduled tasks than the legacy plugin "MLSchedule".

Scripting:

If you are using the legacy plugin you would use the MLScript|Script... command syntax. When you switch to using the V4 scripting you change MLScript| to Scripting| and everything else remains the same.

The scripts are stored in the database. However if you can make calls to external script files. Just pass the full path to the script file as the first parameter. e.g. Scripting|scripts\myscript.vbs. Then you can maintain all your scripts outside of myServer.

myServer adds the functionality of the legacy MLScript plugin directly into myServer. You will see a new "Server Scripting" button on the main toolbar. The new command verb is called "Scripting" and it works just like the old plugin did.


Scripting|NameOfScript~NameOfSubroutine(Optional)~Param1(Optional)~Param2(Optional) etc.

The Script Library window has an import feature that will allow you to import your old scripts from the legacy plugins database file.

The one new option in this is that the "NameOfScript" can reference an external .vbs file. It will always try to resolve the name with the internal database first. If the "NameOfScript" does not exist it checks to see if it is really a file name.

Display a text file in the infinite scroller

Example: You have a text file written from my DSC alarm events (window open, door open, etc.) and would like to display the file in a scrollable text box. 

You could write a MLScript that would read in the contents of the text file and then store it in a server variable. Once the data lives in the server variable, just reference that variable in the text scroller object. Once that is working you could set a timer or other automation rule to periodically run the script to update the variable. Use the generic list infinite scroller type to display.

Basic example of scripting:

Scripting|Testing~SetInternetUsageVariables~foo

where Testing is the name of the script as defined in the scripting library module
and
where foo is the parameter that is passed to the sub.

Example of VBScript open a text file and then write out the server variables and close the file:

Set objFSO=CreateObject("Scripting.FileSystemObject")

outFile="c:\data\nowplaying.txt"
dim np
np = myServer.GetVariable("weather_forecast_7_dayf") 
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write (np)
objFile.Close

 VBScript How to (click to Read)

myScript example:

How to have set-up a script on myServer which reads the contents of a file into an myServer variable (or, preferable, a series of variables).

Option Explicit
Const ForReading = 1
Dim objFSO, objReadFile, filecontents
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile("C:\TextToRead.txt", ForReading, False)

Do Until objReadFile.AtEndOfStream
  filecontents = objReadFile.ReadLine
  parts = Split(filecontents, " ")
  MLServer.SetVariable cstr("light_" & parts(0)), cstr(parts(1))
Loop
objReadFile.close
Set objFSO = Nothing
Set objReadFile = Nothing

 

Rebooting Remote Client PCs:

Rebooting is easy using this command. Substitute the number 2 for the appropriate number for your AV driver

AV|2~Run~shutdown~/r /t 1

Ejecting the tray should work as long as your player software supports it. For example for PowerDVD and the command to use is:

AV|1~Eject

 

Background Macros:

Any Macro call can be turned into a Background Macro simply by changing Macro| to BackgroundMacro|.

The only difference is that Background Macros are run in their own thread and will not tie up the main server process while running. Background Macros are useful for long command sequences that have embedded delays in them.

Macros and BackgroundMacros are nothing more than strings of server commands separated with exclamation marks "!" as the delimiter. e.g. Macro|Command1!Command2!Command...

Example:

BackgroundMacro|
If|IsEqual##{{Program1_enable}}##False####BackgroundMacro|Run_Program_1!
If|IsEqual##{{Program2_enable}}##False####BackgroundMacro|Run_Program_2!
.
.
.
If|IsEqual##{{Program24_enable}}##False####BackgroundMacro|Run_Program_24

 

Variable Names

myServer variable names cannot include any spaces or periods (.) .  Case is not important because the server converts all variable names to lower case.

Purge Variables

We cannot use {{variable*lastupdated}} and {{variable*lastchanged}} as the asterisk is part of a jQuery selector and is one of the "holy" characters. So instead it is implemented using a pair of dashes like {{variable--lastupdated}} and {{variable--lastchanged}} instead.

PurgeVariables|<<days>> will delete all variables that have not been updated within the last <<days>>

Executing DOS commands on the Server:

Run|<<program name>>~<<optional parameters>> -- Run the program in a normal window

RunHidden|<<program name>>~<<optional parameters>> -- Run the program in a hidden window

Stop|<<program name>> -- stop/kill the program

 

 GetURL and PostURL commands:


To control Sage use the command

CODE: SELECT ALL

GetURL|http://sage:This email address is being protected from spambots. You need JavaScript enabled to view it..1.9:8080/sage/SageCommand?context=001d6a4cf75e&command=Pause


You'll probably want to create a system macro called Sage that looks like

CODE: SELECT ALL

GetURL|http://sage:This email address is being protected from spambots. You need JavaScript enabled to view it..1.9:8080/sage/SageCommand?context=001d6a4cf75e&command=<P1>


and then use commands like
Sage|Play
Sage|Pause
etc.

 

Logging:

Data logging feature for capturing data items over time.

The myServer command is called Logger and supports the following command set (also in command builder)

a) Logger|Log~ItemClass~ItemName~ItemValue~(Optional)Comment
This command will add a new data log entry into the database. Logged items are classified by an Item Class and an Item Name e.g. Weather, Current Temp.
When an entry is logged the following 8 data items are stored into the Logger table
1) ID - The unique data logger item id (automatically generated)
2) Class - The item class
3) Item - The item Name
4) EventTime - The Date and Time the entry was added
5) Value - The value of the data
6) DecimalValue - If the value logged is numeric the value is converted to a decimal value and stored also it its numeric format
7) Duration - The time in seconds since the last time an event of the same Class and Name was logged
8) Note - The optional comment that can be stored with the data entry

b) Logger|Delete~ItemClass~ItemName~DeleteCmd~KeepAmount
Provides a way to manually delete logged data items.

c) Logger|Browse~ItemClass~ItemName~BrowseCmd~PageSize
Provides a way to browse the stored data items.

d) Logger|SetMax~ItemClass~ItemName~MaxEntries
Allows you to set the maximum number of logged entries for any given Class and Item. The system will automatically default to a maximum of 1024 items per Class/Name if not manually set.

e) Logger|Purge
This command is run automatically by myServer every morning as part of the maintenance activities. It automatically purges all old data entries out of the database while observing the MaxEntries rules.

What's this all good for? Well, a lot of things. For instance I created a simple automation rule that once every minute now logs the current temperature in my Kitchen zone, the current outside temperature and the HVAC state for that zone. I can now keep track of just how hard my HVAC is running.

It looks like
Whenever CurrentMinute Changes Value
Then
Macro|
Logger|Log~Climate~Kitchen Temp~{{climate_1_temprnd}}!
Logger|Log~Weather~Outdoor Temp~{{weather_current_tempf}}!
Logger|Log~Climate~Kitchen State~{{climate_1_hvacstate}}

Here's what is getting logged

CODE: SELECT ALL

ID     Class       EventTime                 Item              Value  DecimalValue  Duration
3      Climate     2013-08-03 15:13:00.563   Kitchen State     Cool   0             0   
6      Climate     2013-08-03 15:14:00.277   Kitchen State     Cool   0             59   
9      Climate     2013-08-03 15:15:00.080   Kitchen State     Cool   0             59   
1      Climate     2013-08-03 15:13:00.457   Kitchen Temp      78     78            0   
4      Climate     2013-08-03 15:14:00.273   Kitchen Temp      78     78            59   
7      Climate     2013-08-03 15:15:00.077   Kitchen Temp      78     78            59   
2      Weather     2013-08-03 15:13:00.560   Outdoor Temp      95     95            0   
5      Weather     2013-08-03 15:14:00.277   Outdoor Temp      95     95            59   
8      Weather     2013-08-03 15:15:00.080   Outdoor Temp      95     95            59   



The possibilities are wide open.

Right now you are only able to browse the events but there are some very cool new things in development that will let you look at this data in all sorts of ways. You can also access this data via the web server but that's a more advanced topic I'll save for later.

 

myServer Math command:

Math|Divide~Output Variable Name~First Number~Second Number
or
Math|Divide~result~{{blml2hs_blmhs zonnepaneel_value}}~10

The server variable {{result}} will contain the computed value. Change {{result}} to any variable name that makes sense.

 
Page 1 of 2