--- SmartHome.php	2016-01-30 14:53:30.000000000 +0100
+++ SmartHome.php	2015-12-10 19:23:18.000000000 +0100
@@ -21,6 +21,7 @@
 use Bubelbub\SmartHomePHP\Request\LoginRequest;
 use Bubelbub\SmartHomePHP\Request\ReleaseConfigurationLockRequest;
 use Bubelbub\SmartHomePHP\Request\SetActuatorStatesRequest;
+use Bubelbub\SmartHomePHP\Request\NotificationRequest;
 use Bubelbub\SmartHomePHP\Entity\Location;
 use Bubelbub\SmartHomePHP\Entity\SwitchActuator;
 use Bubelbub\SmartHomePHP\Entity\LogicalDevice;
@@ -458,7 +459,7 @@
 					case LogicalDevice::DEVICE_TYPE_SWITCH_ACTUATOR:
 						if (strcasecmp((String)$state['IsOn'],'true')==0)
 							$device->setState(SwitchActuator::SWITCH_ACTUATOR_STATE_ON);
-						elseif ((String)$state['IsOn'] == 'False')
+						elseif (strcasecmp((String)$state['IsOn'],'false')==0)
 							$device->setState(SwitchActuator::SWITCH_ACTUATOR_STATE_OFF);
 						else
 							throw new \Exception('Unknown SwitchActuator state "' . (String)$state['IsOn'] . '"', 104);
@@ -483,9 +484,9 @@
 						break;
 
 					case LogicalDevice::DEVICE_TYPE_SMOKE_DETECTOR_SENSOR:
-						if (strcasecmp((String)$state->IsSmokeAlarm,'true')==0)
+						if ((String)$state->IsSmokeAlarm == 'true')
 							$device->setState(SmokeDetectorSensor::SMOKE_DETECTOR_STATE_SMOKE_ALARM_ON);
-						elseif (strcasecmp((String)$state->IsSmokeAlarm,'false')==0)
+						elseif ((String)$state->IsSmokeAlarm == 'false')
 							$device->setState(SmokeDetectorSensor::SMOKE_DETECTOR_STATE_SMOKE_ALARM_OFF);
 						else
 							throw new \Exception('Unknown SmokeDetectorSensor state "' . (String)$state->IsSmokeAlarm . '"', 104);
@@ -829,5 +830,18 @@
 	{
 		$this->logicalDevices = $logicalDevices;
 	}
+
+	/**
+	* @return array with:
+	* @return string clientId
+	* @return string sessionId
+	**/
+	public function getNotificationID() {
+		$getNotificationRequest = new NotificationRequest($this);
+		$getNotificationRequest->send();
+
+		return array('clientId' => $this->getClientId(), 'sessionId' => $this->getSessionId());
+	}
+
 }
 ?>
--- Request/NotificationRequest.php	2016-01-30 14:57:54.000000000 +0100
+++ Request/NotificationRequest.php	2015-12-03 20:58:44.000000000 +0100
@@ -0,0 +1,22 @@
+<?php
+// see: https://github.com/Bubelbub/SmartHome-PHP/issues/9
+
+namespace Bubelbub\SmartHomePHP\Request;
+
+class NotificationRequest extends BaseRequest
+{
+    protected $action = 'cmd';
+
+    public function send($expectedResponse = 'AcknowledgeResponse', $useSession = true, $try = 1)
+    {
+//        $this->smartHome->setSessionId(null);
+        $req = $this->getRequest();
+        $req->addChild('Action', 'Subscribe');
+        $req->addChild('NotificationType', 'DeviceStateChanges');
+
+//        $useSession = true;
+
+        $response = parent::send($expectedResponse, $useSession, $try);
+        return $response;
+    }
+}
