Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.unifi.sensor Namespace Reference

Classes

class  UnifiSensorEntity
 
class  UnifiSensorEntityDescription
 

Functions

float|None _device_temperature (str temperature_name, list[TypedDeviceTemperature] temperatures)
 
TypedDeviceUptimeStatsWanMonitor|None _device_wan_latency_monitor (Literal["WAN", "WAN2"] wan, str monitor_target, Device device)
 
bool async_bandwidth_sensor_allowed_fn (UnifiHub hub, str obj_id)
 
bool async_client_is_connected_fn (UnifiHub hub, str obj_id)
 
float async_client_rx_value_fn (UnifiHub hub, Client client)
 
float async_client_tx_value_fn (UnifiHub hub, Client client)
 
datetime async_client_uptime_value_fn (UnifiHub hub, Client client)
 
int async_device_clients_value_fn (UnifiHub hub, Device device)
 
bool async_device_outlet_power_supported_fn (UnifiHub hub, str obj_id)
 
bool async_device_outlet_supported_fn (UnifiHub hub, str obj_id)
 
str async_device_state_value_fn (UnifiHub hub, Device device)
 
bool async_device_temperatures_supported_fn (str temperature_name, UnifiHub hub, str obj_id)
 
float async_device_temperatures_value_fn (str temperature_name, UnifiHub hub, Device device)
 
bool async_device_uplink_mac_supported_fn (UnifiHub hub, str obj_id)
 
datetime|None async_device_uptime_value_fn (UnifiHub hub, Device device)
 
bool async_device_wan_latency_supported_fn (Literal["WAN", "WAN2"] wan, str monitor_target, UnifiHub hub, str obj_id)
 
int|None async_device_wan_latency_value_fn (Literal["WAN", "WAN2"] wan, str monitor_target, UnifiHub hub, Device device)
 
None async_setup_entry (HomeAssistant hass, UnifiConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
bool async_uptime_sensor_allowed_fn (UnifiHub hub, str obj_id)
 
bool async_uptime_value_changed_fn (StateType|date|datetime|Decimal old, datetime|float|str|None new)
 
int async_wlan_client_value_fn (UnifiHub hub, Wlan wlan)
 
bool device_system_stats_supported_fn (int stat_index, UnifiHub hub, str obj_id)
 
tuple[UnifiSensorEntityDescription,...] make_device_temperatur_sensors ()
 
tuple[UnifiSensorEntityDescription,...] make_wan_latency_sensors ()
 

Detailed Description

Sensor platform for UniFi Network integration.

Support for bandwidth sensors of network clients.
Support for uptime sensors of network clients.

Function Documentation

◆ _device_temperature()

float | None homeassistant.components.unifi.sensor._device_temperature ( str  temperature_name,
list[TypedDeviceTemperature]   temperatures 
)
private
Return the temperature of the device.

Definition at line 316 of file sensor.py.

◆ _device_wan_latency_monitor()

TypedDeviceUptimeStatsWanMonitor | None homeassistant.components.unifi.sensor._device_wan_latency_monitor ( Literal["WAN", "WAN2"]  wan,
str  monitor_target,
Device   device 
)
private
Return the target of the WAN latency monitor.

Definition at line 244 of file sensor.py.

◆ async_bandwidth_sensor_allowed_fn()

bool homeassistant.components.unifi.sensor.async_bandwidth_sensor_allowed_fn ( UnifiHub  hub,
str  obj_id 
)
Check if client is allowed.

Definition at line 70 of file sensor.py.

◆ async_client_is_connected_fn()

bool homeassistant.components.unifi.sensor.async_client_is_connected_fn ( UnifiHub  hub,
str  obj_id 
)
Check if client was last seen recently.

Definition at line 194 of file sensor.py.

◆ async_client_rx_value_fn()

float homeassistant.components.unifi.sensor.async_client_rx_value_fn ( UnifiHub  hub,
Client  client 
)
Calculate receiving data transfer value.

Definition at line 86 of file sensor.py.

◆ async_client_tx_value_fn()

float homeassistant.components.unifi.sensor.async_client_tx_value_fn ( UnifiHub  hub,
Client  client 
)
Calculate transmission data transfer value.

Definition at line 94 of file sensor.py.

◆ async_client_uptime_value_fn()

datetime homeassistant.components.unifi.sensor.async_client_uptime_value_fn ( UnifiHub  hub,
Client  client 
)
Calculate the uptime of the client.

Definition at line 102 of file sensor.py.

◆ async_device_clients_value_fn()

int homeassistant.components.unifi.sensor.async_device_clients_value_fn ( UnifiHub  hub,
Device  device 
)
Calculate the amount of clients connected to a device.

Definition at line 124 of file sensor.py.

◆ async_device_outlet_power_supported_fn()

bool homeassistant.components.unifi.sensor.async_device_outlet_power_supported_fn ( UnifiHub  hub,
str  obj_id 
)
Determine if an outlet has the power property.

Definition at line 164 of file sensor.py.

◆ async_device_outlet_supported_fn()

bool homeassistant.components.unifi.sensor.async_device_outlet_supported_fn ( UnifiHub  hub,
str  obj_id 
)
Determine if a device supports reading overall power metrics.

Definition at line 172 of file sensor.py.

◆ async_device_state_value_fn()

str homeassistant.components.unifi.sensor.async_device_state_value_fn ( UnifiHub  hub,
Device  device 
)
Retrieve the state of the device.

Definition at line 208 of file sensor.py.

◆ async_device_temperatures_supported_fn()

bool homeassistant.components.unifi.sensor.async_device_temperatures_supported_fn ( str  temperature_name,
UnifiHub  hub,
str   obj_id 
)
Determine if an device have a temperatures.

Definition at line 306 of file sensor.py.

◆ async_device_temperatures_value_fn()

float homeassistant.components.unifi.sensor.async_device_temperatures_value_fn ( str  temperature_name,
UnifiHub  hub,
Device   device 
)
Retrieve the temperature of the device.

Definition at line 294 of file sensor.py.

◆ async_device_uplink_mac_supported_fn()

bool homeassistant.components.unifi.sensor.async_device_uplink_mac_supported_fn ( UnifiHub  hub,
str  obj_id 
)
Determine if a device supports reading uplink MAC address.

Definition at line 178 of file sensor.py.

◆ async_device_uptime_value_fn()

datetime | None homeassistant.components.unifi.sensor.async_device_uptime_value_fn ( UnifiHub  hub,
Device  device 
)
Calculate the approximate time the device started (based on uptime returned from API, in seconds).

Definition at line 145 of file sensor.py.

◆ async_device_wan_latency_supported_fn()

bool homeassistant.components.unifi.sensor.async_device_wan_latency_supported_fn ( Literal["WAN", "WAN2"]  wan,
str  monitor_target,
UnifiHub  hub,
str  obj_id 
)
Determine if an device have a latency monitor.

Definition at line 214 of file sensor.py.

◆ async_device_wan_latency_value_fn()

int | None homeassistant.components.unifi.sensor.async_device_wan_latency_value_fn ( Literal["WAN", "WAN2"]  wan,
str  monitor_target,
UnifiHub  hub,
Device  device 
)
Retrieve the monitor target from WAN monitors.

Definition at line 227 of file sensor.py.

◆ async_setup_entry()

None homeassistant.components.unifi.sensor.async_setup_entry ( HomeAssistant  hass,
UnifiConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up sensors for UniFi Network integration.

Definition at line 645 of file sensor.py.

◆ async_uptime_sensor_allowed_fn()

bool homeassistant.components.unifi.sensor.async_uptime_sensor_allowed_fn ( UnifiHub  hub,
str  obj_id 
)
Check if client is allowed.

Definition at line 78 of file sensor.py.

◆ async_uptime_value_changed_fn()

bool homeassistant.components.unifi.sensor.async_uptime_value_changed_fn ( StateType | date | datetime | Decimal  old,
datetime | float | str | None   new 
)
Reject the new uptime value if it's too similar to the old one. Avoids unwanted fluctuation.

Definition at line 154 of file sensor.py.

◆ async_wlan_client_value_fn()

int homeassistant.components.unifi.sensor.async_wlan_client_value_fn ( UnifiHub  hub,
Wlan  wlan 
)
Calculate the amount of clients connected to a wlan.

Definition at line 110 of file sensor.py.

◆ device_system_stats_supported_fn()

bool homeassistant.components.unifi.sensor.device_system_stats_supported_fn ( int  stat_index,
UnifiHub  hub,
str   obj_id 
)
Determine if a device supports reading item at index in system stats.

Definition at line 183 of file sensor.py.

◆ make_device_temperatur_sensors()

tuple[UnifiSensorEntityDescription, ...] homeassistant.components.unifi.sensor.make_device_temperatur_sensors ( )
Create device temperature sensors.

Definition at line 326 of file sensor.py.

◆ make_wan_latency_sensors()

tuple[UnifiSensorEntityDescription, ...] homeassistant.components.unifi.sensor.make_wan_latency_sensors ( )
Create WAN latency sensors from WAN monitor data.

Definition at line 255 of file sensor.py.