Announcement

Collapse
No announcement yet.

Plugwise Pro - Stick, Stretch, Adam, Anna, Smile P1

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Plugwise Pro - Stick, Stretch, Adam, Anna, Smile P1

    DESCRIPTION

    This plug-in is designed to work with the Plugwise Stick, Plugwise Stretch gateway, Adam gateway, Anna thermostat and Smile P1 smart meter. There is no limit to the amount of devices and gateways it can support.

    REQUIREMENTS
    • This plugin is for HS3 or HS3PRO. It works with both Windows and Linux versions
    • Windows: .NET Framework 4.5 or later
    • Linux: mono 4.x or later
    • Properly configured Plugwise devices
    INSTALLATION

    There are no additional software requirements. The plug-in can be installed from the HS3 updater, and can be found under the section “Lighting & Primary Technology”.

    CONFIGURATION

    Please consult the documentation: HomeSeer HS3 Plugwise Pro 4.0.pdf

    TROUBLESHOOTING

    If anything doesn’t work, you can try one the following:
    • Ensure the devices are working correctly when using the dedicated Plugwise App, Plugwise Source program and/or web interface of the device(s).
    • Check the HS3 eventlog for any errors or clues.
    • If all fails, enable debug logging and log to file. Send me the log so I can investigate.

    NOTES
    • This plugin has been tested with the latest firmware on all relevant devices. Older versions might give unexpected results as they are untested.
    • There is an almost unlimited combination possible of the Stick, gateway, and appliances. I tested as much as possible, but I am sure I missed some combinations. Let me know if something doesn't seem to work as expected.
    • I do not own the Koen and Sting. So the probably do not work (correctly) and/or cause issues with the plugin. If you do own those devices and want to help me get them included in the plugin, let me know!
    stefxx

  • #2
    Screenshots

    General setup. You can have as many (Stick, Stretch, Smile P1, Anna or Adam) gateways as you want:
    Click image for larger version  Name:	Setup.PNG Views:	0 Size:	104.3 KB ID:	1308967


    Automatic detection of Plugwise Stick devices:
    Click image for larger version  Name:	Stick setup.PNG Views:	0 Size:	133.9 KB ID:	1308969


    Example of stick devices:
    Click image for larger version  Name:	Stick.png Views:	0 Size:	159.2 KB ID:	1308968


    Example of Anna devices:
    Click image for larger version  Name:	Anna.PNG Views:	0 Size:	399.8 KB ID:	1308971


    Example of Adam devices:
    Click image for larger version  Name:	AdamLisa.PNG Views:	0 Size:	425.0 KB ID:	1308970
    stefxx

    Comment


    • #3
      Release notes

      Version 4.0.0.5, released 20-10-2019
      • New: Support for Tom
      • New: Support for Floor (experimental)
      • Fixed: Adam device icons
      • Fixed: Support for latest Adam firmware (avoid XML null errors)
      Version 4.0.0.4, released 24-06-2019
      • Fixed: Log device updates (again)
      Version 4.0.0.3, released 23-06-2019
      • Improved: Multiple stick support (Linux)
      • Fixed: Log device updates
      Version 4.0.0.2, released 20-06-2019
      • Fixed: Crash when changing system date/time
      • Fixed: Crash on serial read error (Linux)
      • Fixed: Duplicate log entries
      • Improved: Serial port handling and disconnect/reconnect
      Version 4.0.0.1, released 12-06-2019
      • New: Support for the Plug connected to the Adam
      • Fixed: Unable to control Stick devices after upgrade
      • Fixed: Stick devices unresponsive after a multi-instance upgrade
      Version 4.0.0.0, released 06-06-2019
      • Changed: Version 4 and higher are no longer free
      • Removed: Script functions (use hs.DeviceValue etc instead)
      • Removed: Plugwise specific events (use regular event triggers instead)
      • Removed: Total usage device (use a Smile P1 for real total usage, or this event/script)
      • Stick:
        • New: Unlimited number of Sticks supported
        • Setup improved
          • New: Status indication if the accompanying process is started
          • Improved: More logging options
        • Improved: Communication with the stick
        • Removed: Offline check for Scan and Switch devices (they do not report their status on a regular interval)
        • Improved: Detection of devices (especially battery powered devices)
        • Removed: Manual adding of devices
        • Changed: HomeSeer devices are "Z-Wave" style with a root device and all device values are stored in separate child devices.
        • Changed: Online/Offline status is moved to the root device
      • Stretch:
        • New: Unlimited number of Stretch gateways supported
        • Setup improved
          • New: Network address discovery added
          • New: Status indication if the accompanying process is started
          • Improved: More logging options
        • New: Stretch 3.0 support added.
        • Improved: Stealth (M) modules are now working as expected
        • New: Scan, Sense and Switch modules support added
        • New: Switch can be configured to use all four buttons independently
      • Adam:
        • New: Support for the Adam gateway
        • New: Unlimited number of Adam gateways supported
        • New: All information from the Adam is available, with specific functions for thermostat values, offsets, relays, presets and buttons.
        • New: Lisa support
          • Koen and Sting have not been tested and most likely not (completely) work as expected, if at all.
      • Anna:
        • New: Support for the Anna thermostat
        • New: Unlimited number of Anna thermostats supported
        • New: All information from the Anna is available, with specific functions for thermostat values, offsets, relays, presets and buttons.
      • Smile P1:
        • New: Unlimited number of Smile P1 meters supported
        • Setup improved
          • New: Network address discovery added
          • New: Status indication if the accompanying process is started
          • Improved: More logging options

      Version 3.0.3.0, released 14-11-2015
      • Various stability improvements

      Version 3.0.2.3, released 08-08-2015
      • Fixed: Crashes when using Windows 10

      Version 3.0.2.2, released 20-07-2015
      • Fixed: Interval setting
      • Fixed: Crashes when Smile P1 fails to retrieve data
      • New: Retries for non-responsive devices (configurable, stick devices only)
      • New: "Unknown" status for non-responsive devices (configurable, stick devices only)
      • Improved: "Last Change" date/time behavior (required HS3 build 194 or higher, WARNING: this might impact events that trigger on the last update field):
        • If "Do not update device last change time if device value does not change" is disabled, it will update on both status change and power usage update
        • If "Do not update device last change time if device value does not change" is enabled, it will only update on status change, not on power usage update

      Version 3.0.2.1, released 17-05-2015
      • Fixed: Debug logging to file on Linux

      Version 3.0.2.0, released 02-01-2015
      • Improved: Removed unnecessary polling (usage data twice as fast!)
      • Fixed: Event not triggering when a condition is set

      Version 3.0.1.1, released 20-12-2014
      • Fix: Crash on corrupt XML received (again)

      Version 3.0.1.0, released 15-11-2014
      • New: Exclude from total device added
      • Fixed: Crash on corrupt XML received

      Version 3.0.0.0, released 10-11-2014
      • Initial features
        • Runs without Plugwise Source
        • Support for Plugwise Circle
        • Support for Plugwise Stealth
        • Support for Plugwise Sense
        • Support for Plugwise Scan
        • Support for Plugwise Switch
        • Support for Plugwise Smile P1
        • Support for Plugwise Stretch
        • Support for Energy charting
        • Support for HS3 Windows and Linux
        • Support Multi instances
        • Support Remote instances
      stefxx

      Comment


      • #4
        Grand Total Device

        Previous versions of the Plugwise Pro plugin included a virtual "Grand Total Device". As the implementation was inconsistent and not really useful, I decided to remove that feature completely. I believe a smart meter reader (like the Plugwise Smile P1) should be used instead. However, several people requested this feature so here is an event and script that can be used instead. The script can be modified to everyone's liking, and in the example below it includes both Plugwise and Z-Wave Watts and kW Hours devices in the calculation.

        First, create a new file in the <HomeSeer>\scripts folder, for instance "C:\Program Files (x86)\HomeSeer HS3\scripts\GrandTotalDevice.vb" and copy the code below:
        Code:
        Sub Main(parm As Object)
        
           Dim dv As Scheduler.Classes.DeviceClass = Nothing
           Dim CurrentUsage As Decimal = 0
           Dim TotalUsage As Decimal = 0
        
           Try
        
              Dim EN As Scheduler.Classes.clsDeviceEnumeration
              EN = hs.GetDeviceEnumerator
              If EN Is Nothing Then
                 Throw New Exception("Failed to get device enumerator")
                 Return
              End If
              Do
        
                 dv = EN.GetNext
                 If dv Is Nothing Then Continue Do
        
                 If dv.Device_Type_String(Nothing).ToLower().Contains("plugwise watts") Or
                    dv.Device_Type_String(Nothing).ToLower().Contains("z-wave watts") Then
                    CurrentUsage += dv.devValue(Nothing)
                 End If
        
                 If dv.Device_Type_String(Nothing).ToLower().Contains("plugwise kw hours") Or
                    dv.Device_Type_String(Nothing).ToLower().Contains("z-wave kw hours") Then
                    TotalUsage += dv.devValue(Nothing)
                 End If
        
              Loop Until EN.Finished
        
              hs.SetDeviceValueByRef(GetDevice(1, "Current Usage", "Plugwise-Current-Usage"), CurrentUsage / 1000, True)
              hs.SetDeviceValueByRef(GetDevice(2, "Total Usage", "Plugwise-Total-Usage"), TotalUsage, True)
        
           Catch ex As Exception
              Throw New Exception("Exception in Device Enumerator: " & ex.Message)
           End Try
        
        End Sub
        
        ' Type 1 = Watts, Type 2 = kWh
        Function GetDevice(Type As Integer, Name As String, Address As String) As Integer
        
           Dim dvref = hs.DeviceExistsAddress(Address, True)
           If dvref = -1 Then
        
              dvref = hs.NewDeviceRef(Name)
              Dim dv As Scheduler.Classes.DeviceClass = hs.GetDeviceByRef(dvref)
        
              dv.Address(hs) = Address
              dv.Image(hs) = Nothing
              dv.ImageLarge(hs) = "/images/Plugwise Pro/Stick.png"
              dv.MISC_Set(hs, Enums.dvMISC.NO_LOG)
              dv.MISC_Set(hs, Enums.dvMISC.STATUS_ONLY)
        
              ' clear all buttons and graphics
              hs.DeviceVSP_ClearAll(dv.Ref(hs), True)
              hs.DeviceVGP_ClearAll(dv.Ref(hs), True)
        
              Dim VSPair As New VSPair(HomeSeerAPI.ePairStatusControl.Status) With {
                 .PairType = VSVGPairType.Range,
                 .RangeStart = -2147483648,
                 .RangeEnd = 2147483647,
                 .RangeStatusDecimals = 3
              }
              Select Case Type
                 Case 1
                    VSPair.RangeStatusSuffix = " Kilowatts"
                 Case 2
                    VSPair.RangeStatusSuffix = " kW Hours"
              End Select
              hs.DeviceVSP_AddPair(dv.Ref(hs), VSPair)
        
              Dim VGPair As New VGPair With {
                 .PairType = VSVGPairType.Range,
                 .RangeStart = -2147483648,
                 .RangeEnd = 2147483647,
                 .Graphic = "/images/Plugwise Pro/electricity.gif"
              }
              hs.DeviceVGP_AddPair(dv.Ref(hs), VGPair)
        
           End If
        
           Return dvref
        
        End Function
        Then, create an event like below:
        Click image for larger version  Name:	GrandTotalDevicesEvent.PNG Views:	0 Size:	205.0 KB ID:	1309453

        That's it! The script will create two devices, one for Total Current Usage in Kilowatts, and one for Total Usage in kW Hours:
        Click image for larger version

Name:	GrandTotalDevices.PNG
Views:	200
Size:	44.1 KB
ID:	1309454
        stefxx

        Comment

        Working...
        X