YAGSA - Yet Another Group Structure Approach

I drawed them manually with a mind mapping tool (xmind), but if you write a script that visualises groups i am very interested

Ok Thanks.

I will start and keep you updated.

Ok I got some time today and came up with this short python script. group_graph.pdf (4.5 KB)
(It is really a python script but I had to rename it :-()
You of course need python (i tested with version 2) and maybe this additional package

  • pip install graphviz
    then just put it into the items folder and let it run.

It will create a pdf file with the dependencies.

There are some config options in the script itseld

  • the engine that is used (default is dot)
  • some colors you can set to your groups.

It does not look as nice as your mindmap, but it gives me a good overview about my group dependencies.

1 Like

Great. I will give it a try when i am back from my business trip

I really liked your post. That way I could easily rearrange all my groups. I actually put them into a seperate .items file:

Group gLocation
        Group gGroundFloor "Erdgeschoss"                                        (gLocation)
                Group gGF_gTemperatures "Temperaturen Erdgeschoss" <temperature>   (gGroundFloor)
                Group gGF_gHumidity "Luftfeuchtigkeit" <humidity>                  (gGroundFloor)
                Group gGF_gLivingroom "Wohnzimmer"                                 (gGroundFloor)
                        Group gGF_gLivingroom_gDoubleSwitch     "Doppelschalter Wohnzimmer"     (gGF_gLivingroom)
                        Group gGF_gLivingroom_gWindowSensor     "Sensor Terassent├╝r"            (gGF_gLivingroom)
                        Group gGF_gLivingroom_gWallplug         "Steckdose Verst├Ąrker"          (gGF_gLivingroom)
                        Group gGF_gLivingroom_gVolumio          "Volumio"                       (gGF_gLivingroom)
                        Group gGF_gLivingroom_gTV               "Fernseher"                     (gGF_gLivingroom)
                        Group gGF_gLivingroom_gReceiver         "Yamaha Receiver" <yamaha>      (gGF_gLivingroom)
                        Group gGF_gLivingroom_Natascha          "Natascha Sauger"  <vacuum>     (gGF_gLivingroom)
                                Group  gGF_gLivingroom_NataschaStatus "Status Details" <status>         (gGF_gLivingroom_Natascha)
                                Group  gGF_gLivingroom_NataschaCons "Verschlei├čteile" <line-increase>   (gGF_gLivingroom_Natascha)
                                Group  gGF_gLivingroom_NataschaDND  "Nicht st├Âren"  <moon>              (gGF_gLivingroom_Natascha)
                                Group  gGF_gLivingroom_NataschaHistory "Cleaning History" <calendar>    (gGF_gLivingroom_Natascha)
                                Group  gGF_gLivingroom_NataschaNetwork "Netzwerk"      <network>        (gGF_gLivingroom_Natascha) 
                Group gGF_gKitchen "K├╝che"                                          (gGroundFloor)
                        Group gGF_gKitchen_gSwitch      "Doppelschalter K├╝che"                  (gGF_gKitchen)
                        Group gGF_gKitchen_gSinkLight   "Licht Sp├╝le" <light>                   (gGF_gKitchen)
                        Group gGF_gKitchen_gDownLight   "Downlights K├╝che" <light>              (gGF_gKitchen)
                        Group gGF_gKitchen_gRadio       "Medion K├╝chenradio"                    (gGF_gKitchen)
                Group gGF_gUtilityRoom "Hauswirtschaftsraum"                        (gGroundFloor)
                        Group gGF_gUtilityRoom_gWindowSensor "Fenster Hauswirtschaftsraum" <window> (gGF_gUtilityRoom)
        Group gFirstFloor "Obergeschoss"                                          (gLocation)
                Group gFF_gTemperatures "Temperaturen Obergeschoss" <temperatures>      (gFirstFloor)
                Group gFF_gBathroom "Bad"                                               (gFirstFloor)
                        Group gFF_gBathroom_gLight "Bad Licht"                                  (gFF_gBathroom)
                        Group gFF_gBathroom_gThermostat "Bad Heizung"                           (gFF_gBathroom)
                                Group gFF_gBathroom_gThermostat_gTemperature                           (gFF_gBathroom_gThermostat)
                        Group gFF_gBathroom_gWindowSensor "Bad Fenster" <window>                (gFF_gBathroom)
                Group gFF_gBedroom   "Schlafzimmer"                                     (gFirstFloor)
                        Group gFF_gBedroom_gLight "Licht Schlafzimmer"                          (gFF_gBedroom)
                        Group gFF_gBedroom_gThermostat "Heizung Schlafzimmer"                   (gFF_gBedroom)
                                Group gFF_gBedroom_gThermostat_gTemperature                             (gFF_gBedroom_gThermostat)
                        Group gFF_gBedroom_gWindowSensor "Schlafzimmer Fenster" <window>        (gFF_gBedroom)
                Group gFF_gNora  "Noras Zimmer"                                         (gFirstFloor)
                        Group gFF_gNora_gThermostat "Heizung Nora"                              (gFF_gNora)
                                Group gFF_gNora_gThermostat_gTemperature                               (gFF_gNora_gThermostat)
                        Group gFF_gNora_gLightStrip                                             (gFF_gNora)
                Group gFF_gGuestRoom "G├Ąstezimmer"                                      (gFirstFloor)
                        Group gFF_gGuestRoom_gThermostat "Heizung G├Ąstezimmer"                  (gFF_gGuestRoom)
                                 Group gFF_gGuestRoom_gThermostat_gTemperature                          (gFF_gGuestRoom_gThermostat)
                Group gFF_gDressRoom "Ankleidezimmer"                                   (gFirstFloor)
                        Group gFF_gDressRoom_gThermostat "Heizung Ankleidezimmer"               (gFF_gDressRoom)
                                Group gFF_gDressRoom_gThermostat_gTemperature                           (gFF_gDressRoom_gThermostat)
        Group gGarden "Garten" <garden>
                Group gG_gUlf "Ulf M├Ąhroboter" <lawnmower>
                Group gG_gIrrigation "Beregnung"
                Group gG_gIrrigation_gTimer "Beregnung Zeitschaltuhr"
                Group gG_gTemperature <temperature>
                Group gG_gHumidity <humidity>
Group fg_gHeating "Heizung" <heating>
                Group fg_gHeating_fgSum "Summary"                               (fg_gHeating)
                Group fg_gHeating_gTemperatures                                 (fg_gHeating)
                Group fg_gHeating_gPresetNormal "Preset Normal"                 (fg_gHeating)

Group fg_gLighting "Beleuchtung"
                Group fg_gLighting_gKitchen "Beleuchtung K├╝che" <light>

Group fg_gPlugs "Steckdosen"
                Group fg_gPlugs_gRF433 "Funksteckdosen"
                Group fg_gPlugs_gOsram "Osram Schalter"

Group fg_gSwitches "Schalter"
                Group fg_gSwitches_gSonoff "Sonoff Schalter"
                Group fg_gSwitches_gScene "Szenenschalter"
                Group fg_gSwitches_gHue "Schalter Hue"
Group fg_gStatus "Status"
                Group fg_gStatus_gBattery "Batteriestatus" <battery>
                Group fg_gStatus_gSensor  "Sensoren" 
                        Group fg_gStatus_gTemperature "Temperaturen"
                        Group fg_gStatus_gSensor_gWindow "Fenstersensoren" <window>
                        Group fg_gStatus_gSensor_gMovement "Bewegungssensor"
                Group fg_gStatus_gTanken  "Benzinpreise" (fg_gStatus)
Group fg_gAqara "Aqara Temperatursensoren"

That way I have a really ncie overview. Now here comes my question:

How do structure your group switches, AVG,SUM and all those. I am trying to get some Temperature averages now and I realized that I have to pretty much start over to group my items.

I i see it right you have a mixture between location and function. Could you describe waht exactly you like to achive?

If you like to have the avaerage temperature from your firstfloor. There is a temperature gourp that cloud be modified with an AVG. The basic function to group things togehter is not changed.

If you like to have the same function across all rooms thats a different story.

Below you will find my current appraoch

//  Items File: sys_groups.items
//  Starting from the root gRoot, the main subgroups gLocation for location-related structuring and gContext for 
//  context-related structuring are created. The context-related groups can represent functional, logical, 
//  environmental or other contexts.

//  Group structure based on gRoot
Group gRoot "Gruppenwurzel" <edit_settings>

    //  Location based groups
    Group   gLocation "Ortsbezogene Gruppen"  <edit_settings> (gRoot)

        Group gFirstFloor "Obergescho├č" <edit_settings> (gLocation) // Code: FF
            Group   gFF_Bathroom        "Badezimmer"            <edit_settings> (gFirstFloor)   // Code: BA
            Group   gFF_WalktroughRoom  "Durchgangszimmer"      <edit_settings> (gFirstFloor)   // Code: WR
            Group   gFF_Corridor        "Flur"                  <edit_settings> (gFirstFloor)   // Code: CR
            Group   gFF_NeeleRoom       "Neeles Zimmer"         <edit_settings> (gFirstFloor)   // Code: NR
            Group   gFF_GuestRoom       "G├Ąstezimmer"           <edit_settings> (gFirstFloor)   // Code: GR
            Group   gFF_AimieRoom       "Aimies Zimmer"         <edit_settings> (gFirstFloor)   // Code: AR
            Group   gFF_Kitchen         "K├╝che"                 <edit_settings> (gFirstFloor)   // Code: KI

        Group gGroundFloor "Erdgescho├č" <edit_settings> (gLocation) // Code: GF
            Group   gGF_Hallway         "Diele"                 <edit_settings> (gGroundFloor)  // Code: HW
            Group   gGF_GuestToilet     "G├Ąste WC"              <edit_settings> (gGroundFloor)  // Code: GT
            Group   gGF_Office          "B├╝ro"                  <edit_settings> (gGroundFloor)  // Code: OF
            Group   gGF_Kitchen         "K├╝che"                 <edit_settings> (gGroundFloor)  // Code: KI
            Group   gGF_Livingroom      "Wohnzimmer"            <edit_settings> (gGroundFloor)  // Code: LR
            Group   gGF_Diningroom      "Esszimmer"             <edit_settings> (gGroundFloor)  // Code: DR
            Group   gGF_Bedroom         "Schlafzimmer"          <edit_settings> (gGroundFloor)  // Code: BR
            Group   gGF_Bathroom        "Badezimmer"            <edit_settings> (gGroundFloor)  // Code: BA

        Group gBasement "Keller" <edit_settings> (gLocation) // Code: BM
            Group   gBM_EntryCellar     "Eingangskeller"        <edit_settings> (gBasement)     // Code: EC
            Group   gBM_LaundryCellar   "Waschk├╝che"            <edit_settings> (gBasement)     // Code: LC
            Group   gBM_Boilerroom      "Heizungskeller"        <edit_settings> (gBasement)     // Code: BR
            Group   gBM_SupplyCellar    "Voratskeller"          <edit_settings> (gBasement)     // Code: SC

        Group gOutside "Drau├čen" <edit_settings> (gLocation) // Code: OS
            Group   gOS_House           "Haus"                  <edit_settings> (gOutside)      // Code: HO
            Group   gOS_Pool            "Pool"                  <edit_settings> (gOutside)      // Code: PL

        Group gNoLocation "Ohne Ort" <edit_settings> (gLocation) // Code: NL
            Group   gNL_Internet        "Internet Services"     <edit_settings> (gNoLocation)   // Code: IN
            Group   gNL_ICT             "IT-Infrastruktur"      <edit_settings> (gNoLocation)   // Code: IF
            Group   gNL_openHAB         "openHAB Items"         <edit_settings> (gNoLocation)   // Code: OH
            Group   gNL_PlantSensors    "Pflanzensensoren"      <edit_settings> (gNoLocation)   // Code: PS
            Group   gNL_SocketSwitch    "Steckdosenschalter"    <edit_settings> (gNoLocation)   // Code: SS
            Group   gNL_Other           "Sonstiges"             <edit_settings> (gNoLocation)   // Code: OT
            Group   gNL_Cloud           "Cloud"                 <edit_settings> (gNoLocation)   // Code: CL

    //  Context based groups
    Group gContext "Contextbezogene Gruppen" <edit_settings> (gRoot)

        // Groups to represent battery-related relations
        Group gBatteries "Batteriebezogene Gruppen" <measure_battery_75> (gContext)
            Group                           gBatteryOperated        "Battriebetriebene Ger├Ąte"  <measure_battery_50>    (gBatteries)
            Group                           gBatteryStatus          "Batteriezustand"           <measure_battery_75>    (gBatteries)

        // Group for representing different persistence scenarios
        Group gPersistence "Persistenz" <edit_settings> (gContext)
            Group                           gStandardTimeline       "Zeitreihe (Every Update)"  <edit_settings>         (gPersistence)
            Group                           gMinuteTimeline         "Zeitreihe (Every Minute)"  <edit_settings>         (gPersistence)

        // Group to represent trigger groups
        Group gTriggering "Triggergruppen" <edit_settings> (gContext)
            Group                           gPIRMotionTrigger       "Bewegungsmelder"           <edit_settings>         (gTriggering, gStandardTimeline)
            Group                           gContactTrigger         "T├╝r- und Fensterkontakte"  <edit_settings>         (gTriggering)
            Group                           gClimateCombineTrigger  "Temperatur/Luftfeuchte"    <edit_settings>         (gTriggering)

        // Group to represent contacts
        Group gContacts "Kontaktgruppen" <edit_settings> (gContext)
            Group:Contact:OR(OPEN, CLOSED)  gWindowContacts         "Fensterkontakte"           <edit_settings>         (gContacts, gStandardTimeline)
            Group:Contact:OR(OPEN, CLOSED)  gDoorContacts           "T├╝rkontakte"               <edit_settings>         (gContacts, gStandardTimeline)

        // Group to represent all irrigation related items
        Group gIrrigation "Bew├Ąsserung" <sani_irrigation> (gContext)

        // Groups to represent plant sensors
        Group gPlants "Pflanzen" <sani_irrigation> (gContext)
            Group                           gPlantNames             "Namen"                     <scene_plant>           (gPlants)
            Group                           gPlantLocations         "Orte"                      <building_plant>        (gPlants)
            Group                           gPlantStatus            "Status"                    <scene_plant>           (gPlants)
            Group                           gPlantMoisture          "Feuchte"                   <scene_plant>           (gPlants)
            Group                           gPlantMinMoisture       "Feuchte minimal"           <scene_plant>           (gPlants)
            Group                           gPlantMaxMoisture       "Feuchte maximal"           <scene_plant>           (gPlants)
            Group                           gPlantFertility         "D├╝nung"                    <scene_plant>           (gPlants)
            Group                           gPlantMinFertility      "D├╝nung minimal"            <scene_plant>           (gPlants)
            Group                           gPlantMaxFertility      "D├╝nung maximal"            <scene_plant>           (gPlants)
            Group                           gPlantEnabled           "Freigabe"                  <scene_plant>           (gPlants)
            Group:Switch:OR(ON, OFF)        gPlantConnectionCtl     "Verbindungskontrolle [%d]" <scene_plant>           (gPlants)

        // Groups to represent petrol stations
        Group gPetrolStations "Tankstellen" <scene_gas_station> (gContext)
            Group:Number:MIN                gPetrolStation_Prices   "Preise"                    <scene_gas_station>     (gPetrolStations)
            Group                           gPetrolStation_Open     "Ge├Âffnet"                  <scene_gas_station>     (gPetrolStations)
            Group                           gPetrolStation_Display  "Anzeige"                   <scene_gas_station>     (gPetrolStations)

As you can see the location approach is very strict and the context approach not so much. Each of my thingy has its own group that is assigned one or mor other groups