Announcement

Collapse
No announcement yet.

Installing HS4 on Linux

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Installing HS4 on Linux

    HS4 for Linux is a modified version of HS4 that runs under Linux. It is full HS4 with the following exceptions:

    * No VBScript support (.txt scripts). VB.Net scripting and C# scripting is supported

    HS4 for Linux does not require a distinct license. Your HS4 standard, HS4 SEL/Plus, or PRO license will work, though note that you can only use one license per installation.

    Linux can be a challenge for non-technical users, the Linux version of HS4 is targeted to the more technical user.

    It has been tested under Debian and Ubuntu.

    These instructions are for a Debian 7 install.
    1. Install Debian or Ubunutu per it's instructions. Ubuntu on WIndows 10 will also work.
    2. Install the following packages that are required by HS4:
      Note that MONO is required, but it is already installed with the Debian distribution. However, a few packages are missing:
      apt-get install mono-devel
      apt-get install mono-vbnc
      apt-get install flite
      apt-get install chromium
      apt-get install aha
      apt-get install ffmpeg
      apt-get-install aplay
    3. If brltty is installed, this must be removed in order for a Z-Stick to work:
      apt-get remove brltty
    4. Download the latest HS4 tar file, latest release can be found here:https://docs.homeseer.com/display/HSPI/Release+Notes
    5. Download the latest "Linux Standard" tar file.
    6. Change directory to where you want to install it.
      Our default is:ch /usr/local
    7. untar with the command:
    8. tar xvf tar_filename
    9. Change directory into the newly created HomeSeer folder:
      cd HomeSeer
    10. Run HS4 using the "go" script:
      ./go

    Note that HS4 needs to run as root or with sudo (script uses sudo). This is because it listens on a port for the web server and MONO requires root to do this.

    Check the startup log for errors. If all is ok, you can access the web interface on a browser by accessing the IP address if the Linux system with:

    http://IP_ADDRESS

    By default, HS4 starts listening on port 80. If you happen to have the Apache web server installed port 80 may be in use. You can edit the HS4 config file in Config/settings.ini and change the setting:

    gWbSvrPort=80

    To a different port, then restart HS4.

    You can shut down HS4 from the console by hitting enter to get a prompt and then entering: shutdown
    website | buy now | support | youtube

    #2
    If you want aspx page to load ok on Linux :

    1. Ssh into hs4 box.

    2. Type this :

    Code:
    sudo nano /usr/bin/vbnc
    3. Remove every thing here and paste this:

    Code:
    #!/bin/bash
    exec /usr/bin/mono --gc-params=nursery-size=64m $MONO_OPTIONS /usr/lib/mono/4.5/vbc.exe "$@"
    So it'll look like in the picture.

    4. Press ctrl+o to save then hit enter.

    5. Press ctrl+z to leave nano.
    Attached Files

    Comment


      #3
      apt-get install chromium indicates that the package is not available and replaced.

      ---
      John

      Comment


        #4
        Actually it ask to install chromium-bsu
        which is a game.

        https://en.m.wikipedia.org/wiki/Chromium_B.S.U.

        This info have been copy pasted from the old post made by hst about how to install Hs3 on linux. I think it is time now to test your instalation method ...HST.

        You’ll also won’t get an up to date mono with this method.
        Please inform user how to install mono from a ppa, or guide them to the linux mono install page.

        Comment


          #5
          apt install chromium-browser

          Comment


            #6
            From my limited knowledge, the requirement for root when opening ports is only for "well known" ports, < 1024.

            If you set the configuration to open a high port, say 8080 or 9443, would that not allow running as a non root user?

            Comment


              #7
              Originally posted by Fellhahn View Post
              From my limited knowledge, the requirement for root when opening ports is only for "well known" ports, < 1024.

              If you set the configuration to open a high port, say 8080 or 9443, would that not allow running as a non root user?
              Yes. HS with non root user with high port works fine. never had any problems.

              Comment


                #8
                On Ubuntu 20.04.1 LTS

                sudo apt-get install aplay
                Reading package lists... Done
                Building dependency tree
                Reading state information... Done
                E: Unable to locate package aplay



                Comment


                  #9
                  Originally posted by rjh View Post

                  By default, HS4 starts listening on port 80. If you happen to have the Apache web server installed port 80 may be in use. You can edit the HS4 config file in Config/settings.ini and change the setting:

                  gWbSvrPort=80

                  To a different port, then restart HS4.

                  You can shut down HS4 from the console by hitting enter to get a prompt and then entering: shutdown
                  I do have apache installed with port 80 in use. I did edit Config/settings.ini.

                  There was no line such as gWbSvrPort=80, so i added it under [Settings] then saved.

                  Upon restart I still get "02:22:41:5364:[Web Server]->Web Server started on port 80".

                  Please note this is also a typographic error, the command should be gWebSvrPort=##.

                  Comment


                    #10
                    Thanks for sharing..


                    Devoir

                    Comment


                      #11
                      For what it's worth, I have Homeseer4 running in docker successfully.

                      I'm using this image: https://hub.docker.com/r/e1ite/docker-homeseer4

                      And here's my docker compose

                      Code:
                      version: "3"
                      services:
                        homeseer:
                          container_name: homeseer
                          image: e1ite/docker-homeseer4:latest
                          restart: unless-stopped
                          ports:
                            - 9898:80    # remap homeseer port to 9898 since 80 is taken by Traefik reverse proxy
                            - 10200:10200
                            - 10300:10300
                            - 10401:10401
                            - 11000:11000
                          devices:
                            - /dev/ttyUSB0:/dev/ttyUSB0 # Zwave
                            - /dev/ttyUSB1:/dev/ttyUSB1 # Zigbee
                          volumes:
                            - "/mnt/docker/homeseer:/HomeSeer"
                            - "/etc/localtime:/etc/localtime:ro"
                          networks:
                            - infrastructure
                      
                      networks:
                        infrastructure:
                          external: true
                      The only issues that I have run into is that if its run in host/bridge mode, it can't see certain kinds of network devices, like Sonos. However if I run it in macvlan mode so it gets its own IP, it can't access the HS store.

                      Still working on that issue. Have it running in host/bridge most for right now.

                      The other issue is that Homeseer's basic auth doesn't play well with reverse proxies. Trying to figure out a way to disable it or get http forward auth working. I don't believe this is an issue limited to docker though

                      Comment


                        #12
                        couple of question regarding the installation:

                        apt-get install mono-devel
                        apt-get install mono-vbnc

                        For HS3 I used
                        apt-get install -y mono-vbnc
                        apt-get install -y mono-xsp4 (used to run ASP.NET 4.0 applications)
                        This was good enough. Isn't installing mono-devel a little bit of an overkill?

                        apt-get install aha
                        from the description: reads the Input from a file or stdin and writes HTML-Code to stdout.
                        Where is this used? I haven't used this for HS3

                        apt-get-install aplay
                        from the description: command line playback and recording
                        Is this used for the tts same as flite?

                        Comment


                          #13
                          Just my two cents.
                          I don't run HS3 with root or sudo because imo that's bad practice.




                          Code:
                          useradd homeseer
                          chown -R homeseer:homeseer /opt/HomeSeer
                          
                          #To run HS on port 80 and as a different user I used this:
                          usermod -a -G dialout homeseer
                          
                          #To run certain scripts from HomeSeer you can install sudo and use this to modify the HomeSeer rights in sudo
                          echo 'ALL ALL = NOPASSWD: /usr/sbin/etherwake' >> /etc/sudoers.d/HomeSeer
                          
                          # Configure AUTOSTART
                          echo '[Unit]' >> /etc/systemd/system/homeseer.service
                          echo 'Description=HomeSeer HS3 Home Automation' >> /etc/systemd/system/homeseer.service
                          echo 'Documentation=https://homeseer.com/support-home/' >> /etc/systemd/system/homeseer.service
                          echo 'After=network-online.target remote-fs.target' >> /etc/systemd/system/homeseer.service
                          echo 'Before=multi-user.target' >> /etc/systemd/system/homeseer.service
                          echo '' >> /etc/systemd/system/homeseer.service
                          echo '[Service]' >> /etc/systemd/system/homeseer.service
                          echo 'User=homeseer' >> /etc/systemd/system/homeseer.service
                          echo 'WorkingDirectory=/opt/HomeSeer' >> /etc/systemd/system/homeseer.service
                          echo 'ExecStart=/usr/bin/mono HSConsole.exe --log' >> /etc/systemd/system/homeseer.service
                          echo 'StandardOutput=syslog' >> /etc/systemd/system/homeseer.service
                          echo 'StandardError=syslog' >> /etc/systemd/system/homeseer.service
                          echo 'SyslogIdentifier=HS3' >> /etc/systemd/system/homeseer.service
                          echo 'Restart=on-failure' >> /etc/systemd/system/homeseer.service
                          echo 'RestartSec=30' >> /etc/systemd/system/homeseer.service
                          echo 'KillMode=none' >> /etc/systemd/system/homeseer.service
                          echo 'TimeoutStopSec=300' >> /etc/systemd/system/homeseer.service
                          echo 'ExecStop=/opt/HomeSeer/scripts/HomeSeer/Stop_HomeSeer.sh' >> /etc/systemd/system/homeseer.service
                          echo 'AmbientCapabilities=CAP_NET_BIND_SERVICE' >> /etc/systemd/system/homeseer.service
                          echo '' >> /etc/systemd/system/homeseer.service
                          echo '[Install]' >> /etc/systemd/system/homeseer.service
                          echo 'WantedBy=multi-user.target' >> /etc/systemd/system/homeseer.service
                          systemctl enable homeseer.service
                          systemctl start homeseer.service
                          
                          # LOGGING
                          touch /var/log/homeseer.log
                          chown root:adm /var/log/homeseer.log
                          chmod 644 /var/log/homeseer.log
                          touch /etc/logrotate.d/homeseer
                          echo '/var/log/homeseer.log' >> /etc/logrotate.d/homeseer
                          echo '{' >> /etc/logrotate.d/homeseer
                          echo ' rotate 4' >> /etc/logrotate.d/homeseer
                          echo ' weekly' >> /etc/logrotate.d/homeseer
                          echo ' missingok' >> /etc/logrotate.d/homeseer
                          echo ' notifempty' >> /etc/logrotate.d/homeseer
                          echo ' delaycompress' >> /etc/logrotate.d/homeseer
                          echo ' compress' >> /etc/logrsysteotate.d/homeseer
                          echo ' create 0644 root adm' >> /etc/logrotate.d/homeseer
                          echo '}' >> /etc/logrotate.d/homeseer
                          echo ''if \$programname == \'HS3\' then /var/log/homeseer.log'' >> /etc/rsyslog.d/homeseer.conf
                          echo '& stop' >> /etc/rsyslog.d/homeseer.conf
                          systemctl restart rsyslog.servic
                          Hope this can help someone

                          Comment


                            #14
                            Originally posted by citrixmeister View Post
                            On Ubuntu 20.04.1 LTS

                            sudo apt-get install aplay
                            Reading package lists... Done
                            Building dependency tree
                            Reading state information... Done
                            E: Unable to locate package aplay



                            sudo apt-get install alsa-base alsa-utils

                            Comment


                              #15
                              How to get it start at system start

                              Code:
                              nano homeseer.service
                              -------- Insert -------------------
                              [Unit]
                              Description=HomeSeer Service
                              
                              [Service]
                              ExecStart=/usr/bin/mono /opt/HomeSeer/HSConsole.exe --log
                              WorkingDirectory=/opt/HomeSeer
                              Restart=on-failure
                              RestartSec=10
                              
                              [Install]
                              WantedBy=multi-user.target
                              -------- end -------------
                              cp homeseer.service /etc/systemd/system
                              systemctl enable homeseer
                              systemctl start homeseer
                              systemctl status homeseer

                              Comment

                              Working...
                              X