[SOLVED] All my light switched and power sockets start up as NULL

Hi I’m running OH 2.2 on my Raspberry Pi 3 I had the Pi set up and running as a test set up for a few months while I got things sorted out. But one thing that has haunted me is that on a major change to either the Items or Sitemap files or on a system “reboot now” the UI always shows the light switches and power sockets as being on (the Icons are lit as if the item light was on but the actual UI switch was always off). I have to turn each switch on then off again to clear the Icons and get everything showing OFF. Below is the log file showing after a reboot and then one switch was operated on then off again, you will note that the items started in the “NULL” mode until it was switched on and then off again, where the log reports the item changed from ON to OFF.

2018-08-18 22:38:11.023 [vent.ItemStateChangedEvent] - FF_CharliesBedroom_Light14 changed from NULL to ON

2018-08-18 22:38:11.029 [GroupItemStateChangedEvent] - gLights changed from OFF to ON through FF_CharliesBedroom_Light14

2018-08-18 22:38:11.044 [GroupItemStateChangedEvent] - gLight14 changed from NULL to ON through FF_CharliesBedroom_Light14

2018-08-18 22:38:34.016 [vent.ItemStateChangedEvent] - FF_CharliesBedroom_Light14 changed from ON to OFF

2018-08-18 22:38:34.024 [GroupItemStateChangedEvent] - gLight14 changed from ON to OFF through FF_CharliesBedroom_Light14

2018-08-18 22:38:34.027 [GroupItemStateChangedEvent] - gLights changed from ON to OFF through FF_CharliesBedroom_Light14

The actual items retain their last actual state after a reboot of the system so the actual lights are usually OFF after a ststem reboot, however now that I have the server workin with my Sonoff T1 & T2 wall switches in my house, I have noticed sometimes that one light would turn on after a reboot but I’m not sure if that was due to a latent operation prior to rebooting the system.

My default.items looks like this:

Group    Home                                "Ustou"                       <house>

Group    GF                                  "Ground Floor"                <groundfloor>      (Home, StartPersist)
Group    FF                                  "First Floor"                 <firstfloor>       (Home, Startpersist)

Group    GF_Dining                           "Dining"                      <diningroom>       (Home, GF, StartPersist)
Group    GF_Driveway                         "Driveway"                    <car>              (Home, GF, StartPersist)
Group    GF_Entryway                         "Entryway"                    <frontdoor>        (Home, GF, StartPersist)
Group    GF_Kitchen                          "Kitchen"                     <kitchen>          (Home, GF, StartPersist)
Group    GF_LaundryRoom                      "Laundry Room"                <washingmachine>   (Home, GF, StartPersist)
Group    GF_Lounge                           "Lounge"                      <sofa>             (Home, GF, StartPersist)
Group    GF_FamilyRoom                       "Family Room"                 <parents_2_4>      (Home, GF, StartPersist)
Group    GF_Toilet                           "Toilet"                      <toilet>           (Home, GF, StartPersist)
Group    FF_GuestRoom                        "Guest Room"                  <bedroom_red>      (Home, FF, StartPersist)
Group    FF_MasterBedroom                    "Master Bedroom"              <parents_3_2>      (Home, FF, StartPersist)
Group    FF_StorageRoom                      "Storage Room"                <suitcase>         (Home, FF, StartPersist)
Group    FF_Bathroom                         "Bathroom"                    <bath>             (Home, FF, StartPersist)
Group    FF_LiliBedroom                      "Lili Room"                   <girl_3>           (Home, FF, StartPersist)
Group    FF_CharliesBedroom                  "Charlies Room"               <boy_3>            (Home, FF, StartPersist)
Group    FF_Hallway                          "Hallway"                     <corridor>         (Home, FF, StartPersist)

Switch   openhabBackup                       "RaspberryPi Image Back-up"   <floppy>           { expire="3s, command=OFF" }
Switch   GF_Dining_Light1                    "Dining Room Ceiling"         <light>            (GF_Dining, gLights, gLight1, StartPersist)                    [ "Lighting"   ]   { mqtt=">[broker:cmnd/dining/power2:command:*:default], <[broker:stat/dining/POWER2:state:default]", autoupdate="true" }
Switch   GF_Dining_FloorLight                "Dining Floor Lamp"           <light>            (GF_Dining, gLights, gFloorLight, StartPersist)                [ "Lighting"   ]   { mqtt=">[broker:cmnd/floorlamp/power:command:*:default], <[broker:stat/floorlamp/POWER:state:default]", autoupdate="true" }
Switch   GF_Dining_TableLight3               "Telephone Table Lamp"        <light>            (GF_Dining, gLights, gTableLight3, StartPersist)               [ "Lighting"   ]   { mqtt=">[broker:cmnd/table3/power:command:*:default], <[broker:stat/table3/POWER:state:default]", autoupdate="true" }
Switch   GF_Driveway_HeatMat1                "Driveway Heat Mat LH"        <poweroutlet>      (GF_Driveway, gPowerOutlets, gHeatMat1, StartPersist)          [ "Switchable" ]
Switch   GF_Driveway_HeatMat2                "Driveway Heat Mat RH"        <poweroutlet>      (GF_Driveway, gPowerOutlets, gHeatMat2, StartPersist)          [ "Switchable"]
Switch   GF_Entryway_Light2                  "Entrance Ceiling"            <light>            (gLights, gLight2, StartPersist)                               [ "Lighting"   ]   { mqtt=">[broker:cmnd/kitchen/power2:command:OFF:OFF], <[broker:stat/kitchen/POWER2:state:default]", expire="3s,command=OFF" }
Switch   GF_Entryway_Light2_Toggle           "Entrance Ceiling"            <light>            (GF_Entryway, FF_Hallway, gLights, gLight2, StartPersist)      [ "Lighting" ] { mqtt=">[broker:cmnd/kitchen/power2:command:ON:ON], >[broker:cmnd/kitchen/power2:command:OFF:ON]" }
Switch   GF_Kitchen_Light3                   "Kitchen Downlights"          <light>            (GF_Kitchen, gLights, gLight3, StartPersist)                   [ "Lighting"   ]   { mqtt=">[broker:cmnd/kitchen/power1:command:*:default], <[broker:stat/kitchen/POWER1:state:default]", autoupdate="true" }
Switch   GF_Kitchen_Kettle                   "Kettle"                      <poweroutlet>      (GF_Kitchen, gPowerOutlets, gKettle, StartPersist)             [ "Switchable" ]
Switch   GF_Kitchen_CoffeeMachine            "Coffee Machine"              <poweroutlet>      (GF_Kitchen, gPowerOutlets, gCoffeeMachine, StartPersist)      [ "Switchable" ]
Switch   GF_LaundryRoom_Light4               "Laundry Room Ceiling"        <light>            (GF_LaundryRoom, gLights, gLight4, StartPersist)               [ "Lighting"   ]   { mqtt=">[broker:cmnd/laundry/power:command:*:default], <[broker:stat/laundry/POWER:state:default]", autoupdate="true" }
Switch   GF_LaundryRoom_WashingMachine       "Washing Machine"             <poweroutlet>      (GF_LaundryRoom, gPowerOutlets, gWashingMachine, StartPersist) [ "Switchable" ]
Switch   GF_Lounge_Light5                    "Lounge Ceiling"              <light>            (GF_Lounge, gLights, gLight5, StartPersist)                    [ "Lighting"   ]   { mqtt=">[broker:cmnd/dining/power1:command:*:default], <[broker:stat/dining/POWER1:state:default]", autoupdate="true" }
Switch   GF_Lounge_TableLight1               "Lounge Table Lamp LH"        <light>            (GF_Lounge, gLights, gTableLight1, StartPersist)               [ "Lighting"   ]   { mqtt=">[broker:cmnd/table1/power:command:*:default], <[broker:stat/table1/POWER:state:default]", autoupdate="true" }
Switch   GF_Lounge_TableLight2               "Lounge Table Lamp RH"        <light>            (GF_Lounge, gLights, gTableLight2, StartPersist)               [ "Lighting"   ]   { mqtt=">[broker:cmnd/table2/power:command:*:default], <[broker:stat/table2/POWER:state:default]", autoupdate="true" }
Switch   GF_FamilyRoom_Light6                "Family Room Ceiling"         <light>            (GF_FamilyRoom, gLights, gLight6, StartPersist)                [ "Lighting"   ]   { mqtt=">[broker:cmnd/family/power:command:*:default], <[broker:stat/family/POWER:state:default]", autoupdate="true" }
Switch   GF_FamilyRoom_Power                 "Music Power Outlet"          <poweroutlet>      (GF_FamilyRoom, gPowerOutlets, gPower, StartPersist)           [ "Switchable" ]
Switch   GF_Toilet_Light7                    "Toilet Ceiling"              <light>            (GF_Toilet, gLights, gLight7, StartPersist)                    [ "Lighting"   ]   { mqtt=">[broker:cmnd/toilet/power:command:*:default], <[broker:stat/toilet/POWER:state:default]", autoupdate="true" }

Switch   FF_GuestRoom_Light8                 "Guest Room Ceiling"          <light>            (FF_GuestRoom, gLights, gLight8, StartPersist)                 [ "Lighting"   ]   { mqtt=">[broker:cmnd/guest/power:command:*:default], <[broker:stat/guest/POWER:state:default]", autoupdate="true" }
Switch   FF_MasterBedroom_Light9             "Master Bedroom Ceiling"      <light>            (FF_MasterBedroom, gLights, gLight9, StartPersist)             [ "Lighting"   ]   { mqtt=">[broker:cmnd/master/power:command:*:default], <[broker:stat/master/POWER:state:default]", autoupdate="true" }
Switch   FF_MasterBedroom_MumBlanket         "Mum Blanket"                 <poweroutlet>      (FF_MasterBedroom, gPowerOutlets, gMumBlanket, StartPersist)   [ "Switchable" ]
Switch   FF_MasterBedroom_DadBlanket         "Dad Blanket"                 <poweroutlet>      (FF_MasterBedroom, gPowerOutlets, gDadBlanket, StartPersist)   [ "Switchable" ]
Switch   FF_StorageRoom_Light10              "Storage Room Ceiling"        <light>            (FF_StorageRoom, gLights, gLight10, StartPersist)              [ "Lighting"   ]   { mqtt=">[broker:cmnd/storeroom/power:command:*:default], <[broker:stat/storeroom/POWER:state:default]", autoupdate="true" }
Switch   FF_Bathroom_Light11                 "Bathroom Ceiling"            <light>            (FF_Bathroom, gLights, gLight11, StartPersist)                 [ "Lighting"   ]   { mqtt=">[broker:cmnd/bathroom/power:command:*:default], <[broker:stat/bathroom/POWER:state:default]", autoupdate="true" }
Switch   FF_Bathroom_Extractor               "Extractor Fan"               <poweroutlet>      (FF_Bathroom, gPowerOutlets, gExtractor, StartPersist)         [ "Switchable" ]
Switch   FF_Bathroom_TowelHeater             "Towel Heater"                <poweroutlet>      (FF_Bathroom, gPowerOutlets, gTowelHeater, StartPersist)       [ "Switchable" ]
Switch   FF_Hallway_Light12                  "Hall Ceiling"                <light>            (gLights, gLight12, StartPersist)                              [ "Lighting"   ]  { mqtt=">[broker:cmnd/kitchen/power2:command:*:default], <[broker:stat/kitchen/POWER2:state:default]", expire="3s,command=OFF" }
Switch   FF_LiliBedroom_Light13              "Lili Ceiling"                <light>            (FF_LiliBedroom, gLights, gLight13, StartPersist)              [ "Lighting"   ]   { mqtt=">[broker:cmnd/lili/power:command:*:default], <[broker:stat/lili/POWER:state:default]", autoupdate="true" }
Switch   FF_CharliesBedroom_Light14          "Charlie Ceiling"             <light>            (FF_CharliesBedroom, gLights, gLight14, StartPersist)          [ "Lighting"   ]   { mqtt=">[broker:cmnd/charlie/power:command:*:default], <[broker:stat/charlie/POWER:state:default]", autoupdate="true" }
Switch   FF_LiliBedroom_LiliBlanket          "Lili Blanket"                <poweroutlet>      (FF_LiliBedroom, gPowerOutlets, gLiliBlanket, StartPersist)    [ "Switchable" ]
Switch   FF_CharliesBedroom_CharliesBlanket  "Charlies Blanket"            <poweroutlet>      (FF_CharliesBedroom, gPowerOutlets, gCharliesBlanket, StartPersist) [ "Switchable" ]

Group:Switch:OR(ON, OFF)   gLights            "Master Light Switch"        <switch>        (Home, StartPersist)     [ "Lighting" ]
Group:Switch:OR(ON, OFF)   gLight1            "Dining Room Ceiling"        <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight2            "Entrance Ceiling Light"     <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight3            "Kitchen Ceiling"            <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight4            "Laundry Ceiling"            <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight5            "Lounge Ceiling"             <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight6            "Family Room Ceiling"        <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight7            "Toilet Ceiling"             <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight8            "Guestroom Ceiling"          <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight9            "Master Bedroom Ceiling"     <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight10           "Storage Room Ceiling"       <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight11           "Bathroom Ceiling"           <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight12           "Hallway Ceiling"            <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight13           "Lili Bedroom Ceiling"       <light>         (Home)
Group:Switch:OR(ON, OFF)   gLight14           "Charlie Bedroom Ceiling"    <light>         (Home)
Group:Switch:OR(ON, OFF)   gFloorlight        "Floor Light"                <light>         (Home)
Group:Switch:OR(ON, OFF)   gTablelight1       "Table Light1"               <light>         (Home)
Group:Switch:OR(ON, OFF)   gTablelight2       "Table Light2"               <light>         (Home)
Group:Switch:OR(ON, OFF)   gTablelight3       "Table Light3"               <light>         (Home)

Group:Switch:OR(ON, OFF)   gPowerOutlets      "Master Power Socket Switch" <switch>        (Home, StartPersist)     [ "Switchable" ]
Group:Switch:OR(ON, OFF)   gHeatmat1          "Heat Mat 1"                 <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gHeatmat2          "Heat Mat 2"                 <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gKettle            "Kettle"                     <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gCoffeemachine     "Coffee Machine"             <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gWashingmachine    "Washing Machine"            <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gPower             "Music Power Outlet"         <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gMumblanket        "Mum Blanket"                <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gDadblanket        "Dad Blanket"                <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gLiliblanket       "Lili Blanket"               <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gCharliesblanket   "Charlies Blanket"           <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gExtractor         "Extractor"                  <poweroutlet>   (Home)
Group:Switch:OR(ON, OFF)   gTowelheater       "Towel Heater"               <poweroutlet>   (Home)

// 5-Way Multi Sensor (temp, humid, light, motion, batt)
Number   Hallway_Temperature "Hallway Temperature [%.1f °C]"    <temperature>    (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_multilevel,sensor_type=1,sensor_scale=0"}
Number   Hallway_Humidity    "Hallway Humidity    [%.0f %%]"    <humidity>       (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_multilevel,sensor_type=5"}
Number   Hallway_Luminance   "Hallway Luminance   [%.0f Lux]"   <light-off>      (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_multilevel,sensor_type=3"}
Contact  Hallway_Motion      "Hallway Motion [%s]"              <motion>         (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_binary,respond_to_basic=true"}
Number   sensor_1_battery    "Battery [%s %%]"                  <battery>        (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=battery"}

// Fire Detection via High (>45degC) Temperature sensing
// Group    SensorTemperature    "Temperatures"    <temperature>

Number   Sensor_MasterTemperature    "Master Bedroom [%.1f °C]"   <temperature> (FF_MasterBedroom,gSensorTemperature)  { mqtt="<[broker:tele/mastertemp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_MasterHumidity       "Master Bedroom [%.1f %%]"   <humidity>    (FF_MasterBedroom,gSensorHumidity)     { mqtt="<[broker:tele/mastertemp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_MasterPressure       "Master Bedroom [%.1f bar]"  <pressure>    (FF_MasterBedroom,gSensorPressure)     { mqtt="<[broker:tele/mastertemp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_LiliTemperature      "Lili Bedroom [%.1f °C]"     <temperature> (FF_LiliBedroom,gSensorTemperature)  { mqtt="<[broker:tele/lilitemp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_LiliHumidity         "Lili Bedroom [%.1f %%]"     <humidity>    (FF_LiliBedroom,gSensorHumidity)     { mqtt="<[broker:tele/lilitemp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_LiliPressure         "Lili Bedroom [%.1f bar]"    <pressure>    (FF_LiliBedroom,gSensorPressure)     { mqtt="<[broker:tele/lilitemp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_CharlieTemperature   "Charlie Bedroom [%.1f °C]"  <temperature> (FF_CharliesBedroom,gSensorTemperature)  { mqtt="<[broker:tele/charlietemp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_CharlieHumidity      "Charlie Bedroom [%.1f %%]"  <humidity>    (FF_CharliesBedroom,gSensorHumidity)     { mqtt="<[broker:tele/charlietemp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_CharliePressure      "Charlie Bedroom [%.1f bar]" <pressure>    (FF_CharliesBedroom,gSensorPressure)     { mqtt="<[broker:tele/charlietemp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_GuestTemperature     "Guest Bedroom [%.1f °C]"    <temperature> (FF_GuestRoom,gSensorTemperature)  { mqtt="<[broker:tele/guesttemp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_GuestHumidity        "Guest Bedroom [%.1f %%]"    <humidity>    (FF_GuestRoom,gSensorHumidity)     { mqtt="<[broker:tele/guesttemp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_GuestPressure        "Guest Bedroom [%.1f bar]"   <pressure>    (FF_GuestRoom,gSensorPressure)     { mqtt="<[broker:tele/guesttemp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_BathroomTemperature  "Bathroom [%.1f °C]"         <temperature> (FF_Bathroom,gSensorTemperature)  { mqtt="<[broker:tele/bathroomtemp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_BathroomHumidity     "Bathroom [%.1f %%]"         <humidity>    (FF_Bathroom,gSensorHumidity)     { mqtt="<[broker:tele/bathroomtemp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_BathroomPressure     "Bathroom [%.1f bar]"        <pressure>    (FF_Bathroom,gSensorPressure)     { mqtt="<[broker:tele/bathroomtemp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_LoungeTemperature    "Lounge [%.1f °C]"           <temperature> (GF_Lounge,gSensorTemperature)  { mqtt="<[broker:tele/LoungeTemp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_LoungeHumidity       "Lounge [%.1f %%]"           <humidity>    (GF_Lounge,gSensorHumidity)     { mqtt="<[broker:tele/LoungeTemp/SENSOR:state:JSONPATH($.BME280.Humidity)]", autoupdate="true", expire="11m, state=0" }
Number   Sensor_LoungePressure       "Lounge [%.1f bar]"          <pressure>    (GF_Lounge,gSensorPressure)     { mqtt="<[broker:tele/LoungeTemp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_FamilyTemperature    "Family Room [%.1f °C]"      <temperature> (GF_FamilyRoom,gSensorTemperature)  { mqtt="<[broker:tele/familytemp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_FamilyHumidity       "Family Room [%.1f %%]"      <humidity>    (GF_FamilyRoom,gSensorHumidity)     { mqtt="<[broker:tele/familytemp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_FamilyPressure       "Family Room [%.1f bar]"     <pressure>    (GF_FamilyRoom,gSensorPressure)     { mqtt="<[broker:tele/familytemp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_Watertank1Temperature   "Water Heater 1 [%.1f °C]"     <temperature> (GF_LaundryRoom,gSensorTemperature)  { mqtt="<[broker:tele/tank1temp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_Watertank1Humidity      "Water Heater 1 [%.1f %%]"     <humidity>    (gSensorHumidity)                    { mqtt="<[broker:tele/tank1temp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_Watertank1Pressure      "Water Heater 1 [%.1f bar]"    <pressure>    (gSensorPressure)                    { mqtt="<[broker:tele/tank1temp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_Watertank2Temperature   "Water Heater 2 [%.1f °C]"     <temperature> (GF_LaundryRoom,gSensorTemperature)  { mqtt="<[broker:tele/tank2temp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_Watertank2Humidity      "Water Heater 2 [%.1f %%]"     <humidity>    (gSensorHumidity)                    { mqtt="<[broker:tele/tank2temp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_Watertank2Pressure      "Water Heater 2 [%.1f bar]"    <pressure>    (gSensorPressure)                    { mqtt="<[broker:tele/tank2temp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_UtilityTemperature   "Utility Room [%.1f °C]"     <temperature> (GF_LaundryRoom,gSensorTemperature)  { mqtt="<[broker:tele/utilitytemp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_UtilityHumidity      "Utility Room [%.1f %%]"     <humidity>    (GF_LaundryRoom,gSensorHumidity)     { mqtt="<[broker:tele/utilitytemp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_UtilityPressure      "Utility Room [%.1f bar]"    <pressure>    (GF_LaundryRoom,gSensorPressure)     { mqtt="<[broker:tele/utilitytemp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

Number   Sensor_KitchenTemperature   "Kitchen Room [%.1f °C]"     <temperature> (GF_KitchenRoom,gSensorTemperature)  { mqtt="<[broker:tele/kitchentemp/SENSOR:state:JSONPATH($.BME280.Temperature)]", expire="11m, state=5" }
Number   Sensor_KitchenHumidity      "Kitchen Room [%.1f %%]"     <humidity>    (GF_KitchenRoom,gSensorHumidity)     { mqtt="<[broker:tele/kitchentemp/SENSOR:state:JSONPATH($.BME280.Humidity)]", expire="11m, state=0" }
Number   Sensor_KitchenPressure      "Kitchen Room [%.1f bar]"    <pressure>    (GF_KitchenRoom,gSensorPressure)     { mqtt="<[broker:tele/kitchentemp/SENSOR:state:JSONPATH($.BME280.Pressure)]", expire="11m, state=0" }

…and my Default.Sitemap looks like the next reply:

Thank you for any advice to hopefully allow the system to start up with all switches and sockets ICON’s in the OFF position (i.e. all switched and sockets NOT in a NULL status.


Here is my Default.Sitemap:

 Frame label="Ground Floor" icon="groundfloor" {
        Group item=GF_Driveway
        Group item=GF_Entryway
        Group item=GF_LaundryRoom
        Group item=GF_Toilet
        Group item=GF_Kitchen
        Group item=GF_Dining
        Group item=GF_Lounge
        Group item=GF_FamilyRoom

    Frame label="First Floor" icon="firstfloor" {
        Group item=FF_MasterBedroom
        Group item=FF_GuestRoom
        Group item=FF_LiliBedroom
        Group item=FF_CharliesBedroom
        Group item=FF_Bathroom
        Group item=FF_Hallway
        Group item=FF_StorageRoom

    Frame label="Ground Floor Lights" icon="light" {
            Switch  item=gLights                            label="Master Light Switch" mappings=[OFF="Off", ON="On"]
            Default item=gLights                            label="" icon=""
            Default item=GF_Entryway_Light2_Toggle          label="Entryway Ceiling"
            Default item=GF_LaundryRoom_Light4              label="Laundry Room Ceiling"
            Default item=GF_Toilet_Light7                   label="Toilet Ceiling"
            Default item=GF_Kitchen_Light3                  label="Kitchen Ceiling"
            Default item=GF_Dining_Light1                   label="Dining Ceiling"
            Default item=GF_Lounge_Light5                   label="Lounge Ceiling"
            Default item=GF_FamilyRoom_Light6               label="Family Room Ceiling"
            Default item=GF_Lounge_TableLight1              label="Lounge Table Lamp LH"
            Default item=GF_Lounge_TableLight2              label="Lounge Table Lamp RH"
            Default item=GF_Dining_FloorLight               label="Dining Floor Lamp"
            Default item=GF_Dining_TableLight3              label="Telephone Table Lamp"

    Frame label="First Floor Lights" icon="light" {
            Default item=FF_MasterBedroom_Light9            label="Master Bedroom Ceiling"
            Default item=FF_GuestRoom_Light8                label="Guest Room Ceiling"
            Default item=FF_LiliBedroom_Light13             label="Lili Bedroom Ceiling"
            Default item=FF_CharliesBedroom_Light14         label="Charlies Bedroom Ceiling"
            Default item=FF_Bathroom_Light11                label="Bathroom Ceiling"
            Default item=GF_Entryway_Light2_Toggle          label="Hallway Ceiling"
            Default item=FF_StorageRoom_Light10             label="Storage Room Ceiling"

    Frame label= "Ground Floor Power Outlets"               icon="poweroutlet" {
            Switch  item=gPowerOutlets                      label="Master Socket Switch" mappings=[OFF="All Off"]
            Default item=gPowerOutlets                      label="" icon=""
            Default item=GF_Driveway_HeatMat1               label="Driveway Heat Mat LH"
            Default item=GF_Driveway_HeatMat2               label="Driveway Heat Mat RH"
            Default item=GF_Kitchen_Kettle                  label="Kettle"
            Default item=GF_Kitchen_CoffeeMachine           label="Coffee Machine"
            Default item=GF_LaundryRoom_WashingMachine      label="Washing Machine"
            Default item=GF_FamilyRoom_Power                label="Music Power Outlet"

    Frame label= "First Floor Power Outlets"                icon="poweroutlet" {
            Default item=FF_MasterBedroom_MumBlanket        label="Mum's Blanket"
            Default item=FF_MasterBedroom_DadBlanket        label="Dad's Blanket"
            Default item=FF_LiliBedroom_LiliBlanket         label="Lili Blanket"
            Default item=FF_CharliesBedroom_CharliesBlanket label="Charlies Blanket"
            Default item=FF_Bathroom_Extractor              label="Extractor Fan"
            Default item=FF_Bathroom_TowelHeater            label="Towel Rail"

    Frame label= "Room Sensors" {
     /*       Text item=Hallway_Temperature label="Hallway Temperature"    icon="temperature"    (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_multilevel,sensor_type=1,sensor_scale=0"}
              Text item=Hallway_Humidity    label="Hallway Humidity"       icon="humidity"       (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_multilevel,sensor_type=5"}
              Text item=Hallway_Luminance   label="Hallway Luminance"      icon="light-off"      (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_multilevel,sensor_type=3"}
              Switch item=Hallway_Motion      label="Hallway Motion"         icon="motion"         (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=sensor_binary,respond_to_basic=true"}
     /*       Text item=sensor_1_battery    label="Battery Level"          icon="battery"        (FF_Hallway,GF_Entryway,TemperatureSensor)    {zwave="2:0:command=battery"}   */

            Text item=Sensor_MasterTemperature          label="Master Temperature"    icon="temperature"    valuecolor=[>35="red",>25="orange",>5="green",<5="blue"]
            Text item=Sensor_MasterHumidity             label="Master Humidity"       icon="humidity"       valuecolor=[>70="blue",>30="green",<30="red"]
            Text item=Sensor_MasterPressure             label="Master Pressure"       icon="pressure"

            Text item=Sensor_LiliTemperature            label="Lili Temperature"      icon="temperature"    valuecolor=[>35="red",>25="orange",>5="green",<5="blue"]
            Text item=Sensor_LiliHumidity               label="Lili Humidity"         icon="humidity"       valuecolor=[>70="blue",>30="green",<30="red"]
            Text item=Sensor_LiliPressure               label="Lili Pressure"         icon="pressure"
            Text item=Sensor_CharlieTemperature         label="Charlie Temperature"   icon="temperature"    valuecolor=[>35="red",>25="orange",>5="green",<5="blue"]
            Text item=Sensor_CharlieHumidity            label="Charlie Humidity"      icon="humidity"       valuecolor=[>70="blue",>30="green",<30="red"]
            Text item=Sensor_CharliePressure            label="Charlie Pressure"      icon="pressure"

	        Text item=Sensor_GuestTemperature           label="Guest Temperature"     icon="temperature"    valuecolor=[>35="red",>25="orange",>5="green",<5="blue"]
            Text item=Sensor_GuestHumidity              label="Guest Humidity"        icon="humidity"       valuecolor=[>70="blue",>30="green",<30="red"]
            Text item=Sensor_GuestPressure              label="Guest Pressure"        icon="pressure"
            Text item=Sensor_BathroomTemperature        label="Bathroom Temperature"  icon="temperature"    valuecolor=[>35="red",>25="orange",>5="green",<5="blue"]
            Text item=Sensor_BathroomHumidity           label="Bathroom Humidity"     icon="humidity"       valuecolor=[>70="blue",>30="green",<30="red"]
            Text item=Sensor_BathroomPressure           label="Bathroom Pressure"     icon="pressure"
            Text item=Sensor_LoungeTemperature          label="Lounge Temperature"    icon="temperature"    valuecolor=[>35="red",>25="orange",>5="green",<5="blue"]
            Text item=Sensor_LoungeHumidity             label="Lounge Humidity"       icon="humidity"       valuecolor=[>70="blue",>30="green",<30="red"]
            Text item=Sensor_LoungePressure             label="Lounge Pressure"       icon="pressure"
            Text item=Sensor_FamilyTemperature          label="Family Temperature"    icon="temperature"    valuecolor=[>35="red",>25="orange",>5="green",<5="blue"]
            Text item=Sensor_FamilyHumidity             label="Family Humidity"       icon="humidity"       valuecolor=[>70="blue",>30="green",<30="red"]
            Text item=Sensor_FamilyPressure             label="Family Pressure"       icon="pressure"
            Text item=Sensor_UtilityTemperature         label="Utility Temperature"   icon="temperature"    valuecolor=[>35="red",>25="orange",>5="green",<5="blue"]
            Text item=Sensor_UtilityHumidity            label="Utility Humidity"      icon="humidity"       valuecolor=[>70="blue",>30="green",<30="red"]
            Text item=Sensor_UtilityPressure            label="Utility Pressure"      icon="pressure"
            Text item=Sensor_KitchenTemperature         label="Kitchen Temperature"   icon="temperature"    valuecolor=[>35="red",>25="orange",>5="green",<5="blue"]
            Text item=Sensor_KitchenHumidity            label="Kitchen Humidity"      icon="humidity"       valuecolor=[>70="blue",>30="green",<30="red"]
            Text item=Sensor_KitchenPressure            label="Kitchen Pressure"      icon="pressure"

Do you have any persistence set up?
Your query look like you need to install mapdb persistence
You can do that in the PaperUI under: Addons - Persistence

Then in the folder conf/persistence edit the file mapdb.persist
(It should have been created automatically by ibstalling the service)
and make it look like this:

// mapdb persistence

Strategies {
	default = everyChange
Items {
	* : strategy = everyChange, restoreOnStartup

ALL your items will be restored to the last known state on start-up
If you don’t want ALL of then, put the ones you want in a group and change this line:

	* : strategy = everyChange, restoreOnStartup


	mygroup* : strategy = everyChange, restoreOnStartup
1 Like

Hi Vincent,

Sorry for the late reply but I have been busy with some other things that took my attention away. I had played with persistence some time ago and revived my attempts following your advice. I also went in to the mapdb settings and selected the default file to be used as “mapdb.persist” but that still does not change anything with my issue.

I would like to highlight again that the actual physical lights and switches always start up in the correct (last know) state. But it is the ICONS that are all alight and indicating they are on from the User Interface…even though the actual UI switches are shown in the OFF state. Please see the screen shot that I took to better demonstrate the issue.

Any other suggestions?!


From the photos you can see that the ICONs are all showing lite up but the switches are all OFF. Except for the Lounge Tble Lamp RH which was on when the system was rebooted. (also the other lamps were on when I restarted but their switches stayed showing OFF rather than ON when the system restarted again. The Kitchen light I manually turned on and off again and thats why the ICON is showing OFF.

Thanx for any further suggestions.

Yup, that’s what you get when the Item is NULL. The visual switch defaults off (there is no middle position) and the default icon is used, which in this iconset looks like the ON icon.

Personally, I’ve set up custom icons bulb-on and bulb-off, and a question mark for default bulb. Problems are then obvious.

So the question is how to make the Start up mode to be off or the last know state? I tried setting up persistence but I don’t think that is the problem. How to write the command settings to set all switches to "off"at system start up.

Regards Chris.

I don’t get this problem, as the technology I happen to use updates my Switch Items with a state that reflects the real device.

Persistence coupled with restore-on-startup is all about “the last known state”, if that is the way you choose to deal with your problem.

I use mapdb for the few Items I need to persist and restore.

rule "initialize"
   system started

Thank you for your assistance. I’m still trying to get the mapdb and persistence to work but so far no good and still starting in NULL switch mode.

I created a new rule: “initialize.rules” and added the above lines

rule "initialize"
   system started

but on system restart the log file shows this:

2018-08-25 21:29:07.776 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'initialize.rules' has errors, therefore ignoring it: [3,4]: no viable alternative at input 'system'

Any ideas…sorry I’m a linux NOOB.

System capital S

Thanx Vincent that was the rules problem and now i can restart the system and all lights receive the “OFF” command so at least the ICONS are reflecting off on a restart.

EDIT: (and SOLUTION to mapdb.persist Issue):
Playing around with the rule for sending an OFF command has helped me to (I think) locate and fix the Persistence issue that I was having, being that I could not get it to work. I had to edit the “runtime.cfg” file and un comment the following line:

# org.eclipse.smarthome.persistence:default=mapdb

and change it to read:


So I had to un-comment it and also add the postfix “.persist” to the end…this now seems to have fixed my switches from starting up in the NULL mode.

Hi again Vincent,

I’m revisiting my persistence settings and specifically the mapdb.persist file that you demonstrated above. I currently have this line in my file:

Please could you advise if I’m allowed to add multiple mygroup lines to this file or only allowed the single group entry as you have example and have to add the group tag to the default.items file and only have the one single *group defined in the mapdb.persist file?

mygroup1*, mygroup2*, mygroup3* : strategy = everyChange, restoreOnStartup


1 Like

thanx Vincent… Sorry I should have “read the manual” before asking!

Thank you :slight_smile:

That’s all right
Same advice I give to all new(ish) users
Read the docs, and when you have finished reading them read them again and one more time.
Almost all you need is in the docs.
The rest is likely to have been answered already in the community.

Please mark the thread as solved

Hi Again Vincent,

I have been playing with his for most of today, I have the below line in my mapdb.persist file:

gLights*, gPersist*, gPower* : strategy = everyChange, restoreOnStartup

In my default.items file I have this:

Switch   Alarm_Fire                          "Fire Alarm Monitoring (On/Off)"       <switch>  (gAlarmFire, gPersist)
Switch   GF_Dining_Light1                    "Dining Room Ceiling"         <light>            (GF_Dining, gLights, gPersist)           [ "Lighting"   ]   { $
Switch   GF_Dining_FloorLight                "Dining Floor Lamp"           <light>            (GF_Dining, gLights, gPersist)           [ "Lighting"   ]   { $

While the gLights and gPower groups are working for persistence on the light switches and power sockets, I cant get the gPersist to work no matter what I try. I changed the mapdb.persist file to this but then the lights and power sockets remain in NULL:

gPersist* : strategy = everyChange, restoreOnStartup

but no persistance works with this which leads me to think maybe there is some other issue with the definition of the GROUP gPersist…

Here is the Log:Tail

18:56:27.544 [INFO ] [home.event.GroupItemStateChangedEvent] - gLights changed from NULL to OFF through FF_CharliesBedroom_Light14
18:57:00.070 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'OHFriendlyUptime' received command 0d 0h 4m
18:57:00.084 [INFO ] [rthome.model.script.Is.Reboot.Due.Now] - Reboot Due Status Flag = false
18:57:00.100 [INFO ] [smarthome.event.ItemStateChangedEvent] - OHFriendlyUptime changed from 0d 0h 3m to 0d 0h 4m
18:57:08.413 [INFO ] [smarthome.event.ItemStateChangedEvent] - FF_GuestRoom_Light8 changed from NULL to OFF
18:57:27.863 [INFO ] [del.core.internal.ModelRepositoryImpl] - Loading model 'mapdb.persist'
18:57:27.904 [INFO ] [home.event.GroupItemStateChangedEvent] - gPower changed from NULL to OFF through FF_Bathroom_TowelHeater
18:57:27.914 [INFO ] [smarthome.event.ItemStateChangedEvent] - FF_Bathroom_TowelHeater changed from NULL to OFF
18:57:27.924 [INFO ] [smarthome.event.ItemStateChangedEvent] - GF_Dining_Light1 changed from NULL to OFF
18:57:27.947 [INFO ] [smarthome.event.ItemStateChangedEvent] - GF_FamilyRoom_Light6 changed from NULL to OFF
18:57:27.959 [INFO ] [smarthome.event.ItemStateChangedEvent] - GF_LaundryRoom_Light4 changed from NULL to OFF
18:57:27.972 [INFO ] [smarthome.event.ItemStateChangedEvent] - GF_Driveway_HeatMat2 changed from NULL to OFF
18:57:27.987 [INFO ] [smarthome.event.ItemStateChangedEvent] - GF_Driveway_HeatMat1 changed from NULL to OFF

If i put the Alarm_Fire switch in to either the gLights or gPower groups then that switch holds persistence but I dont want it in the same group as the power sockets or lights…

Any ideas?

figured it out:

// mapdb persistence

Strategies {
	default = everyChange
Items {
	gLights*, gPersist*, gPower* : strategy = everyChange, restoreOnStartup
	Alarm_Fire: strategy = everyChange, restoreOnStartup

Glad you got it working
Silly question but is the group gPersist defined anywhere?

Hi Vincent,

Probably not…I will research how to define a group

In an *.items file do:

Group gPersist

That’s it

1 Like