Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.hue.v1.device_trigger Namespace Reference

Functions

def _get_hue_event_from_device_id (hass, device_id)
 
CALLBACK_TYPE async_attach_trigger (HueBridge bridge, DeviceEntry device_entry, ConfigType config, TriggerActionType action, TriggerInfo trigger_info)
 
list[dict[str, str]] async_get_triggers (HueBridge bridge, DeviceEntry device)
 
ConfigType async_validate_trigger_config (HueBridge bridge, DeviceEntry device_entry, ConfigType config)
 

Variables

string CONF_BUTTON_1 = "button_1"
 
string CONF_BUTTON_2 = "button_2"
 
string CONF_BUTTON_3 = "button_3"
 
string CONF_BUTTON_4 = "button_4"
 
string CONF_DIM_DOWN = "dim_down"
 
string CONF_DIM_UP = "dim_up"
 
string CONF_DOUBLE_BUTTON_1 = "double_buttons_1_3"
 
string CONF_DOUBLE_BUTTON_2 = "double_buttons_2_4"
 
string CONF_DOUBLE_LONG_RELEASE = "remote_double_button_long_press"
 
string CONF_DOUBLE_SHORT_RELEASE = "remote_double_button_short_press"
 
string CONF_LONG_RELEASE = "remote_button_long_release"
 
string CONF_SHORT_PRESS = "remote_button_short_press"
 
string CONF_SHORT_RELEASE = "remote_button_short_release"
 
string CONF_TURN_OFF = "turn_off"
 
string CONF_TURN_ON = "turn_on"
 
dictionary HUE_BUTTON_REMOTE
 
string HUE_BUTTON_REMOTE_MODEL = "Hue Smart button"
 
dictionary HUE_DIMMER_REMOTE
 
string HUE_DIMMER_REMOTE_MODEL = "Hue dimmer switch"
 
dictionary HUE_FOHSWITCH_REMOTE
 
string HUE_FOHSWITCH_REMOTE_MODEL = "Friends of Hue Switch"
 
dictionary HUE_TAP_REMOTE
 
string HUE_TAP_REMOTE_MODEL = "Hue tap switch"
 
dictionary HUE_WALL_REMOTE
 
string HUE_WALL_REMOTE_MODEL = "Hue wall switch module"
 
 TRIGGER_SCHEMA
 

Detailed Description

Provides device automations for Philips Hue events in V1 bridge/api.

Function Documentation

◆ _get_hue_event_from_device_id()

def homeassistant.components.hue.v1.device_trigger._get_hue_event_from_device_id (   hass,
  device_id 
)
private
Resolve hue event from device id.

Definition at line 112 of file device_trigger.py.

◆ async_attach_trigger()

CALLBACK_TYPE homeassistant.components.hue.v1.device_trigger.async_attach_trigger ( HueBridge  bridge,
DeviceEntry  device_entry,
ConfigType  config,
TriggerActionType  action,
TriggerInfo  trigger_info 
)
Listen for state changes based on configuration.

Definition at line 147 of file device_trigger.py.

◆ async_get_triggers()

list[dict[str, str]] homeassistant.components.hue.v1.device_trigger.async_get_triggers ( HueBridge  bridge,
DeviceEntry  device 
)
Return device triggers for device on `v1` bridge.

Make sure device is a supported remote model.
Retrieve the hue event object matching device entry.
Generate device trigger list.

Definition at line 179 of file device_trigger.py.

◆ async_validate_trigger_config()

ConfigType homeassistant.components.hue.v1.device_trigger.async_validate_trigger_config ( HueBridge  bridge,
DeviceEntry  device_entry,
ConfigType   config 
)
Validate config.

Definition at line 122 of file device_trigger.py.

Variable Documentation

◆ CONF_BUTTON_1

string homeassistant.components.hue.v1.device_trigger.CONF_BUTTON_1 = "button_1"

Definition at line 47 of file device_trigger.py.

◆ CONF_BUTTON_2

string homeassistant.components.hue.v1.device_trigger.CONF_BUTTON_2 = "button_2"

Definition at line 48 of file device_trigger.py.

◆ CONF_BUTTON_3

string homeassistant.components.hue.v1.device_trigger.CONF_BUTTON_3 = "button_3"

Definition at line 49 of file device_trigger.py.

◆ CONF_BUTTON_4

string homeassistant.components.hue.v1.device_trigger.CONF_BUTTON_4 = "button_4"

Definition at line 50 of file device_trigger.py.

◆ CONF_DIM_DOWN

string homeassistant.components.hue.v1.device_trigger.CONF_DIM_DOWN = "dim_down"

Definition at line 46 of file device_trigger.py.

◆ CONF_DIM_UP

string homeassistant.components.hue.v1.device_trigger.CONF_DIM_UP = "dim_up"

Definition at line 45 of file device_trigger.py.

◆ CONF_DOUBLE_BUTTON_1

string homeassistant.components.hue.v1.device_trigger.CONF_DOUBLE_BUTTON_1 = "double_buttons_1_3"

Definition at line 51 of file device_trigger.py.

◆ CONF_DOUBLE_BUTTON_2

string homeassistant.components.hue.v1.device_trigger.CONF_DOUBLE_BUTTON_2 = "double_buttons_2_4"

Definition at line 52 of file device_trigger.py.

◆ CONF_DOUBLE_LONG_RELEASE

string homeassistant.components.hue.v1.device_trigger.CONF_DOUBLE_LONG_RELEASE = "remote_double_button_long_press"

Definition at line 41 of file device_trigger.py.

◆ CONF_DOUBLE_SHORT_RELEASE

string homeassistant.components.hue.v1.device_trigger.CONF_DOUBLE_SHORT_RELEASE = "remote_double_button_short_press"

Definition at line 40 of file device_trigger.py.

◆ CONF_LONG_RELEASE

string homeassistant.components.hue.v1.device_trigger.CONF_LONG_RELEASE = "remote_button_long_release"

Definition at line 39 of file device_trigger.py.

◆ CONF_SHORT_PRESS

string homeassistant.components.hue.v1.device_trigger.CONF_SHORT_PRESS = "remote_button_short_press"

Definition at line 37 of file device_trigger.py.

◆ CONF_SHORT_RELEASE

string homeassistant.components.hue.v1.device_trigger.CONF_SHORT_RELEASE = "remote_button_short_release"

Definition at line 38 of file device_trigger.py.

◆ CONF_TURN_OFF

string homeassistant.components.hue.v1.device_trigger.CONF_TURN_OFF = "turn_off"

Definition at line 44 of file device_trigger.py.

◆ CONF_TURN_ON

string homeassistant.components.hue.v1.device_trigger.CONF_TURN_ON = "turn_on"

Definition at line 43 of file device_trigger.py.

◆ HUE_BUTTON_REMOTE

dictionary homeassistant.components.hue.v1.device_trigger.HUE_BUTTON_REMOTE
Initial value:
1 = {
2  (CONF_SHORT_RELEASE, CONF_TURN_ON): {CONF_EVENT: 1002},
3  (CONF_LONG_RELEASE, CONF_TURN_ON): {CONF_EVENT: 1003},
4 }

Definition at line 67 of file device_trigger.py.

◆ HUE_BUTTON_REMOTE_MODEL

string homeassistant.components.hue.v1.device_trigger.HUE_BUTTON_REMOTE_MODEL = "Hue Smart button"

Definition at line 66 of file device_trigger.py.

◆ HUE_DIMMER_REMOTE

dictionary homeassistant.components.hue.v1.device_trigger.HUE_DIMMER_REMOTE
Initial value:
1 = {
2  (CONF_SHORT_RELEASE, CONF_TURN_ON): {CONF_EVENT: 1002},
3  (CONF_LONG_RELEASE, CONF_TURN_ON): {CONF_EVENT: 1003},
4  (CONF_SHORT_RELEASE, CONF_DIM_UP): {CONF_EVENT: 2002},
5  (CONF_LONG_RELEASE, CONF_DIM_UP): {CONF_EVENT: 2003},
6  (CONF_SHORT_RELEASE, CONF_DIM_DOWN): {CONF_EVENT: 3002},
7  (CONF_LONG_RELEASE, CONF_DIM_DOWN): {CONF_EVENT: 3003},
8  (CONF_SHORT_RELEASE, CONF_TURN_OFF): {CONF_EVENT: 4002},
9  (CONF_LONG_RELEASE, CONF_TURN_OFF): {CONF_EVENT: 4003},
10 }

Definition at line 55 of file device_trigger.py.

◆ HUE_DIMMER_REMOTE_MODEL

string homeassistant.components.hue.v1.device_trigger.HUE_DIMMER_REMOTE_MODEL = "Hue dimmer switch"

Definition at line 54 of file device_trigger.py.

◆ HUE_FOHSWITCH_REMOTE

dictionary homeassistant.components.hue.v1.device_trigger.HUE_FOHSWITCH_REMOTE
Initial value:
1 = {
2  (CONF_SHORT_PRESS, CONF_BUTTON_1): {CONF_EVENT: 20},
3  (CONF_LONG_RELEASE, CONF_BUTTON_1): {CONF_EVENT: 16},
4  (CONF_SHORT_PRESS, CONF_BUTTON_2): {CONF_EVENT: 21},
5  (CONF_LONG_RELEASE, CONF_BUTTON_2): {CONF_EVENT: 17},
6  (CONF_SHORT_PRESS, CONF_BUTTON_3): {CONF_EVENT: 23},
7  (CONF_LONG_RELEASE, CONF_BUTTON_3): {CONF_EVENT: 19},
8  (CONF_SHORT_PRESS, CONF_BUTTON_4): {CONF_EVENT: 22},
9  (CONF_LONG_RELEASE, CONF_BUTTON_4): {CONF_EVENT: 18},
10  (CONF_DOUBLE_SHORT_RELEASE, CONF_DOUBLE_BUTTON_1): {CONF_EVENT: 101},
11  (CONF_DOUBLE_LONG_RELEASE, CONF_DOUBLE_BUTTON_1): {CONF_EVENT: 100},
12  (CONF_DOUBLE_SHORT_RELEASE, CONF_DOUBLE_BUTTON_2): {CONF_EVENT: 99},
13  (CONF_DOUBLE_LONG_RELEASE, CONF_DOUBLE_BUTTON_2): {CONF_EVENT: 98},
14 }

Definition at line 87 of file device_trigger.py.

◆ HUE_FOHSWITCH_REMOTE_MODEL

string homeassistant.components.hue.v1.device_trigger.HUE_FOHSWITCH_REMOTE_MODEL = "Friends of Hue Switch"

Definition at line 86 of file device_trigger.py.

◆ HUE_TAP_REMOTE

dictionary homeassistant.components.hue.v1.device_trigger.HUE_TAP_REMOTE
Initial value:
1 = {
2  (CONF_SHORT_PRESS, CONF_BUTTON_1): {CONF_EVENT: 34},
3  (CONF_SHORT_PRESS, CONF_BUTTON_2): {CONF_EVENT: 16},
4  (CONF_SHORT_PRESS, CONF_BUTTON_3): {CONF_EVENT: 17},
5  (CONF_SHORT_PRESS, CONF_BUTTON_4): {CONF_EVENT: 18},
6 }

Definition at line 79 of file device_trigger.py.

◆ HUE_TAP_REMOTE_MODEL

string homeassistant.components.hue.v1.device_trigger.HUE_TAP_REMOTE_MODEL = "Hue tap switch"

Definition at line 78 of file device_trigger.py.

◆ HUE_WALL_REMOTE

dictionary homeassistant.components.hue.v1.device_trigger.HUE_WALL_REMOTE
Initial value:
1 = {
2  (CONF_SHORT_RELEASE, CONF_BUTTON_1): {CONF_EVENT: 1002},
3  (CONF_SHORT_RELEASE, CONF_BUTTON_2): {CONF_EVENT: 2002},
4 }

Definition at line 73 of file device_trigger.py.

◆ HUE_WALL_REMOTE_MODEL

string homeassistant.components.hue.v1.device_trigger.HUE_WALL_REMOTE_MODEL = "Hue wall switch module"

Definition at line 72 of file device_trigger.py.

◆ TRIGGER_SCHEMA

homeassistant.components.hue.v1.device_trigger.TRIGGER_SCHEMA
Initial value:
1 = DEVICE_TRIGGER_BASE_SCHEMA.extend(
2  {vol.Required(CONF_TYPE): str, vol.Required(CONF_SUBTYPE): str}
3 )

Definition at line 32 of file device_trigger.py.