Announcement

Collapse
No announcement yet.

Notify via email if laptop running HS loses power

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

    Notify via email if laptop running HS loses power

    I run HS on a laptop and wondering if HS can identify monitor power/charger status and send me an email if charger is unplugged (meaning that my house lost power).
    I found a script that I might be able to install as a stand alone app but It would be nice to have HS to do this checking.
    Thank you for your ideas

    #2
    While most laptops do power managment I do not think there are any plugins available unless you wrote one that would look at your laptop's switching over from external power to battery.

    That said you can purchase a Cyberpower EC350G really cheap ($45) connect it to your laptop and do this via a UPS plugin on Homeseer.
    - 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


      #3
      When I was using a laptop (for HS2 on Win XP) I ran a script to check the power source periodically:
      Code:
      Public Sub Main(ByVal parm As Object)
      
          Dim strPower As String
          Dim power As Type = GetType(System.Windows.Forms.PowerStatus)
          Dim pi As System.Reflection.PropertyInfo() = power.GetProperties()
      
          Dim objPropval As Object = pi(0).GetValue(System.Windows.Forms.SystemInformation.PowerStatus, Nothing)
      
          strPower = objPropval.ToString
          hs.SetDeviceString("U80", strPower)
      
          If strPower = "Online" Then 
                  hs.SetDeviceValue("U80", 100)
          Else
                  hs.SetDeviceValue("U80", 0)
          End If
      
           objPropval = Nothing
           pi = Nothing
           power = Nothing
      
      End Sub
      If you wanted an alert you could send an email whenever the device value changed. At minimum you'd need to modify the SetDevice statements to work with HS3. You'd also need to confirm the power status query format. I don't know if this works with Win 10.
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment


        #4
        You could use Blade's BLUPS plugin and create an event to notify you that it has switched to battery. Though I have a UPS, the mechanism is much the same utilizing Microsoft power management.

        Robert
        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
          Thank you for the UPS suggestion.
          I looked at the Cyberpower UPS and it does not have any "smart" features (no NIC or USB ports).
          Can you please explain how HS UPS plugin can recognize the state of the battery?

          Comment


            #6
            Uncle Michael,
            I am very interested in your solution because I would prefer the laptop battery to act as a UPS rather than buying a dedicated UPS.
            I have no knowledge in programming but I will try to use your script and see if I can guess how to modify it for my needs. Yes, an email notification is my goal.

            Comment


              #7
              Originally posted by Alexey View Post
              Yes, an email notification is my goal.
              As chance would have it, I recently posted the way I send myself alert messages in this thread: https://forums.homeseer.com/showthread.php?t=192429
              Mike____________________________________________________________ __________________
              HS3 Pro Edition 3.0.0.548, NUC i3

              HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

              Comment


                #8
                How about a free off-the-shelf solution: https://forums.homeseer.com/showthread.php?t=175564
                Jon

                Comment


                  #9
                  Originally posted by jon00 View Post
                  How about a free off-the-shelf solution: https://forums.homeseer.com/showthread.php?t=175564
                  Jon, I should have known you might have a solution in your bag of tricks!
                  Mike____________________________________________________________ __________________
                  HS3 Pro Edition 3.0.0.548, NUC i3

                  HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                  Comment


                    #10
                    Originally posted by Uncle Michael View Post
                    Jon, I should have known you might have a solution in your bag of tricks!
                    You just need to look on my welcome page! https://forums.homeseer.com/showthread.php?t=123313
                    Jon

                    Comment


                      #11
                      Great, thanks to all. It's been a big help and you pointed me to the direction that I could not find myself. I will be checking all options.
                      I's like to try and see what I can do with the script in conjunction with the email notification (the separate link from Uncle Michael).
                      I did not find Jon's plugin into the forum (searching did not bring anything). I will check if my HS can see the battery plugin via updater.

                      Comment


                        #12
                        Originally posted by Alexey View Post
                        I did not find Jon's plugin into the forum (searching did not bring anything). I will check if my HS can see the battery plugin via updater.
                        Here is a link. Also scan through Jon's Welcome post, and definitely visit his web site. He has assembled some very impressive and useful tools.
                        Mike____________________________________________________________ __________________
                        HS3 Pro Edition 3.0.0.548, NUC i3

                        HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                        Comment

                        Working...
                        X