Announcement

Collapse
No announcement yet.

How To Access HS3 from IIS web page/server

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

    How To Access HS3 from IIS web page/server

    For those who are maintaining there own web pages on their own or hosted web servers using IIS asp.net, and would like to add HS3 automation to their web pages, here is what is needed.

    Your IIS Web Application or Web Site must contain an Global.Asax file with event routines that run: (1) when your application is first loaded and run to connect to HS3 and create the .hs object (2) for each time a page is loaded, retrieve the .hs object from first step, (3) when your application is unloaded by server, disconnect and destroy all used resources.

    Here is example using VS 2015 Community version:
    HTML Code:
    Global.Asax
    
    <%@ Application Language="VB" %>
    <%@ Import Namespace="Scheduler" %>
    <%@ Import Namespace="HomeSeerAPI" %>
    <%@ Import Namespace="HSCF.Communication.Scs.Communication.EndPoints.Tcp" %>
    <%@ Import Namespace="HSCF.Communication.ScsServices.Client" %>
    <%@ Import Namespace="HSCF.Communication.ScsServices.Service" %>
    
    <script runat="server">
        Shared ghs As HomeSeerAPI.IHSApplication
        Public WithEvents client As HSCF.Communication.ScsServices.Client.IScsServiceClient(Of IHSApplication)
        Dim Hs3IpAddress As String = "192.168.1.71"
    
        Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
            '' Fires when the application is started
            '
            '' Get HS objects as this is the development environment
            ghs = OpenHsConnection(Hs3IpAddress)
        End Sub
    
        Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
            '' Fires when the application is ending
            '
            '' Disconnect and release resources
            ghs.WriteLog("WebAp Sample", "WebAp Sample disconnecting from HS3")
            CloseHsConnection()
        End Sub
    
        Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
            '' Fires at the beginning of each request
            '
            '' Add HS object to Context for the web pages
            Context.Items.Add("HsObject", ghs)
        End Sub
    
        Private Function OpenHsConnection(ipAddress As String) As HomeSeerAPI.IHSApplication
            Dim host As HomeSeerAPI.IHSApplication
            Dim hs As HomeSeerAPI.IHSApplication
            Dim Attempts As Integer
    
            client = ScsServiceClientBuilder.CreateClient(Of IHSApplication)(New ScsTcpEndPoint(ipAddress, 10400))
            Attempts = 1
    TryAgain:
            Try
                client.Connect()
                host = client.ServiceProxy
                Dim APIVersion As Double = host.APIVersion  ' will cause an error if not really connected
            Catch ex As Exception
                If ex.Message.ToLower.Contains("timeout occurred.") Then
                    Attempts += 1
                    If Attempts < 6 Then GoTo TryAgain
                End If
                If client IsNot Nothing Then
                    client.Dispose()
                    client = Nothing
                End If
                Return Nothing
            End Try
            Try
                ' create the user object, accessed from each Web Page
                hs = host
                hs.WriteLog("WebAp Sample", "WebAp Sample Connection to HS3 Successful")
            Catch ex As Exception
                Return Nothing
            End Try
            Return hs
        End Function
    
        Private Sub CloseHsConnection()
            ' disconnect from server for good here
            client.Disconnect()
            If client IsNot Nothing Then
                client.Dispose()
                client = Nothing
            End If
        End Sub
    
        Private Sub client_Disconnected(ByVal sender As Object, ByVal e As System.EventArgs) Handles client.Disconnected
            CloseHsConnection()
        End Sub
    </script>

    Here is a very simple Default.aspx page code behind that just retrieves and displays the HomeSeer version info from the HS3 server:

    Code:
    Default.aspx.vb
    
    Partial Class _Default
        Inherits System.Web.UI.Page
        Friend hs As HomeSeerAPI.IHSApplication
        Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
            '' Get HS object
            hs = Context.Items("HsObject")
            '' Retrieve and display HS Server Version
            If hs Is Nothing Then
                Response.Write("Could not connect to HS3")
            Else
                Response.Write("HomeSeer Version = " & hs.Version)
            End If
        End Sub
    End Class
    This should be enough to point you in the correct direction.

    I've attached the complete set of web site files if needed.

    tenholde
    Attached Files
    tenholde

    #2
    @tenholde,

    Unrelated to IIS here....

    Goofing around a bit here yesterday configured my Homeseer 3 Buntu 14.04 64 bit box with Apache2 (V2.4.7) to include dot net stuff. Baby steps here as I am also doing this and that. I have other stuff running on the Apache 2 side concurrent with Homeseer 3 running its own stuff.

    I have not yet tried to run anything and just did the configuration and install stuff relating to mono at this time.
    Last edited by Pete; August 25, 2015, 10:11 PM.
    - 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 - Asus AIO

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

    Comment


      #3
      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

      Comment


      • happnatious1
        happnatious1 commented
        Editing a comment
        Not a Ubuntu Linux expert here but learning. Is there a difference in the way that HomeSeer runs using this method as opposed to launching it with the ./go command? I do see that there is no console window visible when Ubuntu reboots but does that matter?

      • Pete
        Pete commented
        Editing a comment
        OP posted script is starting a service such that you can utilize these commands in a terminal session

        systemctl start name.service start
        systemctl start name.service stop
        systemctl start name.service restart

        This creats a PID.

        the ./go command is a start script to start Homeseer. Typically you would leave the terminal window open. That said you can test Homeseer starting this way and look at the dialog for errors.

        Another way is to use a boot up cron script which starts Homeseer on boot. I also utilize this command and the GUI shut down Homeseer command.

        Yet another way is to auto login a user on reboot and configure an autostart in the XWindows GUI (like in Windows).

        There is a lot of flexibility here.

        The original Homeseer Zee just put the start up command in the bootup script /etc/sysctl.conf and had HomeSeer installed in the /usr/local/HomeSeer directory. Personally here installed homeseer in the root directory /HomeSeer. ...easier to find and less typing for me.
        Other users put it in the /opt/HomeSeer directory. Just remember to change the hard scripts in the directory.

        What you do not want to do is start HomeSeer twice which I have seen done by accident. To check if Homeseer is running in a command line use the top command. You will see mono processes running telling you that Homeseer is running.

        I do see that there is no console window visible when Ubuntu reboots but does that matter?

        No. Personally I do look at the console window when testing a new plugin and do not enable console views when running stable.

        Using the Zoneminder box here always run it as a service and similiar to Apache2. If I want to make changes in Zoneminder or Apache2 I stop the service, make the changes and start the service or I just restart the services.

        There is no right or wrong way to do this. Over the years there are just more checks and balances relating to startup programs. IE: today with Ubuntu 16.04/10 you have programs/scripts which check programs/scripts which check programs/scripts. For just running the meat of Homeseer you do not need a desktop GUI and in fact it just adds resource utilization and doesn't really help in running Homeseer. IE: you do not see it running in the desktop and if you utilize the desktop browser you are just taking away resources from the main OS. Here I short cut SSH managment a bit using Webmin which is a web based management tool. It is light.
        Last edited by Pete; May 7, 2017, 12:59 PM.

      • lveatch
        lveatch commented
        Editing a comment
        Originally posted by happnatious1 View Post
        Not a Ubuntu Linux expert here but learning. Is there a difference in the way that HomeSeer runs using this method as opposed to launching it with the ./go command? I do see that there is no console window visible when Ubuntu reboots but does that matter?
        Both the go script and the /etc/systemd/system/homeseer.service script exectute the same start command:
        Code:
        /usr/bin/mono /opt/HomeSeer/HSConsole.exe --log
        The main difference is that the mono log entries you see via go's console will now be written to Ubuntu's syslog (/var/log/syslog).

        Not a bad way to get a tail-able text version of the HS3 log database entries!!

        You can configure syslog as to what is put in syslog, different files for each service, or disable all together.

      #4
      Another collection of information from this HS board that covers the specific steps to create an image for Odroid C1 and other SBC such as Raspberry Pi. It includes use of SSD to protect from lifetime write issue with SD and mechanism for autostart and safe shutdown.
      Attached Files
      Last edited by Michael McSharry; February 1, 2018, 08:20 PM.

      Comment


        #5
        How to change from US to UK/EU date format in HS3 linux/Pi


        By default HS3 displays dates in the US mm/dd/yy format. To change to the UK/EU format of dd/mm/yy make the following changes to your system.

        1 - Log in to your system command line using SSH from another linux box or an SSH client for windows such as Putty.

        2 - Ensure that the system locale is set to your region (in this example we will use en_GB for the UK).

        a. Check the current locale typing:

        localectl

        This is what I see on my laptop.

        ICS-HPN:~$ localectl

        System Locale: LANG=en_US.UTF-8
        VC Keymap: n/a
        X11 Layout: us
        X11 Model: pc105

        b. If the current locale is not correct, check that the required locale is installed:

        localectl list-locales
        ...
        en_GB.UTF-8
        ...

        c. Change the system locale to the desired region

        sudo localectl set-locale LC_ALL=en_GB.UTF-8

        d. Check the change has been implemented:

        localectl

        3 - That has changed the system locale to the correct region.

        However, HomeSeer changes the locale of the homeseer user to en_US, on the fly, when HomeSeer starts so it is necessary to edit some HomeSeer configuration files to complete the changes.

        By default linux comes with vi as its command line editor. Many find the interface difficult to use and prefer nano instead. To install nano, issue the following commands:

        sudo apt-get update

        sudo apt-get install nano

        a. Change the homeseer startup file:

        sudo nano /usr/local/HomeSeer/autostart_hs

        Change the line:
        export LANG=en_US.UTF-8
        to
        export LANG=en_GB.UTF-8

        b. Change the homeseer go file:

        sudo nano /usr/local/HomeSeer/go

        Change the line:
        export LANG=en_US.UTF-8
        to
        export LANG=en_GB.UTF-8

        c. If necessary add you actual location to the location.csv file. To add your location edit the file:

        sudo nano /usr/local/HomeSeer/Config/location.csv

        and add your actual location copying the format of already entered locations. NOTE: there is a long standing feature/bug that the longitude values in the file are reverse signed. ie West of Greenwich values are positive instead of the expected negative.

        4 - Restart the system to implement the changes:

        sudo reboot

        Author - adeux - Mark
        Last edited by Pete; April 9, 2018, 06:33 PM.
        - 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 - Asus AIO

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

        Comment


          #6
          Copied original post to here.

          pmoneill wrote this forum post on December 5, 2017

          Thank you Peter for an excellent guide.

          Correct Installation of HS3 Standard on Raspberry Pi 3

          I have not found any official Linux installation instructions from Home Seer while none of the forum posts are complete and accurate. Here is the process I developed over the last week. I am not an expert so I'll take the community's inputs to improve this post.

          OverviewLinux Installation
          Install Raspbian Lite:
          1. Download Raspbian Stretch Lite to a PC.
          2. Write the Raspbian image to a micro SD card with the Etcher SD card image writer for Linux and Windows ( https://etcher.io/ ).
          3. Insert this micro SD card into the powered-down Raspberry Pi 3.
          4. Connect the RPi to your network with an Ethernet cable if you are not using Wi-Fi because it is about to automatically download more software.
          5. Attach a monitor and keyboard to the RPi.
          6. Boot the RPi by powering it on and let it do its automatic installations and updates, which might take up to 15 minutes.

          If you will only connect to your RPi 3 via Ethernet and USB then disabled the Wi-Fi and Bluetooth radios at the firmware level to improve security and to save power. Add these lines to /boot/config.txt:
          dtoverlay=pi3-disable-wifi
          dtoverlay=pi3-disable-btsudo raspi-configsudo shutdown -r now .

          Prepare the RPi for HomeSeer installation:
          1. Shut down the RPi: sudo shutdown -h now .
          2. Remove the monitor and keyboard from the RPi to make all further connections from a Linux computer terminal with SSH or a Windows computer SSH client like PuTTY.
          3. Power up RPi

          HomeSeer HS3 Installation ssh <hostname>
          2. sudo apt update
          3. sudo apt install mono-complete
          4. sudo apt install mono-vbnc
          5. sudo apt install mono-xsp4

          After installation, make sure you update the builds. Repeat this pair of commands several times to update all of the dependencies.
          1. sudo apt update
          2. sudo apt upgrade

          Install HomeSeer: sudo tar xvf hs3_linux_<version>.tar.gz

          The tar script creates the /home/pi/HomeSeer directory.

          HomeSeer can be started by cd HomeSeer followed by sudo ./go , but this only runs HomeSeer while the SSH console session is active.

          Better is to run the heart of the go script in the background without logging:
          sudo mono HomeSeer/HSConsole.exe &sudo mono /home/pi/HomeSeer/HSConsole.exe &

          Addendums / adjustments done to above:


          A - Prepare the RPi for Homeseer installation - adjustments to line #2 and line #3
          B - Installation of Linux text to speech
          C - Using current version of Mono as posted on the Mono site rather than default RPi repository stuff.

          Last edited by Pete; August 15, 2018, 03:33 PM.
          - 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 - Asus AIO

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

          Comment


          • Pete
            Pete commented
            Editing a comment
            Here switched from /home/user/Homeseer to /HomeSeer to /opt/HomeSeer.


          • Jamr
            Jamr commented
            Editing a comment
            Trying this tomorrow. Has anybody had any problems or issues to deal with using the HS3 standard with a PI3?

          • drhtmal
            drhtmal commented
            Editing a comment
            There will always be issues. That being said, plenty of people are running HS3 on a PI.

          #7
          NOTE: This is a copy and paste from a forum post over here ==> HS3 Linux with Remote Z-Wave Interface Setup Guide
          Written by Homeseer User Blackbear - Ryan Aldridge

          I've made the conversion from Vera to HS3 over the past month or so. In that time, I have gleamed quite a bit across a number of sources that I wanted to share with the community in a single guide as it may help a lot of other people new to Homeseer if they want to do a similar setup

          My Setup:

          This setup has been rock solid with zero issues. This diagram is the setup I'm running (HS3 running on Ubuntu VM and a Remote Z-Wave interface (HS SmartStick+ connected to a Raspberry Pi 3 (RPi3) B+ using SER2NET to expose the USB interface to the network). This allows me to host my HS3 server within my network equipment closet and have the RPi Z-Wave device anywhere in the house (since I have the whole house wired for ethernet). For those that don't have wired ethernet, this setup should still work for WiFi networks (just imagine the dotted lines connecting the objects below being wireless connections).

          Click image for larger version  Name:	fetch?id=1272611&amp;d=1546668121.jpg Views:	1 Size:	15.7 KB ID:	1272739
          Step 1: Install HS3
          1. I used this fantastic guide by to get my HS3 running on Ubuntu 18.10.
          2. Reboot the Ubuntu server (missing from the linked guide).
          3. Load the initial webpage: http://find.homeseer.com/findhomeseer/
          4. Install the HS3 license
          5. Modify any additional configuration settings you want
          My server specs (probably overkill for now, but I have big plans for this setup):
          • 4 vCPU
          • 8 GB Memory
          • 20 GB HDD
          Average CPU usage is <5% and Memory usage is around 2-3 GB at any given time (I have 10 plugins running currently with about 20 devices).

          Step 2: Install Raspberry Pi 3 OS (Raspbian Lite)

          Hardware: I chose a 16GB MicroSD card. IMPORTANT: Raspberry Pi 3 B+ needs a Class 10 or higher grade card.
          1. Install NOOBS on the MicroSD card using this Raspberry Pi tutorial
          2. Insert the MicroSD card and connect the Smartstick+ USB, Ethernet cable (if you have one), HDMI monitor, keyboard, and mouse to the RPi3 and power it on.
          3. Once the RPi boots to the install menu, select Raspbian Lite from the list of OS choices (it may take a minute or so to display the full list). Follow the prompts to install the OS (I chose all defaults except I set my local timezone).
          4. Once the RPi has finished installing the OS, reboot it.
          5. Login (default username/password = pi / raspberry)
          6. If you don't have the RPi connected via an ethernet cable and instead need to use WiFi, now is the time to connect it.
            1. Open the Config Menu:
              Code:
              sudo raspi-config
            2. Select 2 Network Options
            3. Select N2 Wi-fi
            4. Choose your country
            5. Enter the WiFi network's SSID
            6. Enter the WiFi network's passphrase
            7. If it works, you should get a success (and no error message). If it didn't work, check the SSID and passphrase.
            8. Exit the config menu
          • Enable SSH
            1. Open the Config Menu:
              Code:
              sudo raspi-config
            2. Select 5 Interfacing Options
            3. Select P2 SSH
            4. Select Yes
            5. Exit the config menu
          • Change the default password: Code:
            Code:
            passwd
          Step 3: Setup Static IP for the RPi3 You want to make sure the RPi always has a static IP address so the HS3 server can find it on the network. If DHCP is used, the address will periodically change and the HS3 server will lose connection to the RPi3. You can either set a static IP in the DHCP server like I did or you can configure the RPi to have a static IP. After you configure the static IP, reboot the RPi:
          • Code:
            sudo reboot now
          Step 4: Install ser2net on the RPi3
          ser2net allows COMM ports (such as serial and USB) to be exposed to the network through a TCP port. This makes it really easy for the HS3 Z-Wave plugin to connect to the RPi3 and use the Smartstick+ Z-Wave interface remotely (anywhere in the world if you want).
          1. Log back into the RPi's SSH interface (remember to use the new static IP address you set).
          2. Run the following command to install ser2net:
            Code:
            sudo apt-get install ser2net
          3. Now we need to determine the "device address" of the USB port where the Smartstick+ is located. ser2net uses this to map to a network port.
            1. Run the following command:
              Code:
              dmesg | grep tty | grep USB
            2. The "device address" will start with tty (default should be ttyACM0).
          4. Edit the ser2net.conf file and map the USB device address to a network port. I used port 4000 (doesn't really matter as long as it is above 1024).
            1. Open the /etc/ser2net.conf file: [CODE]sudo nano /etc/ser2net.conf [/CODE
            2. Move the cursor all the way to the bottom of the file
            3. Add the following line of code beneath everything else:
              Code:
              4000:raw:0:/dev/ttyACM0:115200
              • NOTE: The format is <TCP port>:<state>:<timeout>:<device>:<options>
              • You can understand the fields more in the ser2net man page
            4. Save and Exit (Control + X, then Y)
            5. Restart the ser2net service:
          Code:
          sudo systemctl restart ser2net
          Step 5: Install and Configure the HS3 Z-Wave Plugin
          1. From the HS3 webpage, go to Plugins >> Manage.
          2. Expand Additional Interfaces >> Lighting & Primary Technology.
          3. Select the HomeSeer Z-Wave plugin and click Download and Install (just below Additional Interfaces).
          4. Once it's installed, enable the plugin.
          5. Once the plugin has enabled, go to Plugins >> Z-Wave >> Controller Management
          6. Click Add Interface
            • Name: (whatever you want to name it)
            • Interface Model: Ethernet Interface
            • IP Address: <static ip address of the RPi3>
            • Port Number: <ser2net port> (Mine was port 4000)
          7. Click Add
          8. Click the Enable box (it should successfully connect to the RPi3!)
          9. Expand Z-Wave Networks and Options
          10. Rename the network to whatever you want
          This is what my setup looks like:

          Click image for larger version  Name:	fetch?id=1272612&amp;d=1546674113.jpg Views:	1 Size:	92.1 KB ID:	1272827Step 6: Add Z-Wave Devices
          1. From the HS2 webpage, go to Plugins >> Z-Wave >> Controller Management
          2. Expand Z-Wave Interfaces
          3. From the Actions dropdown, select Add/Include a Node
          4. Click the Start button and then press the Programming button on the Z-Wave device itself. You should see activity in the dialog box. If you do, congrats! It works!

          Hopefully this guide will help some newer folks out there if they want to do this sort of similar setup. If you have any questions, feel free to reply or reach out to me.

          One side note about the security of this approach - since the USB of the RPi is exposed to the local network without authentication, I have it in a separate subnet/VLAN along with some other home automation/security related devices. Very few devices on my network can access this "security" network.

          Thanks,
          Ryan
          - 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 - Asus AIO

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

          Comment


          • user90210
            user90210 commented
            Editing a comment
            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

          • johnny_holden
            johnny_holden commented
            Editing a comment
            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).

          • zwolfpack
            zwolfpack commented
            Editing a comment
            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

          #8
          Upon signing in I get this feedback aS THE FIRST ENTRY IN THER LOG
          Failed to get version information from configuration database (invalid database), data NOT loaded.
          HOW DO i CORRECT FOR THIS

          Comment


            #9
            So I created this file

            Code:
            #!/bin/sh
            #
            
            pids=$(pidof /usr/bin/mono /HomeSeer/HSConsole.exe); for p in ${pids[@]}; do cat /proc/$p/status | grep -i vmrss | awk '{print $2}'; done | while read m; do let t=$t+$m; echo $t; done | mosquitto_pub -h 127.0.0.1 -t Hs3/memory -m "$(tail -n 1)"

            the problem is that i get all the process run by mono ( all hs3). So it give me 1gb of memory used.

            when i replace the pidof with this :

            Code:
            #!/bin/sh
            #
            
            pids=$(pidof /usr/bin/mono /HomeSeer/HSConsole.exe --log); for p in ${pids[@]}; do cat /proc/$p/status | grep -i vmrss | awk '{print $2}'; done | while read m; do let t=$t+$m; echo $t; done | mosquitto_pub -h 127.0.0.1 -t Hs3/memory -m "$(tail -n 1)"
            I got an error that pidof do not recognise --log function.

            Maybe i have some error in the systaxe i posted here, but that is not important. the improtant thing is how to make '' /usr/bin/mono /HomeSeer/HSConsole.exe --log '' be recognized by pidoff ?

            thanks!!




            Comment


            • Guest's Avatar
              Guest commented
              Editing a comment
              ok... i am getting near of the goal with this :

              Code:
              #!/bin/sh
              #
              
              while true
              do
              
              t=$( ps axo rss,cmd | grep '/usr/bin/mono /HomeSeer/HSConsole.exe --log' | grep -v grep)
              
              mosquitto_pub -h 127.0.0.1 -t HS3/MemUSED -m "$t"
               sleep 30
              done

              But not able to remove the ''cmd'' for only using :

              ps axo rss | grep '/usr/bin/mono /HomeSeer/HSConsole.exe --log' | grep -v grep

            • Guest's Avatar
              Guest commented
              Editing a comment
              To be more explicit here is a picture of output i get when I send the command with or without ''cmd'' to the terminal ( and without of course getting anything via mqtt).


              With
              Code:
              ps axo rss,cmd | grep '/usr/bin/mono /HomeSeer/HSConsole.exe --log' | grep -v grep
              I get : 187252 /usr/bin/mono /HomeSeer/HSConsole.exe --log

              With
              Code:
              ps axo rss | grep '/usr/bin/mono /HomeSeer/HSConsole.exe --log' | grep -v grep
              I get : Nothing
              Attached Files

            • Guest's Avatar
              Guest commented
              Editing a comment
              ha.. i think Grep use the cmd attribute in a reverse manner to find the memory usage associated to it. So it is a little hard to remove ''cmd''

            #10
            Can someone tell me the easiest way to archive HS3 logs? At present, I can rummage through the HS3 log only back as far as the last reboot, and restarts occur fairly frequently, partly due to local power outages. I'd like to read log info accumulated over the last year or so.
            Thanks.

            Comment


            • Rupp
              Rupp commented
              Editing a comment
              Check out the UltraLog plugin:
              https://forums.homeseer.com/forum/ul...log-ultrajones

            • ericg
              ericg commented
              Editing a comment
              Thanks for the suggestion, Rupp. Somehow, I had gotten the idea that this plug-in was for HS2 only.
              I have just now purchased and installed UltraLog3. So far, so good.

            #11
            Are there any step-by-step guide for doing this?

            Comment


            • Guest's Avatar
              Guest commented
              Editing a comment
              What plugin ?

              Do you know how to use filezilla? Or , is the zip has a download adresse ( so you can download it directly to your pi using ssh )

            #12
            Hi,

            I know I did it in the past but now I'm not able to link my HS3 into Google home!

            It's does everything including to login to the HS web interface (username and password) but after is back into the Google home without anything showing (my devices) from my HS account!

            I don't understand, something wrong with the HS service?

            Any clue?

            Thanks,
            Joel

            Sent from my Pixel 3 XL using Tapatalk

            Comment


            • sparkman
              sparkman commented
              Editing a comment
              Do you have any devices configured for voice?

            • Guest's Avatar
              Guest commented
              Editing a comment
              Originally posted by sparkman View Post
              Do you have any devices configured for voice?
              Hmmm good question! By default are they? Just reinstalled everything.
              I'm still newbie with HS, I included all my devices and my next step was to figure out how to play with scenes/event etc.
              But between those steps I tried to link it in Google home...
              Anyhow, I got to go teach now and I'll check upon my return, but if it's by default then it should be configured for voice.... In my previous setup I did nothing more to enable the voice option if a recall!


              Sent from my Pixel 3 XL using Tapatalk



            • Guest's Avatar
              Guest commented
              Editing a comment
              Hi,
              Ends out that the voice option was not checked.
              After the devices appears into Google home.
              Thx,
              Joel

              Sent from my Pixel 3 XL using Tapatalk


            #13
            I like to see real time power of my sun panels every minute of the day in a graphic. For energy consumption/production.
            The data of my panels are reading with the plugwise circles. In HS3 you see the data (see picture 1).
            So I was thinking at the energy database inside HS3.
            Is it possible to look into that dbase and where is that dbase standing in Windows?

            Information about my HS3:
            Windows 7
            HS3 version 3.0.0.548
            Plugin Plugwise Rien Pre 3.1.0.0
            Device for data Plugwise circle (see picture 1)
            Setup HS3 status Energy database (see picture 2)

            Wim
            Attached Files

            Comment


            • wim2008
              wim2008 commented
              Editing a comment
              I found something in de c:\Program Files\HomeSeer HS3\Data\Energy in my Windows map. File is named: Energy.hsd.
              It likes to be the Energy Database. In the SysTools SQLite viewer I can see some data from the last years. www.systoolsgroup.com/sqlite-viewer.html.

              But data inside is not what I expected. No data from the plugwise devices in it ????

              Wim

            #14
            I have two HS3 systems in different houses and I was wondering what the easiest way is to have them communicate, in particular:
            * Be able to read/trigger remote devices
            * Be able to trigger remote events

            The two systems are on different LANs connected through a tunnel, so they have full port access to each other (i.e. no need for a third party or opening ports).
            The 2 systems are linked to MyHS, Pro subscription.

            I assume I could use a third-party service like IFTTT, but if there is a simple "local" way without using a third-party, it would be better.

            Comment


            • Eman
              Eman commented
              Editing a comment
              Another dev Shodan author of the Jeedom plugin did a good job of connecting two systems together. I wonder if he could add on his portfolio to do something like that


              Eman.

            • Michael McSharry
              Michael McSharry commented
              Editing a comment
              I did not actually try the following, but what I expect to be needed using mcsMQTT to integrate a HS3 and HS4 instance is described below.

              Assume HS3 has a temperature sensor and a light. Assume HS4 has motion sensor and water valve. This represents a case of both status only and controllable devices for each instance. The intent is to be able to control the light and the water valve from either HS instance and to see the status of the both sensors within both HS versions. From this point any other HS use should be able to be generalized.

              In HS3 assume the following specifics
              Device Ref 1 Location Sensor Name Temperature DeviceValue 30
              Device Ref 2 Location Hall Name Light DeviceValue 0 (Off)

              In HS4 assume the following specifics
              Device Ref 1 Location Sensor Name Motion DeviceValue 1 (On)
              Device Ref 2 Location Garden Name WaterValve DeviceValue 0 (Off)

              In the mcsMQTT HS3 instance the following is setup
              ------------------------------------------------------------------------
              Subscribe HS4/Sensor/Motion and associate to HS3 device that will create device ref 3, Location Sensor, Name Motion. Current value will be 1 (On)

              Subscribe HS4/Garden/WaterValve, Type Button and associate to HS3 device that will create device ref 4, Location Garden, Name WaterValve Current value will be 0 (Off)
              Publish HS4/Garden/cmnd/WaterValve with Payload template of $$LABEL:

              For HS3 Device 1 Publish HS3/Sensor/Temperature, Payload Template $$VALUE:
              For HS3 Device 2
              ...Subscribe HS3/Hall/Light/cmnd/Light, Type Button
              ...Publish HS3/Hall/Light, Payload Template $$LABEL:

              In the mcsMQTT HS4 instance the following is setup
              ------------------------------------------------------------------------
              Subscribe HS3/Sensor/Temperature and associate to HS4 device that will create device ref 3, Location Sensor, Name Temperature. Current value will be 30

              Subscribe HS3/Hall/Light and associate to HS3 device that will create device ref 4, Location Hall, Name Light, Current value will be 0 (Off)
              Publish HS3/Hall/cmnd/Light with Payload template of $$LABEL:

              For Device 1 Publish HS4/Sensor/Motion, Payload Template $$VALUE:
              For Device 2
              ...Subscribe HS4/Gardenl/cmnd/WaterValve, Type Button
              ...Publish HS4/Gardenl/WaterValve, Payload Template $$LABEL:


              This setup will result in 4 devices being visible in each HS3 and HS4. Control of Light and WaterValve from either instance. Status of everyting updated in both HS3 and HS4.

              The payload template of $$LABEL: tell mcsMQTT to use the On/Off. $$VALUE: tells mcsMQTT to use 1/0. When $$LABEL: is used then the receiving mcsMQTT will create Value Status Pair or Off=0, On=1 so Off and On will show on the button labels from Device Management or other UI.

              I used HS3 and HS4 in the use case for clarity. It would work just the same as HS3-1 and HS3-2 for HS3 only exchange.

            • LaurentR
              LaurentR commented
              Editing a comment
              Thanks a lot!

              I managed to get a couple of devices going fairly quickly (spent more time battling the Windows Firewall to allow the built-in broker). Now that I have jumped in, I need to figure out the details :-)

            #15
            Hi! Im new to the Linux OS. I completed the setup of my VirtualMachine with Ubuntu and will like to install HS3 on it. Can someone direct me to a tutorial or steps to complete the installation?

            thanks!

            Comment


            • micro2ning
              micro2ning commented
              Editing a comment
              nop. 1st time user. I already created the VR with Ubuntu and downloaded the HS3 and extracted it. Im stuck in there. no idea how to run it.

            • mik3
              mik3 commented
              Editing a comment
              Originally posted by micro2ning View Post
              nop. 1st time user. I already created the VR with Ubuntu and downloaded the HS3 and extracted it. Im stuck in there. no idea how to run it.
              Should be ./go or ./Go


            • micro2ning
              micro2ning commented
              Editing a comment
              go it! it is ./go

              I was not in root, that's why I was getting nowhere. now waiting for the installation to complete.

              thanks!
          Working...
          X