Announcement

Collapse
No announcement yet.

Autostart Homeseer on Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Last edited by Pete; February 13, 2018, 09:09 AM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment


      #32
      Back to the original topic for a moment...

      I've used this template script: https://github.com/fhd/init-script-t...aster/template (docs here https://github.com/fhd/init-script-template).

      For me, variables as follows:

      dir="/opt/HomeSeer"
      cmd="./go"
      user="root"

      Then:
      chmod u+x /etc/init.d/homeseer
      update-rc.d homeseer defaults

      The advantage of this script is that it logs the terminal output to a standard location - /var/log/homeseer.log / .err

      Comment


        #33
        Originally posted by ARA View Post
        I'm still curious about your original error message.
        -A
        (code=exited, status=210/CHROOT)
        This is systemd complaining that you are changing the working directory without providing a user. If you specify a working directory you also need to specify a user. The simplest solution is to leave out the working directory line.

        So this service file works (assuming you have the homeseer directory in the default location of: '/usr/local/HomeSeer'):

        Code:
        [Unit]
        Description=HomeSeer Home Automation Server
        After=network.target
        
        [Service]
        ExecStart=/usr/local/HomeSeer/autostart_hs &
        Restart=on-failure
        
        [Install]
        WantedBy=multi-user.target
        HTH

        Adeux

        Comment


          #34
          Still stuck with HS4 AutoStart function....

          Tried...
          Click image for larger version

Name:	Screenshot from 2020-05-25 11-31-57.png
Views:	398
Size:	15.5 KB
ID:	1388417

          Then tried....
          Click image for larger version

Name:	Screenshot from 2020-05-25 11-34-02.png
Views:	354
Size:	9.8 KB
ID:	1388418

          I have this...

          Click image for larger version

Name:	Screenshot from 2020-05-25 11-35-11.png
Views:	357
Size:	5.2 KB
ID:	1388419
          I know HomeSeer is not installed to in the typical folder but, I'm trying to understand the adjustments I need to make.

          Comment


            #35
            Here not running a service for starting Homeseer 3 or 4 in Linux.

            Rather just running a Cron job to start it and using Homeseer 3/4 GUI to shut it down. I did at one time run HS as a service.

            I run this to start Homeseer on boot with Ubuntu.

            sleep 120 && exec sh /opt/HomeSeer/autostart_hs

            Bash autostart_hs is the same as the bash go file.

            I also keep HS in the /opt/HomeSeer directory.

            Also configured a Windows Virtual Box to run multiple instances of speaker dot exe after HomeSeer starts.
            - Pete

            Auto mator
            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
            Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
            HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

            HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

            Comment


              #36
              Any issue with HS in a different directory? If so, what is best method to move to /opt/HomeSeer?
              Trying to run above 'sleep 120 && exec sh /opt/HomeSeer/autostart_hs' in StartUp Applications but, even when I change /opt/HomeSeer/ to /Public/HomeSeer/ it still doesnt work. Is this supposed to open a Terminal window?

              Comment


                #37
                The screen package isn't installed by default. You'll need to install:

                Code:
                sudo apt-get -y install screen

                Comment


                  #38
                  Any issue with HS in a different directory?

                  No. Autostart_hs is the same as the /HomeSeer/go bash script.

                  type sudo exec sh /opt/HomeSeer/autostart_hs

                  at a terminal window

                  Yes as zwolfpack mentions above install screen for running the one liner above in an SSH session with "&&"

                  screen command in Linux provides the ability to launch and use multiple shell sessions from a single ssh session.
                  - Pete

                  Auto mator
                  Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                  Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                  HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                  HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                  HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                  X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                  Comment


                    #39
                    Got it to work when I installed screen. HS seems to start as a service with no Terminal Window required.

                    Thank you!

                    Comment


                      #40
                      Yes when you run it in a service or cron job no remote terminal window is required.

                      The original Homeseer Zee ran a one liner at the end of the start up script from the /usr/local/HomeSeer directory.

                      I just mentioned running it from a terminal window to test it out. Really after it starts the only way to see it running is via the HomeSeer GUI or looking at top or htop.

                      - Pete

                      Auto mator
                      Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                      Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                      HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                      HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                      HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                      X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                      Comment


                        #41
                        Originally posted by Pete View Post

                        screen command in Linux provides the ability to launch and use multiple shell sessions from a single ssh session.
                        Right, it's a throwback to the days before windowing systems, it allowed a single dialup line to run multiple sessions. Of course the user would have to mentally keep track of what was running on each 'screen' -- what a headache!

                        Thankfully by the time I started on UNIX/UNIX-like systems (late 1980's), they were windowing systems (pre-dating MS Windows). I recall trying out screen sometime in the 1990's and quickly deciding its days of glory had passed.

                        Comment

                        Working...
                        X