Announcement

Collapse
No announcement yet.

Creating devices, parrent, childs

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

    #61
    Originally posted by enigmatheatre View Post
    spud
    Thanks for all your help Spud.

    I have two things that I am stuck on now if you would be so kind as to help me with them.

    1. I have the status graphics now working on my device but want to add the value range and have the following range but can't for the life of me work out the code to add it to the device
    Code:
     Dim VR As New ValueRange(-1000, 1000)
    VR.Suffix = "dB"
    VR.DecimalPlaces = 2
    2. I have my device config tab showing but have lots of dynamic content I want to put in it, can I add my own HTML to this and if so can you tell me how or should I just make it a feature page?

    Greig.
    1. I guess what you are looking for is a FeatureFactory method like AddGraphicForRange, but which takes a ValueRange as a parameter instead of just min and max values?
    I encourage you to post that feature request on Github https://github.com/HomeSeer/Plugin-SDK. You could even fork the SDK, add this method yourself and submit a pull request, this shouldn't be very difficult.

    2. I don't think you can use your own html in device config tab, so yes you would have to make it a feature page.

    Comment


      #62
      Tonlof,

      Yes the device creation has all changed. Have a look at the Netcam plugin on GitHub as it has some examples. Here

      Also see:

      Code:
      Case DeviceInfoIndex.diVolumeHSRef
                          ff = FeatureFactory.CreateFeature(IFACE_NAME)
                          ff.WithName("Volume")
                          ff.AsType(HomeSeer.PluginSdk.Devices.Identification.EFeatureType.Media, HomeSeer.PluginSdk.Devices.Identification.EMediaFeatureSubType.PlayerVolume)
                          Dim t As ValueRange = New ValueRange(0, 100)
                          Dim locv As HomeSeer.PluginSdk.Devices.Controls.ControlLocation = New HomeSeer.PluginSdk.Devices.Controls.ControlLocation With {
                              .Row = 2,
                              .Column = 1
                          }
                          ff.AddSlider(t, locv)
                          ff.WithMiscFlags({EMiscFlag.DeviceNoStatus, EMiscFlag.NoGraphicsDisplay})
                          Dim fd As NewFeatureData = ff.PrepareForHsDevice(HSDeviceRef)
                          CreateHSFeature = myHomeSeerSystem.CreateFeatureForDevice(fd)
      Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
      X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
      Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
      Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
      Scripts =
      Various

      Comment


        #63
        Originally posted by rjh View Post

        We are working on a way so you can specify which device(s) are your primary devices. Primary devices appear in the grid view as the "main" device. Right now we pick a primary by picking the first device that has controls. In your case your child devices (features) do not have controls so we don't pick one. We will have the selection option (primary ref) available soon.
        How will this work with Legacy HS3 devices? I just tried a HS3 app which generates a root device (parent) with no status plus two child devices which both have controls. In this situation, the old device utility page shows the 3 devices correctly, however the HS4 tile view etc only shows 2 devices with the root (keeping its title) taking the controls of the first child?

        Jon

        Comment


          #64
          Just fixed this today. The list view does not honor a primary device setting, so HS3 plugins should all display OK there. Fix is in build .30.

          Originally posted by jon00 View Post

          How will this work with Legacy HS3 devices? I just tried a HS3 app which generates a root device (parent) with no status plus two child devices which both have controls. In this situation, the old device utility page shows the 3 devices correctly, however the HS4 tile view etc only shows 2 devices with the root (keeping its title) taking the controls of the first child?
          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

          Comment


            #65
            Has methodology patterns/best practice been developed for plugins with rich devices/features to display nicely in HS4 like the network switch or weather examples mentioned in earlier posts? As a ‘simpler example’ how will the Z-Wave Aeon Labs Multilevel sensor with Temperature, Humidity, Light Level, UV, motion, tamper and battery be handled as devices and in UI? Will this Multilevel sensor be a single device with 7 features or 7 devices with 1 feature? What would be displayed in that tile (include time last updated)?

            I started to look at the HS4 alpha and have several plugins that group devices in HS3 but would be re-designed for HS4 based on the new device grouping/display methodology. My plugins cover media, weather (current, forecast, alert), UPS, SNMP monitoring, multilevel custom sensors, etc... all with ‘rich features’ and trying to get an understanding of how to approach devices and display of these in HS4 versus HS3.

            Comment


              #66
              We are putting together a doc that describes how particular devices are displayed. But right now we only define thermostats and media devices and the possible control layouts. These devices have views that are expected to be consistent. We can certainly add to based on feedback.

              For many other specific hardware devices, like a multisensor, there should be a root device and each feature would be a child. We are defining a specific view for this. We are going to add the ability to set a "primary" device. This would be the device that appears in the grid view.

              For things like weather, it may not make sense to have one root device and then many children. Maybe we can discuss the best way to provide this information? Maybe a root device for each location and then features for the information such as temp, etc.

              I hope to have this doc published this week.

              Originally posted by pcp View Post
              Has methodology patterns/best practice been developed for plugins with rich devices/features to display nicely in HS4 like the network switch or weather examples mentioned in earlier posts? As a ‘simpler example’ how will the Z-Wave Aeon Labs Multilevel sensor with Temperature, Humidity, Light Level, UV, motion, tamper and battery be handled as devices and in UI? Will this Multilevel sensor be a single device with 7 features or 7 devices with 1 feature? What would be displayed in that tile (include time last updated)?

              I started to look at the HS4 alpha and have several plugins that group devices in HS3 but would be re-designed for HS4 based on the new device grouping/display methodology. My plugins cover media, weather (current, forecast, alert), UPS, SNMP monitoring, multilevel custom sensors, etc... all with ‘rich features’ and trying to get an understanding of how to approach devices and display of these in HS4 versus HS3.
              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

              Comment


                #67
                This is how RFXCOM parent-child weather sensors are shown in HS3.
                Click image for larger version

Name:	weather.JPG
Views:	194
Size:	35.8 KB
ID:	1337709

                Comment


                  #68
                  Originally posted by rjh View Post
                  We are putting together a doc that describes how particular devices are displayed. But right now we only define thermostats and media devices and the possible control layouts. These devices have views that are expected to be consistent. We can certainly add to based on feedback.

                  For many other specific hardware devices, like a multisensor, there should be a root device and each feature would be a child. We are defining a specific view for this. We are going to add the ability to set a "primary" device. This would be the device that appears in the grid view.

                  For things like weather, it may not make sense to have one root device and then many children. Maybe we can discuss the best way to provide this information? Maybe a root device for each location and then features for the information such as temp, etc.

                  I hope to have this doc published this week.
                  rjh Jon, i there an update on this ?
                  Struggling a bit with the tileview:

                  Click image for larger version

Name:	tile.png
Views:	133
Size:	20.3 KB
ID:	1359694

                  ESPHome projects tend to have many sensors. Should I create a device for each sensor? This will pretty much clutter the entire interface/HSMobile with single feature devices.
                  How is this done e.g. with the Arduino plugin (I could not get it running in HS4). How should we 'model' a network switch with 24 ports ?

                  Comment


                    #69
                    I would do a single device for the hardware, then a feature for each port.

                    Originally posted by kriz83 View Post

                    rjh Jon, i there an update on this ?
                    Struggling a bit with the tileview:

                    Click image for larger version

Name:	tile.png
Views:	133
Size:	20.3 KB
ID:	1359694

                    ESPHome projects tend to have many sensors. Should I create a device for each sensor? This will pretty much clutter the entire interface/HSMobile with single feature devices.
                    How is this done e.g. with the Arduino plugin (I could not get it running in HS4). How should we 'model' a network switch with 24 ports ?
                    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                    Comment


                      #70
                      Thx for your reply rjh.
                      Will it display properly then in HSMobile when there are like 10+ features?
                      Is there a way already to determine the main feature(s) ?

                      Those features might contain lights, relays, sensors, garage doors, ...

                      Comment


                        #71
                        Originally posted by kriz83 View Post

                        rjh Jon, i there an update on this ?
                        Struggling a bit with the tileview:

                        Click image for larger version  Name:	tile.png Views:	0 Size:	20.3 KB ID:	1359694

                        ESPHome projects tend to have many sensors. Should I create a device for each sensor? This will pretty much clutter the entire interface/HSMobile with single feature devices.
                        How is this done e.g. with the Arduino plugin (I could not get it running in HS4). How should we 'model' a network switch with 24 ports ?
                        In the Arduino plug-in Greig creates a root (parent) for each board. This has the connection status. Every device for each board is a child (feature) of that board.

                        Click image for larger version  Name:	62DA377C-6B9F-466E-952A-28383ED29692.png Views:	0 Size:	324.2 KB ID:	1359844
                        HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                        Comment


                          #72
                          Is that the HS3 or HS4 plugin (can't get the HS4 version to work, doesn't continue when i try to add a board in step 1).

                          Having that many sensors will overload the header where the features are placed, so lots of them fall out of the view. Maybe that is OK, i don't know. But how about the 'main' feature then?

                          Comment


                            #73
                            Originally posted by kriz83 View Post
                            Is that the HS3 or HS4 plugin (can't get the HS4 version to work, doesn't continue when i try to add a board in step 1).

                            Having that many sensors will overload the header where the features are placed, so lots of them fall out of the view. Maybe that is OK, i don't know. But how about the 'main' feature then?
                            It is the HS3 version. Greig has not completed an HS4 version, though he is close. The HS3 version is working fine under HS4, though I have not tried to add a board. I’m home from work in a few hours. I will test it.
                            HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                            Comment


                              #74
                              Originally posted by rjh View Post
                              I would do a single device for the hardware, then a feature for each port.
                              It's actually a bit more complicated. You can have e.g. 2 lights, so there would be 4 buttons (2x on, 2xoff) with 2 sliders (brightness). If your board also controls there garage, then tilt/position/state are also added.

                              I have a hard time to decide which route i should take here.

                              Comparing it with the network switch. If you add 24 features, not all will be displayed in the tile overview.

                              Comment


                                #75


                                Originally posted by kriz83 View Post
                                Is that the HS3 or HS4 plugin (can't get the HS4 version to work, doesn't continue when i try to add a board in step 1).
                                This was all working fine. What version of HS are you using and I will test it with that. Were there any errors in the log?

                                Sent from my SM-G973F using Tapatalk

                                Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
                                X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
                                Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
                                Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
                                Scripts =
                                Various

                                Comment

                                Working...
                                X