Announcement

Collapse
No announcement yet.

How To Access HS3 from IIS web page/server

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

  • ClayMaster
    replied
    Originally posted by ARA View Post
    Startup with systemd

    Systemd:

    Systemd is the standard start-up, or initialization system (init for short) for modern Linux. It replaces SysV init and Upstart. Instructions for those two can be found elsewhere on the forums.

    Systemd provides a number of benefits, but there is an admitted learning curve. There is much documentation in the man pages (Do <tt class="docutils literal"># man systemd</tt>, <tt class="docutils literal"># man systemctl</tt>, and <tt class="docutils literal"># man journalct</tt> in your favorite terminal). You interact with systemd through the <tt class="docutils literal">systemctl</tt> commands. The basic commands, executed as superuser <tt class="docutils literal">root</tt>, are:

    Code:
    # systemctl start something.service
    # systemctl status something.service
    # systemctl stop something.service
    This will allow you to start some service, check it's status and stop it. Configuration options are stored in unit files - the <tt class="docutils literal">something.service</tt> file. These contain the actual commands needed to start any particular service. Not only can they start programs and services, they can also mount media, set up devices and do other system things.

    Basically, to get HomeSeer3 running, we need to create a new Service Unit file and some supporting scripts.

    Start Up:

    To get HomeSeer up and running, we need to first create the text file:

    Code:
    /etc/systemd/system/homeseer.service
    This is a custom addition to systemd's repertoire of start-up scripts. The <tt class="docutils literal">homeseer.service</tt> file will tell systemd that HomeSeer exists and how to start and stop it. Note that systemd keeps local configuration files in <tt class="docutils literal">/etc/systemd/system/</tt>. The files in this directory override default system files and so provide a place for custom configurations. Further, they are not overwritten during system updates, so we only have to do it once.

    Now put this code in it:

    Code:
    [Unit]
    Description=HomeSeer HS3 Home Automation Server
    After=network.target
    
    [Service]
    WorkingDirectory=/opt/HomeSeer
    ExecStart=/usr/bin/mono /opt/HomeSeer/HSConsole.exe --log
    ExecStop=/opt/HomeSeer/stop_homeseer.sh
    Restart=on-failure
    TimeoutStopSec=90
    
    [Install]
    WantedBy=multi-user.target
    A bit of an explanation:

    This assumes that HomeSeer is installed in <tt class="docutils literal">/opt/HomeSeer/</tt>.

    Lines 1 & 2 tell systemd about a new service - HomeSeer3.

    Line 3 says that HS3 should be started after the network is started - which usually means all basic system service are up and running. It is necessary if we want HomeSeer to communicate with other things via the network.

    The [Service] section describes the environment and commands that are used to run HS3.

    Line 5 is the HomeSeer working directory - the path to the HomeSeer files.

    Line 6 is the actual command executed to start HS3.

    Line 7 is the stop command.

    Line 8 tells systemd to restart HS3 if it stops running due to failure.

    Line 9 is how long systemd should wait for HS3 to stop - once this time passes systemd assumes that HS3 has hung, and will kill it should it still be running.

    Lines 10 & 11 say that HomeSeer should be started in the multi-user target - formerly know as runlevel 3 - and will cause HS3 to be started every normal bootup.

    You may want to use <tt class="docutils literal">Restart=always</tt> on line 8. This will cause HS3 to be restarted every time it exits by means other than <tt class="docutils literal">systemctl stop homeseer</tt>. This is useful if, say, someone accidentally shuts down HS3 from the web interface.

    Now enable the service:

    Code:
    # systemctl enable homeseer.service
    Enabling the service is not the same as starting it. Enabling tells systemd to create the appropriate links in the <tt class="docutils literal">/etc/systemd/system/*.wants/</tt> directories. Thus, when you restart the computer, HS3 will start. But to get it running right now you need to execute:

    Code:
    # systemctl start homeseer.service
    This will be enough to get HS3 running when you start up. But it won't cleanly shutdown because HS3 doesn't handle Unix signals. It involves a few more files to get a clean shutdown.

    Shutdown

    There are two ways to cleanly shutdown HomeSeer, you only need to use one.

    Using Linux Tools:

    It is possible to use the built-in Linux Tools menu to shutdown HomeSeer.

    First create:

    Code:
    /opt/HomeSeer/stop_homeseer.sh
    Add this code:

    Code:
    #!/bin/bash
    /usr/bin/curl --user username:password 'http://127.0.0.1/LinuxTools' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' --data 'ConfirmShutdownhs=Yes' --compressed
    sleep 10s
    If you don't require a password for local users, you should leave out the <tt class="docutils literal">--user</tt> option. Depending on what plug-ins you have enabled, you may need to increase the timeout delay.

    Using HS3 Scripts:


    A second method involves using a custom HS3 event and script to shutdown HomeSeer.

    First create:

    Code:
    /opt/HomeSeer/stop_homeseer.sh
    With this:

    Code:
    #!/bin/bash
    cd /opt/HomeSeer
    /usr/bin/curl --user username:password 'http://127.0.0.1:80/JSON?request=runevent&group=Admin&name=Shutdown'
    sleep 30s
    If you don't require a password for local users, you should leave out the <tt class="docutils literal">--user</tt> option.

    Then create:

    Code:
    /opt/HomeSeer/scripts/DoShutdown.vb
    With this code:

    Code:
    sub Main(parm as object)
    hs.WriteLog("DoShutdown", "Starting shutdown....")
    hs.Shutdown
    End Sub
    Now go into HS3 itself and create an event named <tt class="docutils literal">Shutdown</tt> in an <tt class="docutils literal">Admin</tt> group. Have it be <tt class="docutils literal">Manually Triggered</tt> and have it <tt class="docutils literal">Run a Script or Command</tt> and choose the <tt class="docutils literal">../scripts/DoShutdown.vb</tt> file.

    <hr class="docutils">
    In either case, executing:

    Code:
    # systemctl stop homeseer.service
    will stop the HomeSeer service. And this should be enough to give you a clean start and stop on reboots. It works on OpenSuSE and Ubuntu and I would expect it to work on Debian and Fedora. You will need to adjust the paths for your specific installation of course.

    Special thanks to jon102034050, whippersnapper and ZoRaC in http://board.homeseer.com/showthread.php?t=182156. From which most of this material was taken.

    -Alex
    Thank you for putting this post together on "Starting Homeseer with System". I had been reading all the forum posts on this subject and I just felt confused as to which method was the best. You did a great job on explaining the components and the process to put it all together. I had start on boot up and running within minutes.

    Leave a comment:


  • michiliman
    commented on 's reply
    Rupp - thanks for the reply.

    Here is my HS3 version:

    HomeSeer Version: HS3 Pro Edition 3.0.0.500

    I am running on Windows (Hometroller/Pro). I am recovering from hospitalization so it will take me a few days before I can get to the actual Hometroller to back up the HS3 directory but I have a plan now.

  • Rupp
    commented on 's reply
    What version of HS3 are you running? I'd recommend backing up your full HS3 directory if you are running on Windows and then check to see if there is an update by selecting Tools >Setup> Check for HS3 Update at Startup.

  • michiliman
    replied
    OK I admit I have not been keeping my HS3 up to date (it just does what I want so...). I had the recommended steps for backing up (including protecting plugins) somewhere but naturally now I cannot find them. I want to get my HS3 up to date in preparation for moving to HS4 (that will be another topic I am sure).

    I am hoping those steps have been posted somewhere here. If so, can someone point me to the post that contains the how-to?

    Thank you

    Leave a comment:


  • zwolfpack
    commented on 's reply
    For a fix which should allow ser2net version 4 to start properly on reboot, see the end of this post: https://forums.homeseer.com/forum/li...82#post1558582

  • johnny_holden
    commented on 's reply
    Originally posted by user90210 View Post

    The Z-net is not available at homeseer online store specifically the EU version zwave frequency of 868.42Mhz. The question was, is there an alternative without going thru setting a Raspberry Pi with Linux on it? I am not versed in Linux. If the Raspberry pi is the only path, then is there a step by step guide of that Linux solution? Thank you I appreciate your response.

    Sal
    Hi Sal, Did you resolve this? I want to setup a Aeotec Stick7 in a RPi4 with Ser2Net. Couldnt get it to work (Bullseye OS).

  • user90210
    commented on 's reply
    Originally posted by drhtmal View Post

    This is what the Z-Net is for.
    The Z-net is not available at homeseer online store specifically the EU version zwave frequency of 868.42Mhz. The question was, is there an alternative without going thru setting a Raspberry Pi with Linux on it? I am not versed in Linux. If the Raspberry pi is the only path, then is there a step by step guide of that Linux solution? Thank you I appreciate your response.

    Sal

  • user90210
    commented on 's reply
    Originally posted by drhtmal View Post

    This is what the Z-Net is for.
    The Z-net is not available at homeseer online store specifically the EU version zwave frequency of 868.42Mhz. The question was there an alternative without going thru setting a Raspberry Pi with Linux on it as I am not versed in Linux. If not then is there a step by step guide of that Linux solution.
    Thanks

  • drhtmal
    commented on 's reply
    Originally posted by user90210 View Post
    I am not a Linux guy, but has anyone tried extend the main HS4 node network via LAN with another PC with a zwave stick a secondary and third location (basement, attic)?
    This is what the Z-Net is for.

  • warren@wcnjsmith.com
    commented on 's reply
    I just completed installing a remote USB sharing device - AnyPlace USB - provides 2 USB ports remote via TCP LAN. My Homeseer server is running on a virtual machine ( Hyper-V so no USB sharing natively) so I needed a way to set up my Zigbee USB device locally. Simple install - plug in the hub to network, insert USB zigbee / zwave device. Install software on the HS4 host server. quick config and there it found the 2 USB devices ( as COM3 and COM4)

    https://www.amazon.com/Coolgear-4-Po.../dp/B08373BZSJ

    $78.00 so price is right versus having a separate PC running. Could see these placed around the house to improve z-wave and zigbee coverage.


  • user90210
    commented on 's reply
    I am not a Linux guy, but has anyone tried extend the main HS4 node network via LAN with another PC with a zwave stick a secondary and third location (basement, attic)?

  • pistacheL0
    replied
    Writing here for future use of this thread

    Leave a comment:


  • hornetster
    replied
    Have downloaded an image (hs3pi3_image_070319.zip) and have imaged a 32GB sdcard, and trying to run (know nothing - first install), but can't get past the "HS3Pi3v6 Maintenance" notice. Well, the next page, really, with a bunch of options etc (Reset/Reinstall/Update etc) Have run then all, and just get back to the maintenance page...
    Assuming I have to register the product, but can't find how/where to do this on a headless pi install. Have enabled SSH, and can login through that, but howto register from the command line??
    Thanks.

    Leave a comment:


  • kj9tonne
    commented on 's reply
    Originally posted by ldragon99 View Post
    I downgraded to Buster from what I was using and have the Pi installed out in my boiler cabinet and everything is working great. Thanks guys
    I have followed this thread from start until here. I have a RP4 and have downgraded to Buster and have a SmartStick+ (G3). In HS4 have operational Ethernet based Z-Wave controller. I have yet to connect any devices as I am waiting on new to arrive. However, in my HS4 logs I was getting this error message - "Z-Wave PC Controller Library Version: Z-Wave 7.15 (Unknown)". I went ahead and upgraded the SmartStick+ firmware but now get same message with newer firmware version "Z-Wave PC Controller Library Version: Z-Wave 7.17 (Unknown)".

    Is there something that can be done about this and is this going to impact my extended or existing Z-Wave networks?

    Fyi - new to Homeseer this past week - have Hometroller Plus with Smartstick+ with about 10 Zwave devices so far on primary controller. Everything is working great so far but need more time behind this initial install to be confident. Thanks in advance for anyone who can help or point me at another thread to resolve this repeating error in the logs.

  • ldragon99
    commented on 's reply
    I downgraded to Buster from what I was using and have the Pi installed out in my boiler cabinet and everything is working great. Thanks guys
Working...
X