-
Notifications
You must be signed in to change notification settings - Fork 2
devolo Smoke Detector
Guido Schmitz edited this page May 26, 2020
·
3 revisions
The following snippets assume, that you already created a working instance of HomeControl and an instance of Mydevolo. Please see the page about connecting to the backend for further information.
First you need to find the device UID of the smoke detector you want to query - in this snippet called "Smoke". Then you need to find the property "binary_sensor". Since the devolo Smoke Detectors only have one sensor, you can directly access the first list object and access the state. There is also an attribute showing the date of the last change of the state. This date is of type datetime.
smoke_detector = homecontrol.devices.get(homecontrol.device_names.get("Smoke"))
binary_sensor = smoke_detector.get_property("binary_sensor")[0]
print(binary_sensor.state)
print(binary_sensor.last_activity)