mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-23 12:04:31 +02:00
Added more health sensors, fixes #320
This commit is contained in:
parent
a1b2851193
commit
b15940fc8e
1 changed files with 116 additions and 0 deletions
|
@ -19,6 +19,7 @@ from homeassistant.const import (
|
||||||
UnitOfDataRate,
|
UnitOfDataRate,
|
||||||
UnitOfInformation,
|
UnitOfInformation,
|
||||||
UnitOfElectricPotential,
|
UnitOfElectricPotential,
|
||||||
|
UnitOfElectricCurrent,
|
||||||
UnitOfPower,
|
UnitOfPower,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -300,6 +301,121 @@ SENSOR_TYPES: tuple[MikrotikSensorEntityDescription, ...] = (
|
||||||
data_uid="",
|
data_uid="",
|
||||||
data_reference="",
|
data_reference="",
|
||||||
),
|
),
|
||||||
|
MikrotikSensorEntityDescription(
|
||||||
|
key="system_fan3-speed",
|
||||||
|
name="Fan3 speed",
|
||||||
|
icon="mdi:fan",
|
||||||
|
native_unit_of_measurement=REVOLUTIONS_PER_MINUTE,
|
||||||
|
device_class=None,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
ha_group="System",
|
||||||
|
data_path="health",
|
||||||
|
data_attribute="fan3-speed",
|
||||||
|
data_name="",
|
||||||
|
data_uid="",
|
||||||
|
data_reference="",
|
||||||
|
),
|
||||||
|
MikrotikSensorEntityDescription(
|
||||||
|
key="system_fan4-speed",
|
||||||
|
name="Fan4 speed",
|
||||||
|
icon="mdi:fan",
|
||||||
|
native_unit_of_measurement=REVOLUTIONS_PER_MINUTE,
|
||||||
|
device_class=None,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
ha_group="System",
|
||||||
|
data_path="health",
|
||||||
|
data_attribute="fan4-speed",
|
||||||
|
data_name="",
|
||||||
|
data_uid="",
|
||||||
|
data_reference="",
|
||||||
|
),
|
||||||
|
MikrotikSensorEntityDescription(
|
||||||
|
key="system_poe_out_consumption",
|
||||||
|
name="PoE out power consumption",
|
||||||
|
icon="mdi:transmission-tower",
|
||||||
|
native_unit_of_measurement=UnitOfPower.WATT,
|
||||||
|
suggested_unit_of_measurement=UnitOfPower.WATT,
|
||||||
|
suggested_display_precision=1,
|
||||||
|
device_class=SensorDeviceClass.POWER,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
ha_group="System",
|
||||||
|
data_path="health",
|
||||||
|
data_attribute="poe-out-consumption",
|
||||||
|
data_name="",
|
||||||
|
data_uid="",
|
||||||
|
data_reference="",
|
||||||
|
),
|
||||||
|
MikrotikSensorEntityDescription(
|
||||||
|
key="system_psu1_current",
|
||||||
|
name="PSU 1 power consumption",
|
||||||
|
icon="mdi:lightning-bolt-circle",
|
||||||
|
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||||
|
suggested_unit_of_measurement=UnitOfElectricCurrent.MILLIAMPERE,
|
||||||
|
suggested_display_precision=1,
|
||||||
|
device_class=SensorDeviceClass.CURRENT,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
ha_group="System",
|
||||||
|
data_path="health",
|
||||||
|
data_attribute="psu1-current",
|
||||||
|
data_name="",
|
||||||
|
data_uid="",
|
||||||
|
data_reference="",
|
||||||
|
),
|
||||||
|
MikrotikSensorEntityDescription(
|
||||||
|
key="system_psu1_voltage",
|
||||||
|
name="PSU 1 Voltage",
|
||||||
|
icon="mdi:lightning-bolt",
|
||||||
|
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||||
|
suggested_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||||
|
suggested_display_precision=1,
|
||||||
|
device_class=SensorDeviceClass.VOLTAGE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
ha_group="System",
|
||||||
|
data_path="health",
|
||||||
|
data_attribute="psu1-voltage",
|
||||||
|
data_name="",
|
||||||
|
data_uid="",
|
||||||
|
data_reference="",
|
||||||
|
),
|
||||||
|
MikrotikSensorEntityDescription(
|
||||||
|
key="system_psu2_current",
|
||||||
|
name="PSU 2 power consumption",
|
||||||
|
icon="mdi:lightning-bolt-circle",
|
||||||
|
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
|
||||||
|
suggested_unit_of_measurement=UnitOfElectricCurrent.MILLIAMPERE,
|
||||||
|
suggested_display_precision=1,
|
||||||
|
device_class=SensorDeviceClass.CURRENT,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
ha_group="System",
|
||||||
|
data_path="health",
|
||||||
|
data_attribute="psu2-current",
|
||||||
|
data_name="",
|
||||||
|
data_uid="",
|
||||||
|
data_reference="",
|
||||||
|
),
|
||||||
|
MikrotikSensorEntityDescription(
|
||||||
|
key="system_psu2_voltage",
|
||||||
|
name="PSU 2 Voltage",
|
||||||
|
icon="mdi:lightning-bolt",
|
||||||
|
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||||
|
suggested_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||||
|
suggested_display_precision=1,
|
||||||
|
device_class=SensorDeviceClass.VOLTAGE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
ha_group="System",
|
||||||
|
data_path="health",
|
||||||
|
data_attribute="psu2-voltage",
|
||||||
|
data_name="",
|
||||||
|
data_uid="",
|
||||||
|
data_reference="",
|
||||||
|
),
|
||||||
MikrotikSensorEntityDescription(
|
MikrotikSensorEntityDescription(
|
||||||
key="system_uptime",
|
key="system_uptime",
|
||||||
name="Uptime",
|
name="Uptime",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue