Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.xiaomi_miio.binary_sensor Namespace Reference

Classes

class  XiaomiGenericBinarySensor
 
class  XiaomiMiioBinarySensorDescription
 

Functions

def _setup_vacuum_sensors (hass, config_entry, async_add_entities)
 
None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
tuple AIRFRESH_A1_BINARY_SENSORS = (ATTR_PTC_STATUS,)
 
string ATTR_MOP_ATTACHED = "is_water_box_carriage_attached"
 
string ATTR_NO_WATER = "no_water"
 
string ATTR_POWERSUPPLY_ATTACHED = "powersupply_attached"
 
string ATTR_PTC_STATUS = "ptc_status"
 
string ATTR_WATER_BOX_ATTACHED = "is_water_box_attached"
 
string ATTR_WATER_SHORTAGE = "is_water_shortage"
 
string ATTR_WATER_TANK_DETACHED = "water_tank_detached"
 
tuple BINARY_SENSOR_TYPES
 
tuple FAN_ZA5_BINARY_SENSORS = (ATTR_POWERSUPPLY_ATTACHED,)
 
tuple HUMIDIFIER_MIIO_BINARY_SENSORS = (ATTR_WATER_TANK_DETACHED,)
 
tuple HUMIDIFIER_MIOT_BINARY_SENSORS = (ATTR_WATER_TANK_DETACHED,)
 
tuple HUMIDIFIER_MJJSQ_BINARY_SENSORS = (ATTR_NO_WATER, ATTR_WATER_TANK_DETACHED)
 
dictionary VACUUM_SENSORS
 
dictionary VACUUM_SENSORS_SEPARATE_MOP
 

Detailed Description

Support for Xiaomi Miio binary sensors.

Function Documentation

◆ _setup_vacuum_sensors()

def homeassistant.components.xiaomi_miio.binary_sensor._setup_vacuum_sensors (   hass,
  config_entry,
  async_add_entities 
)
private
Only vacuums with mop should have binary sensor registered.

Definition at line 136 of file binary_sensor.py.

◆ async_setup_entry()

None homeassistant.components.xiaomi_miio.binary_sensor.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up the Xiaomi sensor from a config entry.

Definition at line 171 of file binary_sensor.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.xiaomi_miio.binary_sensor._LOGGER = logging.getLogger(__name__)
private

Definition at line 37 of file binary_sensor.py.

◆ AIRFRESH_A1_BINARY_SENSORS

tuple homeassistant.components.xiaomi_miio.binary_sensor.AIRFRESH_A1_BINARY_SENSORS = (ATTR_PTC_STATUS,)

Definition at line 85 of file binary_sensor.py.

◆ ATTR_MOP_ATTACHED

string homeassistant.components.xiaomi_miio.binary_sensor.ATTR_MOP_ATTACHED = "is_water_box_carriage_attached"

Definition at line 43 of file binary_sensor.py.

◆ ATTR_NO_WATER

string homeassistant.components.xiaomi_miio.binary_sensor.ATTR_NO_WATER = "no_water"

Definition at line 39 of file binary_sensor.py.

◆ ATTR_POWERSUPPLY_ATTACHED

string homeassistant.components.xiaomi_miio.binary_sensor.ATTR_POWERSUPPLY_ATTACHED = "powersupply_attached"

Definition at line 41 of file binary_sensor.py.

◆ ATTR_PTC_STATUS

string homeassistant.components.xiaomi_miio.binary_sensor.ATTR_PTC_STATUS = "ptc_status"

Definition at line 40 of file binary_sensor.py.

◆ ATTR_WATER_BOX_ATTACHED

string homeassistant.components.xiaomi_miio.binary_sensor.ATTR_WATER_BOX_ATTACHED = "is_water_box_attached"

Definition at line 44 of file binary_sensor.py.

◆ ATTR_WATER_SHORTAGE

string homeassistant.components.xiaomi_miio.binary_sensor.ATTR_WATER_SHORTAGE = "is_water_shortage"

Definition at line 45 of file binary_sensor.py.

◆ ATTR_WATER_TANK_DETACHED

string homeassistant.components.xiaomi_miio.binary_sensor.ATTR_WATER_TANK_DETACHED = "water_tank_detached"

Definition at line 42 of file binary_sensor.py.

◆ BINARY_SENSOR_TYPES

tuple homeassistant.components.xiaomi_miio.binary_sensor.BINARY_SENSOR_TYPES
Initial value:
1 = (
2  XiaomiMiioBinarySensorDescription(
3  key=ATTR_NO_WATER,
4  translation_key=ATTR_NO_WATER,
5  icon="mdi:water-off-outline",
6  entity_category=EntityCategory.DIAGNOSTIC,
7  ),
8  XiaomiMiioBinarySensorDescription(
9  key=ATTR_WATER_TANK_DETACHED,
10  translation_key=ATTR_WATER_TANK_DETACHED,
11  icon="mdi:car-coolant-level",
12  device_class=BinarySensorDeviceClass.CONNECTIVITY,
13  value=lambda value: not value,
14  entity_category=EntityCategory.DIAGNOSTIC,
15  ),
16  XiaomiMiioBinarySensorDescription(
17  key=ATTR_PTC_STATUS,
18  translation_key=ATTR_PTC_STATUS,
19  device_class=BinarySensorDeviceClass.POWER,
20  entity_category=EntityCategory.DIAGNOSTIC,
21  ),
22  XiaomiMiioBinarySensorDescription(
23  key=ATTR_POWERSUPPLY_ATTACHED,
24  translation_key=ATTR_POWERSUPPLY_ATTACHED,
25  device_class=BinarySensorDeviceClass.PLUG,
26  entity_category=EntityCategory.DIAGNOSTIC,
27  ),
28 )

Definition at line 56 of file binary_sensor.py.

◆ FAN_ZA5_BINARY_SENSORS

tuple homeassistant.components.xiaomi_miio.binary_sensor.FAN_ZA5_BINARY_SENSORS = (ATTR_POWERSUPPLY_ATTACHED,)

Definition at line 86 of file binary_sensor.py.

◆ HUMIDIFIER_MIIO_BINARY_SENSORS

tuple homeassistant.components.xiaomi_miio.binary_sensor.HUMIDIFIER_MIIO_BINARY_SENSORS = (ATTR_WATER_TANK_DETACHED,)

Definition at line 131 of file binary_sensor.py.

◆ HUMIDIFIER_MIOT_BINARY_SENSORS

tuple homeassistant.components.xiaomi_miio.binary_sensor.HUMIDIFIER_MIOT_BINARY_SENSORS = (ATTR_WATER_TANK_DETACHED,)

Definition at line 132 of file binary_sensor.py.

◆ HUMIDIFIER_MJJSQ_BINARY_SENSORS

tuple homeassistant.components.xiaomi_miio.binary_sensor.HUMIDIFIER_MJJSQ_BINARY_SENSORS = (ATTR_NO_WATER, ATTR_WATER_TANK_DETACHED)

Definition at line 133 of file binary_sensor.py.

◆ VACUUM_SENSORS

dictionary homeassistant.components.xiaomi_miio.binary_sensor.VACUUM_SENSORS
Initial value:
1 = {
2  ATTR_MOP_ATTACHED: XiaomiMiioBinarySensorDescription(
3  key=ATTR_WATER_BOX_ATTACHED,
4  translation_key=ATTR_WATER_BOX_ATTACHED,
5  icon="mdi:square-rounded",
6  parent_key=VacuumCoordinatorDataAttributes.status,
7  entity_registry_enabled_default=True,
8  device_class=BinarySensorDeviceClass.CONNECTIVITY,
9  entity_category=EntityCategory.DIAGNOSTIC,
10  ),
11  ATTR_WATER_BOX_ATTACHED: XiaomiMiioBinarySensorDescription(
12  key=ATTR_WATER_BOX_ATTACHED,
13  translation_key=ATTR_WATER_BOX_ATTACHED,
14  icon="mdi:water",
15  parent_key=VacuumCoordinatorDataAttributes.status,
16  entity_registry_enabled_default=True,
17  device_class=BinarySensorDeviceClass.CONNECTIVITY,
18  entity_category=EntityCategory.DIAGNOSTIC,
19  ),
20  ATTR_WATER_SHORTAGE: XiaomiMiioBinarySensorDescription(
21  key=ATTR_WATER_SHORTAGE,
22  translation_key=ATTR_WATER_SHORTAGE,
23  icon="mdi:water",
24  parent_key=VacuumCoordinatorDataAttributes.status,
25  entity_registry_enabled_default=True,
26  device_class=BinarySensorDeviceClass.PROBLEM,
27  entity_category=EntityCategory.DIAGNOSTIC,
28  ),
29 }

Definition at line 88 of file binary_sensor.py.

◆ VACUUM_SENSORS_SEPARATE_MOP

dictionary homeassistant.components.xiaomi_miio.binary_sensor.VACUUM_SENSORS_SEPARATE_MOP
Initial value:
1 = {
2  **VACUUM_SENSORS,
3  ATTR_MOP_ATTACHED: XiaomiMiioBinarySensorDescription(
4  key=ATTR_MOP_ATTACHED,
5  translation_key=ATTR_MOP_ATTACHED,
6  icon="mdi:square-rounded",
7  parent_key=VacuumCoordinatorDataAttributes.status,
8  entity_registry_enabled_default=True,
9  device_class=BinarySensorDeviceClass.CONNECTIVITY,
10  entity_category=EntityCategory.DIAGNOSTIC,
11  ),
12 }

Definition at line 118 of file binary_sensor.py.