Add support for ELV-SH-CTV Sensor to homematicip_cloud (#143737)

This commit is contained in:
hahn-th
2025-07-08 07:24:55 +02:00
committed by GitHub
parent 7a7e16bbb6
commit f780b9763d
6 changed files with 434 additions and 98 deletions
@@ -8297,6 +8297,152 @@
"type": "DOOR_BELL_CONTACT_INTERFACE",
"updateState": "UP_TO_DATE"
},
"3014F7110000000000000CTV": {
"availableFirmwareVersion": "0.0.0",
"connectionType": "HMIP_RF",
"deviceArchetype": "HMIP",
"firmwareVersion": "1.0.6",
"firmwareVersionInteger": 65542,
"functionalChannels": {
"0": {
"busConfigMismatch": null,
"coProFaulty": false,
"coProRestartNeeded": false,
"coProUpdateFailure": false,
"configPending": false,
"controlsMountingOrientation": null,
"daliBusState": null,
"defaultLinkedGroup": [],
"deviceAliveSignalEnabled": null,
"deviceCommunicationError": null,
"deviceDriveError": null,
"deviceDriveModeError": null,
"deviceId": "3014F7110000000000000CTV",
"deviceOperationMode": null,
"deviceOverheated": false,
"deviceOverloaded": false,
"devicePowerFailureDetected": false,
"deviceUndervoltage": false,
"displayContrast": null,
"displayMode": null,
"displayMountingOrientation": null,
"dutyCycle": false,
"functionalChannelType": "DEVICE_BASE",
"groupIndex": 0,
"groups": [
"00000000-0000-0000-0000-000000000041",
"00000000-0000-0000-0000-000000000042"
],
"index": 0,
"invertedDisplayColors": null,
"label": "",
"lockJammed": null,
"lowBat": false,
"mountingOrientation": null,
"multicastRoutingEnabled": false,
"operationDays": null,
"particulateMatterSensorCommunicationError": null,
"particulateMatterSensorError": null,
"powerShortCircuit": null,
"profilePeriodLimitReached": null,
"routerModuleEnabled": false,
"routerModuleSupported": false,
"rssiDeviceValue": -102,
"rssiPeerValue": null,
"sensorCommunicationError": null,
"sensorError": null,
"shortCircuitDataLine": null,
"supportedOptionalFeatures": {
"IFeatureBusConfigMismatch": false,
"IFeatureDeviceCoProError": false,
"IFeatureDeviceCoProRestart": false,
"IFeatureDeviceCoProUpdate": false,
"IFeatureDeviceCommunicationError": false,
"IFeatureDeviceDaliBusError": false,
"IFeatureDeviceDriveError": false,
"IFeatureDeviceDriveModeError": false,
"IFeatureDeviceIdentify": false,
"IFeatureDeviceOverheated": false,
"IFeatureDeviceOverloaded": false,
"IFeatureDeviceParticulateMatterSensorCommunicationError": false,
"IFeatureDeviceParticulateMatterSensorError": false,
"IFeatureDevicePowerFailure": false,
"IFeatureDeviceSensorCommunicationError": false,
"IFeatureDeviceSensorError": false,
"IFeatureDeviceTemperatureHumiditySensorCommunicationError": false,
"IFeatureDeviceTemperatureHumiditySensorError": false,
"IFeatureDeviceTemperatureOutOfRange": false,
"IFeatureDeviceUndervoltage": false,
"IFeatureMulticastRouter": false,
"IFeaturePowerShortCircuit": false,
"IFeatureProfilePeriodLimit": false,
"IFeatureRssiValue": true,
"IFeatureShortCircuitDataLine": false,
"IOptionalFeatureDefaultLinkedGroup": false,
"IOptionalFeatureDeviceAliveSignalEnabled": false,
"IOptionalFeatureDeviceErrorLockJammed": false,
"IOptionalFeatureDeviceOperationMode": false,
"IOptionalFeatureDisplayContrast": false,
"IOptionalFeatureDisplayMode": false,
"IOptionalFeatureDutyCycle": true,
"IOptionalFeatureInvertedDisplayColors": false,
"IOptionalFeatureLowBat": true,
"IOptionalFeatureMountingOrientation": false,
"IOptionalFeatureOperationDays": false
},
"temperatureHumiditySensorCommunicationError": null,
"temperatureHumiditySensorError": null,
"temperatureOutOfRange": false,
"unreach": false
},
"1": {
"absoluteAngle": 89,
"accelerationSensorEventFilterPeriod": 3.0,
"accelerationSensorMode": "TILT",
"accelerationSensorNeutralPosition": "VERTICAL",
"accelerationSensorSecondTriggerAngle": 75,
"accelerationSensorSensitivity": "SENSOR_RANGE_2G_2PLUS_SENSE",
"accelerationSensorTriggerAngle": 20,
"accelerationSensorTriggered": false,
"channelRole": "ACCELERATION_SENSOR",
"deviceId": "3014F7110000000000000CTV",
"functionalChannelType": "TILT_VIBRATION_SENSOR_CHANNEL",
"groupIndex": 1,
"groups": [
"00000000-0000-0000-0000-000000000023",
"00000000-0000-0000-0000-000000000041",
"00000000-0000-0000-0000-000000000043"
],
"index": 1,
"label": "",
"supportedOptionalFeatures": {
"IFeatureLightGroupSensorChannel": false,
"IOptionalFeatureAbsoluteAngle": true,
"IOptionalFeatureAccelerationSensorTiltTriggerAngle": true,
"IOptionalFeatureTiltDetection": true,
"IOptionalFeatureTiltState": true,
"IOptionalFeatureTiltVisualization": true
},
"tiltState": "NEUTRAL",
"tiltVisualization": "GARAGE_DOOR"
}
},
"homeId": "00000000-0000-0000-0000-000000000001",
"id": "3014F7110000000000000CTV",
"label": "Neigungssensor Tor",
"lastStatusUpdate": 1741379260066,
"liveUpdateState": "LIVE_UPDATE_NOT_SUPPORTED",
"manuallyUpdateForced": false,
"manufacturerCode": 9,
"measuredAttributes": {},
"modelId": 580,
"modelType": "ELV-SH-CTV",
"oem": "eQ-3",
"permanentlyReachable": false,
"serializedGlobalTradeItemNumber": "3014F7110000000000000CTV",
"type": "TILT_VIBRATION_SENSOR_COMPACT",
"updateState": "UP_TO_DATE"
},
"3014F71100000000000SVCTH": {
"availableFirmwareVersion": "1.0.10",
"connectionType": "HMIP_RF",
@@ -22,7 +22,7 @@ async def test_hmip_load_all_supported_devices(
test_devices=None, test_groups=None
)
assert len(mock_hap.hmip_device_by_entity_id) == 325
assert len(mock_hap.hmip_device_by_entity_id) == 331
async def test_hmip_remove_device(
@@ -13,6 +13,9 @@ from homeassistant.components.homematicip_cloud.entity import (
)
from homeassistant.components.homematicip_cloud.hap import HomematicipHAP
from homeassistant.components.homematicip_cloud.sensor import (
ATTR_ACCELERATION_SENSOR_NEUTRAL_POSITION,
ATTR_ACCELERATION_SENSOR_SECOND_TRIGGER_ANGLE,
ATTR_ACCELERATION_SENSOR_TRIGGER_ANGLE,
ATTR_CURRENT_ILLUMINATION,
ATTR_HIGHEST_ILLUMINATION,
ATTR_LEFT_COUNTER,
@@ -708,6 +711,54 @@ async def test_hmip_esi_led_energy_counter_usage_high_tariff(
assert ha_state.state == "23825.748"
async def test_hmip_tilt_vibration_sensor_tilt_state(
hass: HomeAssistant, default_mock_hap_factory: HomeFactory
) -> None:
"""Test HomematicipTiltVibrationSensor."""
entity_id = "sensor.neigungssensor_tor_tilt_state"
entity_name = "Neigungssensor Tor Tilt State"
device_model = "ELV-SH-CTV"
mock_hap = await default_mock_hap_factory.async_get_mock_hap(
test_devices=["Neigungssensor Tor"]
)
ha_state, hmip_device = get_and_check_entity_basics(
hass, mock_hap, entity_id, entity_name, device_model
)
assert ha_state.state == "neutral"
await async_manipulate_test_data(hass, hmip_device, "tiltState", "NON_NEUTRAL", 1)
ha_state = hass.states.get(entity_id)
assert ha_state.state == "non_neutral"
await async_manipulate_test_data(hass, hmip_device, "tiltState", "TILTED", 1)
ha_state = hass.states.get(entity_id)
assert ha_state.state == "tilted"
assert ha_state.attributes[ATTR_ACCELERATION_SENSOR_NEUTRAL_POSITION] == "VERTICAL"
assert ha_state.attributes[ATTR_ACCELERATION_SENSOR_TRIGGER_ANGLE] == 20
assert ha_state.attributes[ATTR_ACCELERATION_SENSOR_SECOND_TRIGGER_ANGLE] == 75
async def test_hmip_tilt_vibration_sensor_tilt_angle(
hass: HomeAssistant, default_mock_hap_factory: HomeFactory
) -> None:
"""Test HomematicipTiltVibrationSensor."""
entity_id = "sensor.neigungssensor_tor_tilt_angle"
entity_name = "Neigungssensor Tor Tilt Angle"
device_model = "ELV-SH-CTV"
mock_hap = await default_mock_hap_factory.async_get_mock_hap(
test_devices=["Neigungssensor Tor"]
)
ha_state, hmip_device = get_and_check_entity_basics(
hass, mock_hap, entity_id, entity_name, device_model
)
assert ha_state.state == "89"
async def test_hmip_absolute_humidity_sensor(
hass: HomeAssistant, default_mock_hap_factory: HomeFactory
) -> None: