Help, sensor data is nolonger distributed to items



  • Since last night i broke something 😢 . Now i can see in the logs that my (serial)gateway is receiving sensordata, but it doesn't get distributed to the items anymore. I didn't touch the SerialGW.rules or SerialGW.items files and it was working just fine until yesterday. I do get following error:

    2018-12-27 10:16:08.501 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Arduino sends to Openhab': An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.StringExtensions.operator_plus(java.lang.String,java.lang.String) on instance: null```
    

    this error comes right after the data is put into openhab from my serial gateway:

    2018-12-27 10:16:00.591 [vent.ItemStateChangedEvent] - Arduino changed from 0;255;3;0;9;TSF:SAN:OK
    
     to 0;255;3;0;9;TSF:MSG:READ,27-27-0,s=2,c=1,t=0,pt=7,l=5,sg=0:19.0
    
    27;2;1;0;0;19.0
    
    0;255;3;0;9;TSF:MSG:READ,27-27-0,s=1,c=1,t=1,pt=7,l=5,sg=0:48.3
    
    27;1;1;0;1;48.3
    
    0;255;3;0;9;TSF:MSG:READ,27-27-0,s=4,c=1,t=16,pt=1,l=1,sg=0:1
    
    27;4;1;0;16;1
    
    0;255;3;0;9;TSF:MSG:READ,27-27-0,s=5,c=1,t=16,pt=1,l=1,sg=0:1
    
    27;5;1;0;16;1
    
    2018-12-27 10:16:01.669 [vent.ItemStateChangedEvent] - Arduino changed from 0;255;3;0;9;TSF:MSG:READ,27-27-0,s=2,c=1,t=0,pt=7,l=5,sg=0:19.0
    
    27;2;1;0;0;19.0
    
    0;255;3;0;9;TSF:MSG:READ,27-27-0,s=1,c=1,t=1,pt=7,l=5,sg=0:48.3
    
    27;1;1;0;1;48.3
    
    0;255;3;0;9;TSF:MSG:READ,27-27-0,s=4,c=1,t=16,pt=1,l=1,sg=0:1
    
    27;4;1;0;16;1
    
    0;255;3;0;9;TSF:MSG:READ,27-27-0,s=5,c=1,t=16,pt=1,l=1,sg=0:1
    
    27;5;1;0;16;1
    
     to 0;255;3;0;9;TSF:MSG:READ,75-75-0,s=1,c=1,t=1,pt=7,l=5,sg=0:57.5
    
    75;1;1;0;1;57.5
    
    0;255;3;0;9;TSF:MSG:READ,75-75-0,s=4,c=1,t=16,pt=1,l=1,sg=0:1
    
    75;4;1;0;16;1
    
    0;255;3;0;9;TSF:MSG:READ,75-75-0,s=5,c=1,t=16,pt=1,l=1,sg=0:1
    
    75;5;1;0;16;1
    

    I know MY_DEBUG is still on on my serial gateway, but as i said everything worked until yesterday, even with debug on. Does anyone know why openhab is throwing this error? Or why my data is no longer being distributed to the items?

    This is my rules file for the serial GW:

    import java.util.HashMap
    
    var String ArduinoUpdate = ""
    var String sketchName = ""
    
    var int V_TEMP = 0
    var int V_HUM = 1
    var int V_LIGHT = 2
    var int V_DIMMER = 3
    var int V_PRESSURE = 4
    var int V_FORECAST = 5
    var int V_RAIN = 6
    var int V_RAINRATE = 7
    var int V_WIND = 8
    var int V_GUST = 9
    var int V_DIRECTION = 10
    var int V_UV = 11
    var int V_WEIGHT = 12
    var int V_DISTANCE = 13
    var int V_IMPEDANCE = 14
    var int V_ARMED = 15
    var int V_TRIPPED = 16
    var int V_WATT = 17
    var int V_KWH = 18
    var int V_SCENE_ON = 19
    var int V_SCENE_OFF = 20
    var int V_HEATER = 21
    var int V_HEATER_SW = 22
    var int V_LIGHT_LEVEL = 23
    var int V_VAR1 = 24
    var int V_VAR2 = 25
    var int V_VAR3 = 26
    var int V_VAR4 = 27
    var int V_VAR5 = 28
    var int V_UP = 29
    var int V_DOWN = 30
    var int V_STOP = 31
    var int V_IR_SEND = 32
    var int V_IR_RECEIVE = 33
    var int V_FLOW = 34
    var int V_VOLUME = 35
    var int V_LOCK_STATUS = 36
    var int V_DUST_LEVEL = 37
    var int V_VOLTAGE = 38
    var int V_CURRENT = 39
    var int msgPresentation = 0
    var int msgSet = 1
    var int msgReq = 2
    var int msgInternal = 3
    var int msgStream = 4
    var int alarmArmor = 1
    
    // Internal Commands
    
    var int I_BATTERY_LEVEL = 0
    var int I_TIME = 1
    var int I_VERSION = 2
    var int I_ID_REQUEST = 3
    var int I_ID_RESPONSE = 4
    var int I_INCLUSION_MODE = 5
    var int I_CONFIG = 6
    var int I_FIND_PARENT = 7
    var int I_FIND_PARENT_RESPONSE = 8
    var int I_LOG_MESSAGE = 9
    var int I_CHILDREN = 10
    var int I_SKETCH_NAME = 11
    var int I_SKETCH_VERSION = 12
    var int I_REBOOT = 13
    var int I_GATEWAY_READY = 14
    
    // Mappings
    var HashMap<String, String> sensorToItemsMap = newLinkedHashMap(
    
    	//**************//
    	//	NODE ID's	//
    	//**************//
    	
    	
        // 0 		= 	Gateway
        // 1-6 	    = 	Basement
        // 7-10 	= 	Stairwell
        // 11-26 	= 	LivingRoom
        // 27-42 	= 	DiningRoom
        // 43-58 	= 	BathRoom
        // 59-74 	= 	Kitchen
        // 75-90 	= 	Master Bedroom
        // 91-106 	= 	Bedroom
        // 107-122 	= 	Kid's Room
        // 123-138 	=	Hallway
        // 139-142 	= 	Toilet
        // 143-152 	= 	Attic
        // 153-168 	= 	Backyard
        // 169-184 	= 	Front yard
        // 185-200 	= 	Driveway
        // 201-216 	= 	Garage
        // 217-232 	= 	Shed
        // 233-248 	= 	Terrace
        // 249-254  =   Spare
        
        
      
       
        
        //***Basement***
        //*****Sensor1*****
        "1;0;"                        	->      "BA_Basement_BatteryLevel1",
        "BA_Basement_BatteryLevel1"   	->      "1;0;",
        "1;1;"                        	->      "BA_Basement_Humidity1",
        "BA_Basement_Humidity1"     	->      "1;1;",
        "1;2;"                        	->      "BA_Basement_Temperature1",
        "BA_Basement_Temperature1"    	->      "1;2;",
        "1;3;"                        	->      "BA_Basement_LightLevel1",
        "BA_Basement_LightLevel1"     	->      "1;3;",
        "1;4;"                        	->      "BA_Basement_Window1",
        "BA_Basement_Window1"     		->      "1;4;",
        "1;5;"                        	->      "BA_Basement_Window2",
        "BA_Basement_Window2"     		->      "1;5;",
        //"1;6;"                        ->      "digital",
        //"digital"        				->      "1;6;",
        //"1;7;"                        ->      "digital",
        //"digital"     				->      "1;7;",
        //"1;8;"                        ->      "digital",
        //"digital"     				->      "1;8;",
        //"1;9;"                        ->      "digital",
        //"digital"     				->      "1;9;",
        
        //***Stairwell***
        //*****Sensor1*****
        "7;0;"                        	->      "BA_Stairwell_BatteryLevel1",
        "BA_Stairwell_BatteryLevel1"   	->      "7;0;",
        "7;1;"                        	->      "BA_Stairwell_Humidity1",
        "BA_Stairwell_Humidity1"     	->      "7;1;",
        "7;2;"                        	->      "BA_Stairwell_Temperature1",
        "BA_Stairwell_Temperature1"    	->      "7;2;",
        "7;3;"                        	->      "BA_Stairwell_LightLevel1",
        "BA_Stairwell_LightLevel1"     	->      "7;3;",
        "7;4;"                        	->      "BA_Stairwell_Window1",
        "BA_Stairwell_Window1"     		->      "7;4;",
        "7;5;"                        	->      "BA_Stairwell_Window2",
        "BA_Stairwell_Window2"     		->      "7;5;",
        //"7;6;"                        ->      "digital",
        //"digital"        				->      "7;6;",
        //"7;7;"                        ->      "digital",
        //"digital"     				->      "7;7;",
        //"7;8;"                        ->      "digital",
        //"digital"     				->      "7;8;",
        //"7;9;"                        ->      "digital",
        //"digital"     				->      "7;9;",
        
        //***LivingRoom***
        //*****Sensor1*****
        "11;0;"                        	->      "GF_LivingRoom_BatteryLevel1",
        "GF_LivingRoom_BatteryLevel1"   ->      "11;0;",
        "11;1;"                        	->      "GF_LivingRoom_Humidity1",
        "GF_LivingRoom_Humidity1"     	->      "11;1;",
        "11;2;"                        	->      "GF_LivingRoom_Temperature1",
        "GF_LivingRoom_Temperature1"    ->      "11;2;",
        "11;3;"                        	->      "GF_LivingRoom_LightLevel1",
        "GF_LivingRoom_LightLevel1"     ->      "11;3;",
        "11;4;"                        	->      "GF_LivingRoom_Window1",
        "GF_LivingRoom_Window1"     	->      "11;4;",
        "11;5;"                        	->      "GF_LivingRoom_Window2",
        "GF_LivingRoom_Window2"     	->      "11;5;",
        //"11;6;"                       ->      "digital",
        //"digital"        				->      "11;6;",
        //"11;7;"                       ->      "digital",
        //"digital"     				->      "11;7;",
        //"11;8;"                       ->      "digital",
        //"digital"     				->      "11;8;",
        //"11;9;"                       ->      "digital",
        //"digital"     				->      "11;9;",
        
        //*****Sensor2*****
        "12;0;"                        	->      "GF_LivingRoom_BatteryLevel2",
        "GF_LivingRoom_BatteryLevel2"   ->      "12;0;",
        "12;1;"                        	->      "GF_LivingRoom_Humidity2",
        "GF_LivingRoom_Humidity2"     	->      "12;1;",
        "12;2;"                        	->      "GF_LivingRoom_Temperature2",
        "GF_LivingRoom_Temperature2"    ->      "12;2;",
        "12;3;"                        	->      "GF_LivingRoom_LightLevel2",
        "GF_LivingRoom_LightLevel2"     ->      "12;3;",
        "12;4;"                        	->      "GF_LivingRoom_Window3",
        "GF_LivingRoom_Window3"     	->      "12;4;",
        "12;5;"                        	->      "GF_LivingRoom_Window4",
        "GF_LivingRoom_Window4"     	->      "12;5;",
        //"12;6;"                       ->      "digital",
        //"digital"        				->      "12;6;",
        //"12;7;"                       ->      "digital",
        //"digital"     				->      "12;7;",
        //"12;8;"                       ->      "digital",
        //"digital"     				->      "12;8;",
        //"12;9;"                       ->      "digital",
        //"digital"     				->      "12;9;",
        
        //***DiningRoom***
        //*****Sensor1*****
        "27;0;"                        	->      "GF_Dining_BatteryLevel1",
        "GF_Dining_BatteryLevel1"     	->      "27;0;",
        "27;1;"                        	->      "GF_Dining_Humidity1",
        "GF_Dining_Humidity1"     		->      "27;1;",
        "27;2;"                        	->      "GF_Dining_Temperature1",
        "GF_Dining_Temperature1"     	->      "27;2;",
        "27;3;"                        	->      "GF_Dining_LightLevel1",
        "GF_Dining_LightLevel1"       	->      "27;3;",
        "27;4;"                        	->      "GF_Dining_Window1",
        "GF_Dining_Window1"     		->      "27;4;",
        "27;5;"                        	->      "GF_Dining_Window2",
        "GF_Dining_Window2"     		->      "27;5;",
        //"27;6;"                       ->      "digital",
        //"digital"        				->      "27;6;",
        //"27;7;"                       ->      "digital",
        //"digital"     				->      "27;7;",
        //"27;8;"                       ->      "digital",
        //"digital"     				->      "27;8;",
        //"27;9;"                       ->      "digital",
        //"digital"     				->      "27;9;",
        
        //***BathRoom***
        //*****Sensor1*****
        "43;0;"                        	->      "GF_Bathroom_BatteryLevel1",
        "GF_Bathroom_BatteryLevel1"     ->      "43;0;",
        "43;1;"                        	->      "GF_Bathroom_Humidity1",
        "GF_Bathroom_Humidity1"     	->      "43;1;",
        "43;2;"                        	->      "GF_Bathroom_Temperature1",
        "GF_Bathroom_Temperature1"     	->      "43;2;",
        "43;3;"                        	->      "GF_Bathroom_LightLevel1",
        "GF_Bathroom_LightLevel1"       ->      "43;3;",
        "43;4;"                        	->      "GF_Bathroom_Window1",
        "GF_Bathroom_Window1"     		->      "43;4;",
        "43;5;"                        	->      "GF_Bathroom_Window2",
        "GF_Bathroom_Window2"     		->      "43;5;",
        //"43;6;"                       ->      "digital",
        //"digital"        				->      "43;6;",
        //"43;7;"                       ->      "digital",
        //"digital"     				->      "43;7;",
        //"43;8;"                       ->      "digital",
        //"digital"     				->      "43;8;",
        //"43;9;"                       ->      "digital",
        //"digital"     				->      "43;9;",
        
        //***Kitchen***
        //*****Sensor1*****
        "59;0;"                        ->      "GF_Kitchen_BatteryLevel1",
        "GF_Kitchen_BatteryLevel1"     	->      "59;0;",
        "59;1;"                        ->      "GF_Kitchen_Humidity1",
        "GF_Kitchen_Humidity1"     		->      "59;1;",
        "59;2;"                        ->      "GF_Kitchen_Temperature1",
        "GF_Kitchen_Temperature1"     	->      "59;2;",
        "59;3;"                        ->      "GF_Kitchen_LightLevel1",
        "GF_Kitchen_LightLevel1"       	->      "59;3;",
        "59;4;"                        ->      "GF_Kitchen_Window1",
        "GF_Kitchen_Window1"     		->      "59;4;",
        "59;5;"                        ->      "GF_Kitchen_Window2",
        "GF_Kitchen_Window2"     		->      "59;5;",
        //"59;6;"                      ->      "digital",
        //"digital"        				->      "59;6;",
        //"59;7;"                      ->      "digital",
        //"digital"     				->      "59;7;",
        //"59;8;"                      ->      "digital",
        //"digital"     				->      "59;8;",
        //"59;9;"                      ->      "digital",
        //"digital"     				->      "59;9;",
        
        //***Master bedroom***
        //*****Sensor1*****
        "75;0;"                        ->      "GF_MasterBedroom_BatteryLevel1",
        "GF_MasterBedroom_BatteryLevel1"->      "75;0;",
        "75;1;"                        ->      "GF_MasterBedroom_Humidity1",
        "GF_MasterBedroom_Humidity1"    ->      "75;1;",
        "75;2;"                        ->      "GF_MasterBedroom_Temperature1",
        "GF_MasterBedroom_Temperature1" ->      "75;2;",
        "75;3;"                        ->      "GF_MasterBedroom_LightLevel1",
        "GF_MasterBedroom_LightLevel1"  ->      "75;3;",
        "75;4;"                        ->      "GF_MasterBedroom_Window1",
        "GF_MasterBedroom_Window1"     	->      "75;4;",
        "75;5;"                        ->      "GF_MasterBedroom_Window2",
        "GF_MasterBedroom_Window2"     	->      "75;5;",
        //"75;6;"                      ->      "digital",
        //"digital"        				->      "75;6;",
        //"75;7;"                      ->      "digital",
        //"digital"     				->      "75;7;",
        //"75;8;"                      ->      "digital",
        //"digital"     				->      "75;8;",
        //"75;9;"                      ->      "digital",
        //"digital"     				->      "75;9;",
        
        //***Bedroom***
        //*****Sensor1*****
        "91;0;"                        ->      "GF_Bedroom_BatteryLevel1",
        "GF_Bedroom_BatteryLevel1"     	->      "91;0;",
        "91;1;"                        ->      "GF_Bedroom_Humidity1",
        "GF_Bedroom_Humidity1"     		->      "91;1;",
        "91;2;"                        ->      "GF_Bedroom_Temperature1",
        "GF_Bedroom_Temperature1"     	->      "91;2;",
        "91;3;"                        ->      "GF_Bedroom_LightLevel1",
        "GF_Bedroom_LightLevel1"       	->      "91;3;",
        "91;4;"                        ->      "GF_Bedroom_Window1",
        "GF_Bedroom_Window1"     		->      "91;4;",
        "91;5;"                        ->      "GF_Bedroom_Window2",
        "GF_Bedroom_Window2"     		->      "91;5;",
        //"91;6;"                      ->      "digital",
        //"digital"        				->      "91;6;",
        //"91;7;"                      ->      "digital",
        //"digital"     				->      "91;7;",
        //"91;8;"                      ->      "digital",
        //"digital"     				->      "91;8;",
        //"91;9;"                      ->      "digital",
        //"digital"     				->      "91;9;",
        
        //***Kid's room***
        //*****Sensor1*****
        "107;0;"                        ->      "GF_KidsRoom_BatteryLevel1",
        "GF_KidsRoom_BatteryLevel1"     ->      "107;0;",
        "107;1;"                        ->      "GF_KidsRoom_Humidity1",
        "GF_KidsRoom_Humidity1"     	->      "107;1;",
        "107;2;"                        ->      "GF_KidsRoom_Temperature1",
        "GF_KidsRoom_Temperature1"     	->      "107;2;",
        "107;3;"                        ->      "GF_KidsRoom_LightLevel1",
        "GF_KidsRoom_LightLevel1"       ->      "107;3;",
        "107;4;"                        ->      "GF_KidsRoom_Window1",
        "GF_KidsRoom_Window1"     		->      "107;4;",
        "107;5;"                        ->      "GF_KidsRoom_Window2",
        "GF_KidsRoom_Window2"     		->      "107;5;",
        //"107;6;"                      ->      "digital",
        //"digital"        				->      "107;6;",
        //"107;7;"                      ->      "digital",
        //"digital"     				->      "107;7;",
        //"107;8;"                      ->      "digital",
        //"digital"     				->      "107;8;",
        //"107;9;"                      ->      "digital",
        //"digital"     				->      "107;9;",
        
        //***Hallway***
        //*****Sensor1*****
        "123;0;"                        ->      "GF_Hallway_BatteryLevel1",
        "GF_Hallway_BatteryLevel1"     	->      "123;0;",
        "123;1;"                        ->      "GF_Hallway_Humidity1",
        "GF_Hallway_Humidity1"     		->      "123;1;",
        "123;2;"                        ->      "GF_Hallway_Temperature1",
        "GF_Hallway_Temperature1"     	->      "123;2;",
        "123;3;"                        ->      "GF_Hallway_LightLevel1",
        "GF_Hallway_LightLevel1"       	->      "123;3;",
        "123;4;"                        ->      "GF_Hallway_Window1",
        "GF_Hallway_Window1"     		->      "123;4;",
        "123;5;"                        ->      "GF_Hallway_Window2",
        "GF_Hallway_Window2"     		->      "123;5;",
        //"123;6;"                      ->      "digital",
        //"digital"        				->      "123;6;",
        //"123;7;"                      ->      "digital",
        //"digital"     				->      "123;7;",
        //"123;8;"                      ->      "digital",
        //"digital"     				->      "123;8;",
        //"123;9;"                      ->      "digital",
        //"digital"     				->      "123;9;",
        
        //***Toilet***
        //*****Sensor1*****
        "139;0;"                        ->      "GF_Toilet_BatteryLevel1",
        "GF_Toilet_BatteryLevel1"     	->      "139;0;",
        "139;1;"                        ->      "GF_Toilet_Humidity1",
        "GF_Toilet_Humidity1"     		->      "139;1;",
        "139;2;"                        ->      "GF_Toilet_Temperature1",
        "GF_Toilet_Temperature1"     	->      "139;2;",
        "139;3;"                        ->      "GF_Toilet_LightLevel1",
        "GF_Toilet_LightLevel1"       	->      "139;3;",
        "139;4;"                        ->      "GF_Toilet_Window1",
        "GF_Toilet_Window1"     		->      "139;4;",
        "139;5;"                        ->      "GF_Toilet_Window2",
        "GF_Toilet_Window2"     		->      "139;5;",
        //"139;6;"                      ->      "digital",
        //"digital"        				->      "139;6;",
        //"139;7;"                      ->      "digital",
        //"digital"     				->      "139;7;",
        //"139;8;"                      ->      "digital",
        //"digital"     				->      "139;8;",
        //"139;9;"                      ->      "digital",
        //"digital"     				->      "139;9;",
        
        //***Attic***
        //*****Sensor1*****
        "143;0;"                        ->      "FF_Attic_BatteryLevel1",
        "FF_Attic_BatteryLevel1"     	->      "143;0;",
        "143;1;"                        ->      "FF_Attic_Humidity1",
        "FF_Attic_Humidity1"     		->      "143;1;",
        "143;2;"                        ->      "FF_Attic_Temperature1",
        "FF_Attic_Temperature1"     	->      "143;2;",
        "143;3;"                        ->      "FF_Attic_LightLevel1",
        "FF_Attic_LightLevel1"       	->      "143;3;",
        "143;4;"                        ->      "FF_Attic_Window1",
        "FF_Attic_Window1"     			->      "143;4;",
        "143;5;"                        ->      "FF_Attic_Window2",
        "FF_Attic_Window2"     			->      "143;5;",
        //"143;6;"                      ->      "digital",
        //"digital"        				->      "143;6;",
        //"143;7;"                      ->      "digital",
        //"digital"     				->      "143;7;",
        //"143;8;"                      ->      "digital",
        //"digital"     				->      "143;8;",
        //"143;9;"                      ->      "digital",
        //"digital"     				->      "143;9;",
        
        //***Backyard***
        //*****Sensor1*****
        "153;0;"                        ->      "OS_Backyard_BatteryLevel1",
        "OS_Backyard_BatteryLevel1"     ->      "153;0;",
        "153;1;"                        ->      "OS_Backyard_Humidity1",
        "OS_Backyard_Humidity1"     	->      "153;1;",
        "153;2;"                        ->      "OS_Backyard_Temperature1",
        "OS_Backyard_Temperature1"     	->      "153;2;",
        "153;3;"                        ->      "OS_Backyard_LightLevel1",
        "OS_Backyard_LightLevel1"       ->      "153;3;",
        "153;4;"                        ->      "OS_Backyard_Window1",
        "OS_Backyard_Window1"     		->      "153;4;",
        "153;5;"                        ->      "OS_Backyard_Window2",
        "OS_Backyard_Window2"     		->      "153;5;",
        //"153;6;"                      ->      "digital",
        //"digital"        				->      "153;6;",
        //"153;7;"                      ->      "digital",
        //"digital"     				->      "153;7;",
        //"153;8;"                      ->      "digital",
        //"digital"     				->      "153;8;",
        //"153;9;"                      ->      "digital",
        //"digital"     				->      "153;9;",
        
        //***Front yard***
        //*****Sensor1*****
        "169;0;"                        ->      "OS_FrontYard_BatteryLevel1",
        "OS_FrontYard_BatteryLevel1"    ->      "169;0;",
        "169;1;"                        ->      "OS_FrontYard_Humidity1",
        "OS_FrontYard_Humidity1"     	->      "169;1;",
        "169;2;"                        ->      "OS_FrontYard_Temperature1",
        "OS_FrontYard_Temperature1"     ->      "169;2;",
        "169;3;"                        ->      "OS_FrontYard_LightLevel1",
        "OS_FrontYard_LightLevel1"      ->      "169;3;",
        "169;4;"                        ->      "OS_FrontYard_Window1",
        "OS_FrontYard_Window1"     		->      "169;4;",
        "169;5;"                        ->      "OS_FrontYard_Window2",
        "OS_FrontYard_Window2"     		->      "169;5;",
        //"169;6;"                      ->      "digital",
        //"digital"        				->      "169;6;",
        //"169;7;"                      ->      "digital",
        //"digital"     				->      "169;7;",
        //"169;8;"                      ->      "digital",
        //"digital"     				->      "169;8;",
        //"169;9;"                      ->      "digital",
        //"digital"     				->      "169;9;",
        
        //***Driveway***
        //*****Sensor1*****
        "185;0;"                        ->      "OS_Driveway_BatteryLevel1",
        "OS_Driveway_BatteryLevel1"     ->      "185;0;",
        "185;1;"                        ->      "OS_Driveway_Humidity1",
        "OS_Driveway_Humidity1"     	->      "185;1;",
        "185;2;"                        ->      "OS_Driveway_Temperature1",
        "OS_Driveway_Temperature1"     	->      "185;2;",
        "185;3;"                        ->      "OS_Driveway_LightLevel1",
        "OS_Driveway_LightLevel1"       ->      "185;3;",
        "185;4;"                        ->      "OS_Driveway_Window1",
        "OS_Driveway_Window1"     		->      "185;4;",
        "185;5;"                        ->      "OS_Driveway_Window2",
        "OS_Driveway_Window2"     		->      "185;5;",
        //"185;6;"                      ->      "digital",
        //"digital"        				->      "185;6;",
        //"185;7;"                      ->      "digital",
        //"digital"     				->      "185;7;",
        //"185;8;"                      ->      "digital",
        //"digital"     				->      "185;8;",
        //"185;9;"                      ->      "digital",
        //"digital"     				->      "185;9;",
        "190;1;"                        ->      "OS_Driveway_Motion1",
        "OS_Driveway_Motion1"     ->      "190;1;",
        "190;2;"                        ->      "OS_Driveway_Motion2",
        "OS_Driveway_Motion2"     	->      "190;2;",
        
        //***Garage***
        //*****Sensor1*****
        "201;0;"                        ->      "OS_Garage_BatteryLevel1",
        "OS_Garage_BatteryLevel1"     	->      "201;0;",
        "201;1;"                        ->      "OS_Garage_Humidity1",
        "OS_Garage_Humidity1"     		->      "201;1;",
        "201;2;"                        ->      "OS_Garage_Temperature1",
        "OS_Garage_Temperature1"     	->      "201;2;",
        "201;3;"                        ->      "OS_Garage_LightLevel1",
        "OS_Garage_LightLevel1"       	->      "201;3;",
        "201;4;"                        ->      "OS_Garage_Window1",
        "OS_Garage_Window1"     		->      "201;4;",
        "201;5;"                        ->      "OS_Garage_Window2",
        "OS_Garage_Window2"     		->      "201;5;",
        //"201;6;"                      ->      "digital",
        //"digital"        				->      "201;6;",
        //"201;7;"                      ->      "digital",
        //"digital"     				->      "201;7;",
        //"201;8;"                      ->      "digital",
        //"digital"     				->      "201;8;",
        //"201;9;"                      ->      "digital",
        //"digital"     				->      "201;9;",
        
        //***Shed***
        //*****Sensor1*****
        "217;0;"                        ->      "OS_Shed_BatteryLevel1",
        "OS_Shed_BatteryLevel1"     	->      "217;0;",
        "217;1;"                        ->      "OS_Shed_Humidity1",
        "OS_Shed_Humidity1"     		->      "217;1;",
        "217;2;"                        ->      "OS_Shed_Temperature1",
        "OS_Shed_Temperature1"     		->      "217;2;",
        "217;3;"                        ->      "OS_Shed_LightLevel1",
        "OS_Shed_LightLevel1"       	->      "217;3;",
        "217;4;"                        ->      "OS_Shed_Window1",
        "OS_Shed_Window1"     			->      "217;4;",
        "217;5;"                        ->      "OS_Shed_Window2",
        "OS_Shed_Window2"     			->      "217;5;",
        //"217;6;"                      ->      "digital",
        //"digital"        				->      "217;6;",
        //"217;7;"                      ->      "digital",
        //"digital"     				->      "217;7;",
        //"217;8;"                      ->      "digital",
        //"digital"     				->      "217;8;",
        //"217;9;"                      ->      "digital",
        //"digital"     				->      "217;9;",
        
        //***Terrace****
        //*****Sensor1*****
        "233;0;"                        ->      "OS_Terrace_BatteryLevel1",
        "OS_Terrace_BatteryLevel1"     	->      "233;0;",
        "233;1;"                        ->      "OS_Terrace_Humidity1",
        "OS_Terrace_Humidity1"     		->      "233;1;",
        "233;2;"                        ->      "OS_Terrace_Temperature1",
        "OS_Terrace_Temperature1"     	->      "233;2;",
        "233;3;"                        ->      "OS_Terrace_LightLevel1",
        "OS_Terrace_LightLevel1"       	->      "233;3;",
        "233;4;"                        ->      "OS_Terrace_Window1",
        "OS_Terrace_Window1"     		->      "233;4;",
        "233;5;"                        ->      "OS_Terrace_Window2",
        "OS_Terrace_Window2"     		->      "233;5;"
        //"233;6;"                      ->      "digital",
        //"digital"        				->      "233;6;",
        //"233;7;"                      ->      "digital",
        //"digital"     				->      "233;7;",
        //"233;8;"                      ->      "digital",
        //"digital"     				->      "233;8;",
        //"233;9;"                      ->      "digital",
        //"digital"     				->      "233;9;",
        
    )
        
    
    //receiving msg from mysensors gateway
    rule "Arduino sends to Openhab"
        when
            Item Arduino received update
        then
            var String lineBuffer =  Arduino.state.toString.split("\n")
            logInfo("SerialGW","Linebuff="+lineBuffer)
            logInfo("SerialGW","??????")
            for (String line : lineBuffer) {
                var String[] message = line.split(";")
                var Integer nodeId = new Integer(message.get(0))
                var Integer childId = new Integer(message.get(1))
                var Integer msgType = new Integer(message.get(2))
                var Integer ack = new Integer(message.get(3))
                var Integer subType = new Integer(message.get(4))
                var String msg = message.get(5)
                if(msgType == 1 ){
                    if (subType == V_TEMP){
                        postUpdate(sensorToItemsMap.get( nodeId + ";" + childId + ";"), msg)
                        println ("Temp item: " + sensorToItemsMap.get( nodeId + ";" + childId + ";") + " temp: " + msg )
                        }
                    if (subType == V_HUM){
                        postUpdate(sensorToItemsMap.get( nodeId + ";" + childId + ";"), msg)
                        println ("Hum item: " + sensorToItemsMap.get( nodeId + ";" + childId + ";") + " hum: " + msg )
                        }
        		    if (subType == V_LIGHT_LEVEL){
                        postUpdate(sensorToItemsMap.get( nodeId + ";" + childId + ";"), msg)
                        println ("Light item: " + sensorToItemsMap.get( nodeId + ";" + childId + ";") + " light: " + msg )
                        }
    		        if (subType == V_VOLTAGE){
                        postUpdate(sensorToItemsMap.get( nodeId + ";" + childId + ";"), msg)
                        println ("Voltage item: " + sensorToItemsMap.get( nodeId + ";" + childId + ";") + " voltage: " + msg )
                        }
    		        if (subType == V_LOCK_STATUS){
                        var String lockstatus="OPEN"
                        if (msg=="1"){
                            lockstatus="CLOSED"
                        }
                        postUpdate(sensorToItemsMap.get( nodeId + ";" + childId + ";"), lockstatus)
                        println ("Door/Window item: " + sensorToItemsMap.get( nodeId + ";" + childId + ";") + " Status: " + lockstatus )
                        }
    		        if (subType == V_TRIPPED){
                        var String tripped="CLOSED"
                        if (msg=="1"){
                            tripped="OPEN"
                        }
                        postUpdate(sensorToItemsMap.get( nodeId + ";" + childId + ";"), tripped)
                        println ("Button/Contact item: " + sensorToItemsMap.get( nodeId + ";" + childId + ";") + " Status: " + tripped )
                        }
    		        if (subType == V_LIGHT){
                        var String light="OFF"
                        if (msg=="1"){
                            light="ON"
                        }
                        postUpdate(sensorToItemsMap.get( nodeId + ";" + childId + ";"), light)
                        println ("Light item: " + sensorToItemsMap.get( nodeId + ";" + childId + ";") + " Light: " + light )
                        }
                    }
    
                // Internal Command
                if(msgType == 3){
                    if(subType == I_SKETCH_NAME){
                            println("Sketch name: " + msg )
                            sketchName=msg
                        }
                    if(subType == I_SKETCH_VERSION){
                            println("Sketch version: " + msg )
                            postUpdate(sensorToItemsMap.get( nodeId + ";" + childId + ";"), sketchName+" " +msg )
                            sketchName=""
                        }
                    }
                }   
            
    
    end
    

    Really could use some help cause this is really fudging up my home automation 😞

    PS: as you can see from the enormous rule file i am still using the serial binding in openhab, not the mysensors binding.



  • Are your gateway connected to the same ttyUSBx. After reboot for example it can be changed.



  • Its really strange but after saving the serialGW.rules file again (without change) everything started working again. But that was a good remark. Happened to me numerous times.


Log in to reply
 

Suggested Topics

  • 22
  • 4
  • 7
  • 3
  • 5
  • 1

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts