Alfred Integration
GOAL: Control Homeseer through the excellent OSX tool called “Alfred”. This tool allows you to start an application or open a file with the least amount of key-presses. Really amazing, and I would encourage you to buy the power pack which is required for my Homeseer integration.
What can you do?
Start Alfred using your shortcut (like CMD+Space) and enter your command. “Home” is the keyword that starts the scripts on this page.
Examples
Control lights & devices
Check power consumption
Check car location
Check temperature and humidity
Control TV (IR – requires something like IRTrans)
How?
– The Alfred Extension calls my DJ_Alfred Homeseer script
– This Homeseer Alfred script will execute commands and return information
– The returned information is displayed via Growl
<add ppt slide showing who talks where>
Requirements
– Homeseer 2.5.x (probably works with earlier releases but I cannot test)
– OSX with Alfred + Powerpack (If you like Alfred the power pack is totally worth the few bucks!)
– Growl
Installation Summary
- Install Alfred extension and Homeseer scripts
- Configure Alfred extension
- Configure Alfred Homeseer
- Test
1. Install Alfred Extension & Homeseer Scripts
1a. Alfred Extension
Download Alfred extension here
Extract ZIP file and double click Homeseer.alfredextension
It will now install in Alfred
1b. Homeseer scripts
Download Homeseer scripts here
Copy HS-ALFRED-xx.zip to your Homeseer root folder. Now extract this zip. It will put the following files in the these locations:
– DJ_Alfred.ini to <homeseer>\Config\ folder
– DJ_Alfred_xx.asp to <homeseer>\html\Alfred\ folder
– DJ_Alfred_ControlPanel_xx.asp to <homeseer>\html\Alfred\ folder
– DJ_Alfred_ControlPanel.asp to <homeseer>\html\Alfred\ folder
– Images files to <homeseer>\html\Alfred\ folder
2. Configure Alfred Extension
The Alfred Extension configuration is stored in a file. It contains the Homeseer “IP location” (for internal and external access).
- Toggle Alfred (Command+Space?) and type “home settings”
This opens the DJ_Alfred_Config.txt in the Textedit application
Note: sometimes Textedit starts but doesn’t open. Force close it and run this step again.
Note: If Homeseer is not accessible through the internet, set ‘hsext’ to the same address as ‘hsint’.
Note: The homeseer user needs rights to execute events and control devices - Example of config file:
localip=10.1.1
hsext=144.122.201.87:3881
hsint=10.1.1.1:8080
user=hsalfreduser <– Note: You can create a special user in Homeseer
pwd=hsalfredpassword
localdebug=1
hsscript=DJ_alfred_10.asp <– Note: New Homeseer Alfred script? Update this line!
// ==================== HELP ====================
// LOCALIP = part of your local IP range
// Example: 10.1
// Example: 192.168.
// HSEXT = Full External IP address + Port number of Homeseer
// Example: 145.223.12.77:8080
// HSINT = Full Internal IP address + Port number of Homeseer
// Example: 10.1.1.10:80
// Example: 192.168.1.12:8080
// USER = Homeseer user for authentication
// Create a NEW user with basic rights in Homeseer
// PWD = Password
// LOCALDEBUG= Localdebug ON/OFF lets you enable local
// Script debugging (Alfred script on your Mac)
// HSSCRIPT= Homeseer script version
// ==============================================
3. SAVE and close this config file (Command-Q)
3. Configure Alfred Homeseer
Configure Homeseer script: In a browser, open
https://<homeseer_IP>/html/Alfred/DJ_Alfred_ControlPanel.asp
(this will forward you to the latest version of the actual controlpanel, taken from the .ini file)
The web-based configuration is the easiest way to setup, test and debug the script.
Alternatively: manually edit the DJ_Alfred.ini file in the <homeseer>\Config\ folder
SYNTAX
KeyWx = Keyword, Command, Device, EXECUTE, RETURN
EXAMPLE
KeyW4=switch , off , a14 , switch , status
KeyW5=switch , , , toggle , device name is now status
KeyW7=Temp , living , \10 , , Temperature name is string
KeyW9=TV , on , TV_Watch_Start , event , status
Execute The following commands will… | Return – following keywords will be replaced by… |
switch – switches ‘device’ to ‘command’ toggle – toggles ‘device’ event – runs event ‘device’ ir – send IR signal | status – ‘device’ status string – ‘device’ string value – ‘device’ value device – ‘device’ ID (like ‘A14’) devicename – ‘device’ Homeseer device name action – ‘execute’ |
4. Test your configuration
1. Test your configuration by using a web-browser. Go to:
https://<homeseerIP>/Alfred/DJ_Alfred_xx.asp?query=ini
The Homeseer script will recognize that you’re using a browser and not Alfred and therefore return more information. (getting a complicated web-page in a growl-message is unreadable ;-)
This will generate an error message (about how to use the ‘INI’ command)
Alternatively you can open the Homeseer Alfred configuration page and ‘run’ a saved command.
The results will display in the box below the configuration table.
2. Try again but now with ‘query=ini on’
3. Test a command based on your configuration
4. Now use Alfred to test a command
Default Commands
Not case sensitive! Default Keyword = “home“
Keyword ABOUT | About this extension |
Keyword INI ON Keyword INI OFF | (only when opening .ASP in web browser) ENABLE an overview of possible commands DISABLE an overview of possible commands (for debugging purposes) |
Keyword EDIT INI | Opens browser window with the web-based Alfred INI editor in Homeseer |
Keyword SETTINGS | Opens Alfred settings file in TextEdit |
Keyword DEBUG ON Keyword DEBUG OFF | ENABLE Homeseer ASP script debugging DISABLE Homeseer ASP script debugging |
Screenshots
Water usage today | Toggle Lamp A14 | Temperature Office | Power usage today |