I've been looking at running Homegenie on my new Raspberry Pi 3. I am still new to Pi, Raspbian, Linux, and/or Python.... and I am still horribly inept. Thank you for the link. I saved it and will browse through the posts. I failed at getting HG to run for me (so far). I'll see what I can do with Domoticz. Does it also use a CM15A as an X10 interface?
After many years of screw ups, I like to create recipes for setting up hardware and programs ( ...and still screw up). Sometimes a Capitol s for a lower case S can make all the difference. For RPi and Homegenie, my recipe has almost turned into a cookbook. Not sure this will help others or set the framework for installing other HA programs, but take a look. If it helps, great, otherwise deleting is just electrons.
I will throw in whatever help I can. There is a forum for HomeGenie
https://homegenie.club I notice some of the member names here are also on the Homegenie forum. Many of them have more knowledge that I do. Members on the .club forum have created install recipes as well.
OVERVIEW
1. Document steps as you go through the process
2. Create a working SD Card image for Raspberry PI
3. Clone image to local computer as a starter base.
4. Install program(s) such as HomeGenie
5. Backup HomeGenie configuration
6. Clone SD Card image with HomeGenie
RPi 3B Raspian SETUP
Using a Windows 10 machine. There are two programs needed for setup and communications with your RPi.
Etcher – This program will transfer the image file to a micro SD card.
https://etcher.io/PuTTY – this is a popular terminal program to access an RPi via SSH.
https://www.putty.org/CLONING BACKUPS
Win32 Disk Imager - for backups and clones later in the process
https://sourceforge.net/projects/win32diskimager/Instructions to use:
https://pimylifeup.com/backup-raspberry-pi/CREATE IMAGE
Go to
https://www.raspberrypi.org/downloads/raspbian/Download the Raspian Stretch image to a local machine (Win10 is OK). Normal placement is in \downloads.
Note Etcher will read the .zip file directly. No need to extract.
Insert SD card into USB adapter and then in to USB port on local machine. Note: new cards will show as a drive letter in Windows Explorer.
(Used cards will cause a format popup. Do not format. The best practice is to use <Windows Administrative Tools><Computer Management><Disk Management> to delete partitions and create one new volume.)
Start Etcher to transfer the Raspian image onto a MicroSD card
From Etcher menu select image .zip file to load.
Etcher shows the drive that will be written to. So far Etcher sees the correct drive. However, an added thumb drive may confuse it. So, pay attention.
Click on start. Burning takes about 20 minutes on my laptop.
The RPi must be powered down.
Remove the SD card from the adapter and insert in the RPi board. Note: the printed side of the SD card should be visible from the solder side of the pc board.
Apply power to the RPi. I have a monitor connected to the RPi and can see the boot process. Also, a USB wireless keyboard and mouse are added to compete setup.
CHANGE PASSWORDS
Changing passwords in Raspian is a good security practice. There are two default users: pi and root
From the on-screen menu open a terminal session (on top menu bar). Enter the following
sudo passwd pi <enter>
Enter new UNIX password: NEWPASSWORD <enter>
Retype new UNIX password: NEWPASSWORD <enter>
Passwd: password updated successfully
Now again for root
sudo passwd root <enter>
Enter new UNIX password: NEWPASSWORD <enter>
Retype new UNIX password: NEWPASSWORD <enter>
Passwd: password updated successfully
CHANGE HOSTNAME, INTERFACES, and LOCALIZATION
I like to change the Hostname and set up the basics here.
From the main menu go to [preferences][Raspberry Pi Configuration]
On the System tab enter the new Hostname (RPi-HGvxx)
Unclick Logon as Pi user (good security practice)
Click to the Interfaces tab
Click enable SSH.
This allows text terminal access from another computer using PuTTY. I use this to install additional programs like Homegenie.
Click on Localization
Click on each of the buttons and make needed changes to localize the RPi board.
Click OK, The RPi will ask if reboot now?
Click OK to reboot
SETTING FIXED IP ADDRESS
I like fixed IP addresses where servers are involved. I currently have my internet router set to allow 64 DHCP addresses. With the proliferation of smart devices, I may need to expand this. With fixed IP addresses I don’t need to log into the router and look up a device IP address. Routers, VOIP, and infrastructure devices (UPSs, PDUs, and Server IO boards take up a few IP addresses. There is still plenty in a 255 subnet.
On the main menu bar, right click on the network icon. You should see a menu option for Wireless and Wired Network Settings. Click on this.
On the popup select [eth0]
Unclick Automatically configure empty options
For now, click on disable IPv6
Enter IPv4 address xxx.xxx.xxx.xxx
Enter Router xxx.xxx.xxx.xxx (this is the gateway)
Enter DNS Server xxx.xxx.xxx.xxx (this can be the gateway or an external DNS)
Enter DNS Search xxx.xxx.xxx.xxx
Click Apply
Note on WIFI – I have as a practice used DHCP addresses for WIFI. Because devices that use WIFI tend to be mobil and may access multiple networks. However, in the case of RPi a fixed address can be used for WIFI in a set location.
Reboot the RPi, either from the main menu on the local screen or from a terminal session enter:
Sudo reboot now
UPDATING Raspian Stretch.
Note: as a simple explanation, Linux is a collection of packages, libraries, and lots of code. Often a new or revision of a package will use the most recent libraries. If your copy of Raspian is not current, package installers will get fussy. So, update and upgrade before installing new packages.
In a terminal session on the local machine or through SSH (PuTTY)
Login as pi
Enter the following. At points you will be asked to answer y.n. Y<enter>
sudo apt-get update
sudo apt-get upgrade
Now Raspian is running on the most recent releases.
ADDING RASPIAN PACKAGES
Adding a file manager-I like Midnight Commander as a quick and dirty way to move around Linux in a terminal session. Old school. It can copy files to/from a thumb drive. Edit files on the fly.
Go to main menu select [Preferences][Add/Remove Software]
In the search box enter mc<enter>
Select Midnight Commander
Click on Apply
RPi will ask for your password and then install.
On the main menu an option will appear [System Tools] hover on that and MC will show.
(MC can also be installed in a terminal session much faster with
sudo apt-get install mc
)
Adding XRDP-this little gem allow access to the RPi using Remote Desktop Connector in Windows <Windows Accessories><Remote Desktop Connector>. I just use the IP address to connect.
In a terminal remove realvnc (not a fan of VNC anyway)
sudo apt-get purge realvnc-vnc-server
Add
sudo apt-get install xrdp
At this point the RPi can be accessed in either GUI mode or TTY without a monitor or keyboard connected.
CLONING A BASE IMAGE
I like to save an image clone with passwords, IP addresses, et al. This way, I do not need to go back to the beginning and start all over if I screw up (which I do often).
With Windows Explorer create a folder to save your images. Do not put folders in One Drive as the images are 32GB. C:\MyImages is fine.
Start Win 32 Disk Imager <Image Writer> on the windows main menu.
Insert a SD Card.
(Used cards will cause a format popup. Do not format. The best practice is to use <Windows Administrative Tools><Computer Management><Disk Management> to delete partitions and create one new volume.)
Follow the instructions link for CLONING BACKUPS
Under the Image File box, click on the little folder to navigate to your MyImages folder. Create a meaningful image name, like RPi-Base 20180121 (YYYY,MM,DD).
Click open
Win 32 Disk Imager should have auto detected your SD Card at this point. You are ready to copy.
Click Read.
Cloning takes a while, so good time for a break with your favorite beverage.
HOMEGENIE SETUP
Insert a SD Card into your RPi with the base image. Power up.
You should be able to log into RPi with SSH to complete the following steps.
This a copy of the instructions from the HomeGenie web site. Currently there is a V1.1.15 that I cannot get to work. Use r526 as below. It works for me.
https://genielabs.github.io/HomeGenie/#/get_startedwget
https://github.com/genielabs/HomeGenie/releases/download/v1.1-beta.526/homegenie-beta_1.1.r526_all.debsudo apt-get update
sudo apt-get upgrade (I added this)
sudo apt-get install gdebi-core
cd Downloads
sudo gdebi homegenie_1.1.15_all.deb
At a point you will be asked to answer y.n. Y<enter>
Homegenie should be up and running.
From a terminal, using top. HG will show as main.
HomeGenie will be installed in the /usr/local/bin/homegenie folder. Once installed, HomeGenie UI can be opened by entering the following URL in your web browser: http://<linux_box_address>/ (where <linux_box_address> is the name or ip of the host where homegenie is installed). -Gene
With the base configuration as above, HomeGenie will bind to port 80. I use the IP address in browser. It will change to this when connecting:
http://IPaddress/hg/html/index.htmlFor me, Windows Edge, Internet Explorer, Chrome, Firefox all work just fine with HG on an RPi. (I had a lot of browser trouble with HG on Windows.
USING HOMEGENIE
The Homegenie web site has documentation on set up and use. I will cover some of the things I do and a perspective to mentally translate from AHP to HG.
https://genielabs.github.io/HomeGenie/#/aboutSETUP
Top left corner is Configuration, click on it. In the drop down click on Settings.
Click on the plus sign to disable UP&P and ZWave. (Not using now)
Click on the plus sign to Enable X10. For me both the CM15 and CM11 /w a USB to Serial convertor work. Use the drop down to select the type on PLC interface.
Click on the House Codes you need. (These will show up through out HG as you set up)
Optional – click on the plus sign for Weather Underground, click on options. Enter options locations, language, key. Note: there is an issue here with WG. It sends data as selected on WG in metric or imperial units for temperature only. All other metrics are only sent in metric form. Other weather services do the same, Dark Sky…. It would be nice if HG did the conversion in the widget but does not do this now.
I handle all IR sensors through TM751 and R501 modules, so I don’t use any of the HG set ups for sensors. The PLC comes through to the interface and acts on these as any other command.
MAINTENACE
There is a bunch of stuff here, I will cover three that are important to me for starting with HG.
Location - Set the location for latitude and longitude (in decimal format). This sets the variables @SolarTimes.Sunrise and @SolarTImes.Sunset These variables are case sensitive and remember the little DOT.
Log File – Downloading the log file is a pain. In Linux there must be as many ways as there are users to list the log file. I use MC in SSH as a quick and dirty way to look at it. MC will start in the Pi subfolder. Go up to the root directory. Keep clicking until you get to /usr/local/bin/homegenie/log. There you will see homegenie.log. F3 to open. <END> to see the last entries. F10 to exit. If I am troubleshooting, this method is much easier. Just leave SSH open with MC running. BTW – HG poops out a lot of stuff in the log file.
Configuration and Data – this creates a back up and restore of you set up. Like the runtime file in AHP. When you click on Backup, it will download a file to your /Downloads directory on the local PC. To restore, just click restore and select the backup file. HG will then restore all your hard work. Moreover, if your backup before adding new HG packages, you can revert to you original save point if you find that a HG package is not what you want.
Configure/Groups and Modules is like the left-hand bar in AHP. Add groups like AHP rooms. Now HG is not too fussy about groups and module names. However, the voice control is. Names like Jims big lts does not register well – Jims big lights will.
Scheduler – functionally Scheduler is the same as setting up timers in AHP. It takes some getting use to. Name format is important, no spaces, words can be separated by DOTS. When I create a new item, I use the Custom Cron Expression Event Type. Clicking through the steps in the lower left corner just works better for me this way. The variables @SolarTimes.Sunrise and @SolarTimes.Sunset are invaluable here. You can also do some math like @SolareTImes.Sunrise-60 to control something an hour before sunrise. Don’t be afraid – just delete.
Programs – This is like Macros in AHP. Although HG does not enforce this, I use the no spaces, DOT format here for names. I don’t use the auto recorder. Point and click triggers and program in the editor works for me. I will digress here a little. For IR Sensors I create a room in Groups and then add modules for each sensor. Just leave as a switch, does not matter. All this does is associate a name with the house/unit codes. In the Program pane you can set up modules to turn on/off/dim. I must have hyper active electrons here that make a lot of noise, so I add a Pause (0) in between each step to give the PLC transmission a little extra quite time. Since, in my case all IR sensors come through PLC, I trigger from the module set up in the sensor room. Time window can be added as well using either set times or @SolarTimes.
WRAP-UP
Remember to backup your hard work in HG.
Also, making a clone of the SD Card is worthwhile. These take 32GB each, so disk space can get gobbled up fast.
Use sudo apt-get update and upgrade before installing new Raspian packages.
Currently, I am only using HomeGenie for X10 control. By comparison to AHP, it is like walking through a door to a whole new world. I just don’t know what the processing limitations on an RPi are for all these new features. HG has some inter HG communication feature that I want to check out, that will allow multiple RPis to run segments of the overall HA process.
Of the many HA programs out, HomeGenie is probably most like AHP. Some of the HA programs start with a blank screen staring at you (no eye balls). Also, HG is one of the few that has X10 natively. Most of the other require either Heyu or Mochad.
I like the Android version of HG. It is only a couple of bucks on Google Play. The app allows selective viewing of modules. It works. Unfortunately, there is not an iPhone app (yet)
HomeGenie was overall developed by one person who has more or less walked away. There were other people involved directly and indirectly. I just don’t know how much. There are some YouTube videos with a woman’s voice and Brit accent, that unless Gene used a computer voice control is not him. There is a gap, like AHP. Gene left. Two guys have been carrying HG for the last year or so. Recently a few more people with skills have jumps on board, so maybe there is a future.
In my mind, nobody has a lock on HA, so these programs can coexist and grow. Amazon is certainly filling out the space rapidly. One question is how much dependence on cloud computing do we want to have? My answer is, no matter how much Amazon does, human entropy will always have a group that want to go another direction. Nice to have some options.