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

Functions

CALLBACK_TYPE async_attach_trigger (HomeAssistant hass, ConfigType config, TriggerActionType action, TriggerInfo trigger_info)
 
dict[str, vol.Schema] async_get_trigger_capabilities (HomeAssistant hass, ConfigType config)
 
list[dict[str, str]] async_get_triggers (HomeAssistant hass, str device_id)
 

Variables

string CONF_BAT_LOW = "bat_low"
 
string CONF_CHARGING = "charging"
 
string CONF_CO = "co"
 
string CONF_COLD = "cold"
 
string CONF_CONNECTED = "connected"
 
string CONF_GAS = "gas"
 
string CONF_HOT = "hot"
 
string CONF_LIGHT = "light"
 
string CONF_LOCKED = "locked"
 
string CONF_MOIST = "moist"
 
string CONF_MOTION = "motion"
 
string CONF_MOVING = "moving"
 
string CONF_NO_CO = "no_co"
 
string CONF_NO_GAS = "no_gas"
 
string CONF_NO_LIGHT = "no_light"
 
string CONF_NO_MOTION = "no_motion"
 
string CONF_NO_PROBLEM = "no_problem"
 
string CONF_NO_SMOKE = "no_smoke"
 
string CONF_NO_SOUND = "no_sound"
 
string CONF_NO_UPDATE = "no_update"
 
string CONF_NO_VIBRATION = "no_vibration"
 
string CONF_NOT_BAT_LOW = "not_bat_low"
 
string CONF_NOT_CHARGING = "not_charging"
 
string CONF_NOT_COLD = "not_cold"
 
string CONF_NOT_CONNECTED = "not_connected"
 
string CONF_NOT_HOT = "not_hot"
 
string CONF_NOT_LOCKED = "not_locked"
 
string CONF_NOT_MOIST = "not_moist"
 
string CONF_NOT_MOVING = "not_moving"
 
string CONF_NOT_OCCUPIED = "not_occupied"
 
string CONF_NOT_OPENED = "not_opened"
 
string CONF_NOT_PLUGGED_IN = "not_plugged_in"
 
string CONF_NOT_POWERED = "not_powered"
 
string CONF_NOT_PRESENT = "not_present"
 
string CONF_NOT_RUNNING = "not_running"
 
string CONF_NOT_TAMPERED = "not_tampered"
 
string CONF_NOT_UNSAFE = "not_unsafe"
 
string CONF_OCCUPIED = "occupied"
 
string CONF_OPENED = "opened"
 
string CONF_PLUGGED_IN = "plugged_in"
 
string CONF_POWERED = "powered"
 
string CONF_PRESENT = "present"
 
string CONF_PROBLEM = "problem"
 
string CONF_RUNNING = "running"
 
string CONF_SMOKE = "smoke"
 
string CONF_SOUND = "sound"
 
string CONF_TAMPERED = "tampered"
 
string CONF_UNSAFE = "unsafe"
 
string CONF_UPDATE = "update"
 
string CONF_VIBRATION = "vibration"
 
string DEVICE_CLASS_NONE = "none"
 
dictionary ENTITY_TRIGGERS
 
 TRIGGER_SCHEMA
 
list TURNED_OFF = [trigger[1][CONF_TYPE] for trigger in ENTITY_TRIGGERS.values()]
 
list TURNED_ON = [trigger[0][CONF_TYPE] for trigger in ENTITY_TRIGGERS.values()]
 

Detailed Description

Provides device triggers for binary sensors.

Function Documentation

◆ async_attach_trigger()

CALLBACK_TYPE homeassistant.components.binary_sensor.device_trigger.async_attach_trigger ( HomeAssistant  hass,
ConfigType  config,
TriggerActionType  action,
TriggerInfo  trigger_info 
)
Listen for state changes based on configuration.

Definition at line 206 of file device_trigger.py.

◆ async_get_trigger_capabilities()

dict[str, vol.Schema] homeassistant.components.binary_sensor.device_trigger.async_get_trigger_capabilities ( HomeAssistant  hass,
ConfigType   config 
)
List trigger capabilities.

Definition at line 267 of file device_trigger.py.

◆ async_get_triggers()

list[dict[str, str]] homeassistant.components.binary_sensor.device_trigger.async_get_triggers ( HomeAssistant  hass,
str   device_id 
)
List device triggers.

Definition at line 233 of file device_trigger.py.

Variable Documentation

◆ CONF_BAT_LOW

string homeassistant.components.binary_sensor.device_trigger.CONF_BAT_LOW = "bat_low"

Definition at line 22 of file device_trigger.py.

◆ CONF_CHARGING

string homeassistant.components.binary_sensor.device_trigger.CONF_CHARGING = "charging"

Definition at line 24 of file device_trigger.py.

◆ CONF_CO

string homeassistant.components.binary_sensor.device_trigger.CONF_CO = "co"

Definition at line 26 of file device_trigger.py.

◆ CONF_COLD

string homeassistant.components.binary_sensor.device_trigger.CONF_COLD = "cold"

Definition at line 28 of file device_trigger.py.

◆ CONF_CONNECTED

string homeassistant.components.binary_sensor.device_trigger.CONF_CONNECTED = "connected"

Definition at line 30 of file device_trigger.py.

◆ CONF_GAS

string homeassistant.components.binary_sensor.device_trigger.CONF_GAS = "gas"

Definition at line 32 of file device_trigger.py.

◆ CONF_HOT

string homeassistant.components.binary_sensor.device_trigger.CONF_HOT = "hot"

Definition at line 34 of file device_trigger.py.

◆ CONF_LIGHT

string homeassistant.components.binary_sensor.device_trigger.CONF_LIGHT = "light"

Definition at line 36 of file device_trigger.py.

◆ CONF_LOCKED

string homeassistant.components.binary_sensor.device_trigger.CONF_LOCKED = "locked"

Definition at line 38 of file device_trigger.py.

◆ CONF_MOIST

string homeassistant.components.binary_sensor.device_trigger.CONF_MOIST = "moist"

Definition at line 40 of file device_trigger.py.

◆ CONF_MOTION

string homeassistant.components.binary_sensor.device_trigger.CONF_MOTION = "motion"

Definition at line 42 of file device_trigger.py.

◆ CONF_MOVING

string homeassistant.components.binary_sensor.device_trigger.CONF_MOVING = "moving"

Definition at line 44 of file device_trigger.py.

◆ CONF_NO_CO

string homeassistant.components.binary_sensor.device_trigger.CONF_NO_CO = "no_co"

Definition at line 27 of file device_trigger.py.

◆ CONF_NO_GAS

string homeassistant.components.binary_sensor.device_trigger.CONF_NO_GAS = "no_gas"

Definition at line 33 of file device_trigger.py.

◆ CONF_NO_LIGHT

string homeassistant.components.binary_sensor.device_trigger.CONF_NO_LIGHT = "no_light"

Definition at line 37 of file device_trigger.py.

◆ CONF_NO_MOTION

string homeassistant.components.binary_sensor.device_trigger.CONF_NO_MOTION = "no_motion"

Definition at line 43 of file device_trigger.py.

◆ CONF_NO_PROBLEM

string homeassistant.components.binary_sensor.device_trigger.CONF_NO_PROBLEM = "no_problem"

Definition at line 55 of file device_trigger.py.

◆ CONF_NO_SMOKE

string homeassistant.components.binary_sensor.device_trigger.CONF_NO_SMOKE = "no_smoke"

Definition at line 61 of file device_trigger.py.

◆ CONF_NO_SOUND

string homeassistant.components.binary_sensor.device_trigger.CONF_NO_SOUND = "no_sound"

Definition at line 63 of file device_trigger.py.

◆ CONF_NO_UPDATE

string homeassistant.components.binary_sensor.device_trigger.CONF_NO_UPDATE = "no_update"

Definition at line 67 of file device_trigger.py.

◆ CONF_NO_VIBRATION

string homeassistant.components.binary_sensor.device_trigger.CONF_NO_VIBRATION = "no_vibration"

Definition at line 69 of file device_trigger.py.

◆ CONF_NOT_BAT_LOW

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_BAT_LOW = "not_bat_low"

Definition at line 23 of file device_trigger.py.

◆ CONF_NOT_CHARGING

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_CHARGING = "not_charging"

Definition at line 25 of file device_trigger.py.

◆ CONF_NOT_COLD

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_COLD = "not_cold"

Definition at line 29 of file device_trigger.py.

◆ CONF_NOT_CONNECTED

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_CONNECTED = "not_connected"

Definition at line 31 of file device_trigger.py.

◆ CONF_NOT_HOT

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_HOT = "not_hot"

Definition at line 35 of file device_trigger.py.

◆ CONF_NOT_LOCKED

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_LOCKED = "not_locked"

Definition at line 39 of file device_trigger.py.

◆ CONF_NOT_MOIST

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_MOIST = "not_moist"

Definition at line 41 of file device_trigger.py.

◆ CONF_NOT_MOVING

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_MOVING = "not_moving"

Definition at line 45 of file device_trigger.py.

◆ CONF_NOT_OCCUPIED

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_OCCUPIED = "not_occupied"

Definition at line 47 of file device_trigger.py.

◆ CONF_NOT_OPENED

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_OPENED = "not_opened"

Definition at line 71 of file device_trigger.py.

◆ CONF_NOT_PLUGGED_IN

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_PLUGGED_IN = "not_plugged_in"

Definition at line 49 of file device_trigger.py.

◆ CONF_NOT_POWERED

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_POWERED = "not_powered"

Definition at line 51 of file device_trigger.py.

◆ CONF_NOT_PRESENT

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_PRESENT = "not_present"

Definition at line 53 of file device_trigger.py.

◆ CONF_NOT_RUNNING

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_RUNNING = "not_running"

Definition at line 57 of file device_trigger.py.

◆ CONF_NOT_TAMPERED

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_TAMPERED = "not_tampered"

Definition at line 65 of file device_trigger.py.

◆ CONF_NOT_UNSAFE

string homeassistant.components.binary_sensor.device_trigger.CONF_NOT_UNSAFE = "not_unsafe"

Definition at line 59 of file device_trigger.py.

◆ CONF_OCCUPIED

string homeassistant.components.binary_sensor.device_trigger.CONF_OCCUPIED = "occupied"

Definition at line 46 of file device_trigger.py.

◆ CONF_OPENED

string homeassistant.components.binary_sensor.device_trigger.CONF_OPENED = "opened"

Definition at line 70 of file device_trigger.py.

◆ CONF_PLUGGED_IN

string homeassistant.components.binary_sensor.device_trigger.CONF_PLUGGED_IN = "plugged_in"

Definition at line 48 of file device_trigger.py.

◆ CONF_POWERED

string homeassistant.components.binary_sensor.device_trigger.CONF_POWERED = "powered"

Definition at line 50 of file device_trigger.py.

◆ CONF_PRESENT

string homeassistant.components.binary_sensor.device_trigger.CONF_PRESENT = "present"

Definition at line 52 of file device_trigger.py.

◆ CONF_PROBLEM

string homeassistant.components.binary_sensor.device_trigger.CONF_PROBLEM = "problem"

Definition at line 54 of file device_trigger.py.

◆ CONF_RUNNING

string homeassistant.components.binary_sensor.device_trigger.CONF_RUNNING = "running"

Definition at line 56 of file device_trigger.py.

◆ CONF_SMOKE

string homeassistant.components.binary_sensor.device_trigger.CONF_SMOKE = "smoke"

Definition at line 60 of file device_trigger.py.

◆ CONF_SOUND

string homeassistant.components.binary_sensor.device_trigger.CONF_SOUND = "sound"

Definition at line 62 of file device_trigger.py.

◆ CONF_TAMPERED

string homeassistant.components.binary_sensor.device_trigger.CONF_TAMPERED = "tampered"

Definition at line 64 of file device_trigger.py.

◆ CONF_UNSAFE

string homeassistant.components.binary_sensor.device_trigger.CONF_UNSAFE = "unsafe"

Definition at line 58 of file device_trigger.py.

◆ CONF_UPDATE

string homeassistant.components.binary_sensor.device_trigger.CONF_UPDATE = "update"

Definition at line 66 of file device_trigger.py.

◆ CONF_VIBRATION

string homeassistant.components.binary_sensor.device_trigger.CONF_VIBRATION = "vibration"

Definition at line 68 of file device_trigger.py.

◆ DEVICE_CLASS_NONE

string homeassistant.components.binary_sensor.device_trigger.DEVICE_CLASS_NONE = "none"

Definition at line 20 of file device_trigger.py.

◆ ENTITY_TRIGGERS

dictionary homeassistant.components.binary_sensor.device_trigger.ENTITY_TRIGGERS

Definition at line 74 of file device_trigger.py.

◆ TRIGGER_SCHEMA

homeassistant.components.binary_sensor.device_trigger.TRIGGER_SCHEMA
Initial value:
1 = DEVICE_TRIGGER_BASE_SCHEMA.extend(
2  {
3  vol.Required(CONF_ENTITY_ID): cv.entity_id_or_uuid,
4  vol.Required(CONF_TYPE): vol.In(TURNED_OFF + TURNED_ON),
5  vol.Optional(CONF_FOR): cv.positive_time_period_dict,
6  }
7 )

Definition at line 197 of file device_trigger.py.

◆ TURNED_OFF

list homeassistant.components.binary_sensor.device_trigger.TURNED_OFF = [trigger[1][CONF_TYPE] for trigger in ENTITY_TRIGGERS.values()]

Definition at line 194 of file device_trigger.py.

◆ TURNED_ON

list homeassistant.components.binary_sensor.device_trigger.TURNED_ON = [trigger[0][CONF_TYPE] for trigger in ENTITY_TRIGGERS.values()]

Definition at line 193 of file device_trigger.py.