Announcement

Collapse
No announcement yet.

Run HS4 as service with deCONZ

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

    Run HS4 as service with deCONZ

    Hi Wim,

    I'm still with HS4 version 4.2.8.0, because my system is stable and working fine for now with just a few bugs that aren't important. I've been reading to user's comments regarding the new updates and haven't had the courage and time to test yet.

    One of the new features that I like is the fact that I can run HS4 as a service. I use Win10 and have HS4 and deCONZ running on the same machine, so I configured first to start deCONZ and a few seconds later start HS4, when restarting de PC, to avoid errors in the log. My question is, how can I run both softwares if I choose to run HS4 as a service? Any tips you can give me?

    And by the way, which version of HS4 are you using now and if you recommend upgrading to a newer version? I ask this question because most of my system is managed by your plugin.

    Thanks,

    Nuno

    #2
    While still on HS3, I run deCONZ as a Fire Daemon service. Then HS3 as a Fire Daemon service with a delayed start. I realize you're on HS4, perhaps you can use the same approach with any 3rd part run as a service app.
    HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

    Comment


      #3
      Thanks langenet

      It seems like a good solution but I confess, don't know this type of app very well...I'll have to investigate further. Fire Daemon is well known but not free...lol

      Comment


        #4
        Yes, I know it's not free. I've had it for years. First on Win2k3 and now Win2k16. I know that there are others out there, but for me it has been great. I think I have around 5 or 6 services I've created including VSPE virtual server emulator as well as a Java app executable jar.
        HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

        Comment


          #5
          Yes, I've heard very good things about the software and with the explanation of what you do with it and the use you put it to, I can understand why you use it and how you can get return from the investment.

          Comment


            #6
            As far I know you cannot run deCONZ as a service as is, because it is depending on user rights.
            Of course if deCONZ is running on another machine there is no issue with HS running as a service.
            But deCONZ on the same machine needs those user rights. I guess with some trick it should be possible to set up a task planner to start deCONZ in a user context, while the PC is started, but did not play with that.

            For me HS and deCONZ are running on a small NUC PC in a user context. It is hidden away and accessed only by remote desktops, so no one in the house would dare to try to use it here. So I do not feel the need for running it as a service. For me the machine is automatically logged on and a task is planned (with Windows taskplanner) that will start deCONZ, wait 10 seconds and starts HS. Did set it up several years ago and only changed it when I implemented HS4, never failed yet.... works perfect and is free

            I know Fire Deamon is used by several users and seems to be satisfactory for them.. it might be a good alternative.

            I am here running HS 4.2.11.0 still. Did not know HS 4.2.13.0 was already available. Other then loosing my HSTouch because of the latest update all is working fine.
            -- Wim

            Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

            1210 devices/features ---- 392 events ----- 40 scripts

            Comment


              #7
              Ok Wim, thanks for the clarification. I'll have to weigh the pros and cons well. I've also been using the Windows "Task Scheduler" for a few years now and like you without any problem.

              HST is working well on the updates. You may need to update HSTouch too.

              Comment


                #8
                Nuno, HSTouch cannot be updated here anymore as my HSTouch device is still Windows XP. The new HSTouch is using .NET 8, so that excludes it. So after 14 years (still working) I would need to replace it. To bad as it is a beauty device that fits the room LOL
                -- Wim

                Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                1210 devices/features ---- 392 events ----- 40 scripts

                Comment


                  #9
                  I didn't know about this restriction on Windows XP, here I only use Android devices for all my projects.

                  Comment


                    #10
                    Originally posted by w.vuyk View Post
                    As far I know you cannot run deCONZ as a service as is, .
                    Full disclosure, i'm on Win10.

                    I think I figured this out tonight... Tried two ways...sc.exe (Doesn't work as the deconz.exe isn't set up to work like a service out of the box -- it will create the service fine, but timeout trying to start it.):
                    sc.exe create <new_service_name> binPath= "<path_to_the_service_executable>"

                    ...And using nssm ("The non-sucking service manager" (https://nssm.cc/usage) -- appears to work -- and it's free ):
                    ‚Äč
                    C:\>nssm install "deCONZ Service"

                    ...pops up a GUI
                    just point it to the exe in the bin folder (C:\Program Files (x86)\deCONZ\bin\deCONZ.exe)
                    and tell it to install the service.

                    One weird thing happened. I had set up deCONZ and a few devices and then the connection between Jowihue and deCONZ... After I killed the UI and installed the service, JowiHue couldn't talk to it anymore. I had to remove the bridge, and re-add it. Also, It appears like the act of adding it as a service cleared all the devices and reset the ConBee II stick and had to recreate my password and re-add my devices to it (probably because I set it up as a SYSTEM user service, instead of my interactive user?). Eh, after re-adding the bridge in jowihue, I have my devices running, and no deCONZ executable running in the foreground.

                    Also, seems if you stop/start the service, JowiHue can't seem to talk to the deCONZ api anymore. It looks like it needs to re-login/re-authenticate in order to talk to it again. If I restart JowiHue, it reconnects just fine. Is there a heartbeat to JowiHue that checks to make sure it can ping the deCONZ api?

                    If you do need to run the deCONZ.exe app interactively, you'll need to stop the service first as it seems only one instance can talk to the USB stick at a time.

                    Comment


                      #11
                      If you start running an interactive desktop app, like deconz, as a service, it is then running under a different user context. Hence why you might have to redo your settings. You would have to go into Service Manager (or whatever application you used to launch it as a service) and ensure that the user context it is running under is the same as when you were launching it as an interactive desktop app, like with Task Scheduler.

                      Comment


                        #12
                        Originally posted by TC1 View Post
                        ...and ensure that the user context it is running under is the same as when you were launching it as an interactive desktop app, like with Task Scheduler.
                        Yes, absolutely. If you change the login for the service, you WILL lose JowiHue connectivity to the bridge and will need to re-register the bridge... as well as possibly re-adding, re-naming your devices on the deCONZ/Phoscon side.

                        This conbee is a interesting animal. Instead of storing the devices on the stick, it appears it stores the devices with your user profile (or the user you ran the service with). I guess I got spoiled with the z-stick.

                        Also, if you're going to add your normal user as the service login -- chances are you'll have to enable "Log on as a service" by adding your username to the local service policy (how-to below)
                        https://learn.microsoft.com/en-us/sy...l-group-policy

                        Comment


                          #13
                          Just a quick plug to NSSM... I use it for deCONZ and a couple others - Free. Fire Daemon is far better, but I'm frugal, and it works.
                          https://nssm.cc/

                          Comment

                          Working...
                          X