Skip to content

Commit 1bdba79

Browse files
authored
Add new sensors for Zigbee based devices in ViCare (home-assistant#154271)
1 parent aa8198d commit 1bdba79

File tree

10 files changed

+4034
-850
lines changed

10 files changed

+4034
-850
lines changed

homeassistant/components/vicare/binary_sensor.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
BinarySensorEntity,
2525
BinarySensorEntityDescription,
2626
)
27+
from homeassistant.const import EntityCategory
2728
from homeassistant.core import HomeAssistant
2829
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
2930

@@ -117,6 +118,32 @@ class ViCareBinarySensorEntityDescription(
117118
device_class=BinarySensorDeviceClass.PROBLEM,
118119
value_getter=lambda api: len(api.getDeviceErrors()) > 0,
119120
),
121+
ViCareBinarySensorEntityDescription(
122+
key="identification_mode",
123+
translation_key="identification_mode",
124+
entity_category=EntityCategory.DIAGNOSTIC,
125+
value_getter=lambda api: api.getIdentification(),
126+
entity_registry_enabled_default=False,
127+
),
128+
ViCareBinarySensorEntityDescription(
129+
key="mounting_mode",
130+
translation_key="mounting_mode",
131+
entity_category=EntityCategory.DIAGNOSTIC,
132+
value_getter=lambda api: api.getMountingMode(),
133+
entity_registry_enabled_default=False,
134+
),
135+
ViCareBinarySensorEntityDescription(
136+
key="child_safety_lock_mode",
137+
translation_key="child_safety_lock_mode",
138+
value_getter=lambda api: api.getChildLock() == "active",
139+
entity_registry_enabled_default=False,
140+
),
141+
ViCareBinarySensorEntityDescription(
142+
key="valve",
143+
translation_key="valve",
144+
device_class=BinarySensorDeviceClass.DOOR,
145+
value_getter=lambda api: api.isValveOpen(),
146+
),
120147
)
121148

122149

homeassistant/components/vicare/icons.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
},
2222
"one_time_charge": {
2323
"default": "mdi:shower-head"
24+
},
25+
"mounting_mode": {
26+
"default": "mdi:wrench"
27+
},
28+
"child_safety_lock_mode": {
29+
"default": "mdi:lock"
30+
},
31+
"valve": {
32+
"default": "mdi:pipe-valve"
2433
}
2534
},
2635
"button": {
@@ -90,6 +99,12 @@
9099
},
91100
"ventilation_level": {
92101
"default": "mdi:fan"
102+
},
103+
"zigbee_signal_strength": {
104+
"default": "mdi:wifi"
105+
},
106+
"valve_position": {
107+
"default": "mdi:pipe-valve"
93108
}
94109
}
95110
},

homeassistant/components/vicare/sensor.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,23 @@ class ViCareSensorEntityDescription(SensorEntityDescription, ViCareRequiredKeysM
943943
entity_category=EntityCategory.DIAGNOSTIC,
944944
value_getter=lambda api: api.getBatteryLevel(),
945945
),
946+
ViCareSensorEntityDescription(
947+
key="zigbee_signal_strength",
948+
translation_key="zigbee_signal_strength",
949+
state_class=SensorStateClass.MEASUREMENT,
950+
entity_category=EntityCategory.DIAGNOSTIC,
951+
native_unit_of_measurement=PERCENTAGE,
952+
value_getter=lambda api: api.getZigbeeSignalStrength(),
953+
entity_registry_enabled_default=False,
954+
),
955+
ViCareSensorEntityDescription(
956+
key="valve_position",
957+
translation_key="valve_position",
958+
state_class=SensorStateClass.MEASUREMENT,
959+
native_unit_of_measurement=PERCENTAGE,
960+
value_getter=lambda api: api.getValvePosition(),
961+
entity_registry_enabled_default=False,
962+
),
946963
ViCareSensorEntityDescription(
947964
key="fuel_need",
948965
translation_key="fuel_need",

homeassistant/components/vicare/strings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@
6666
},
6767
"one_time_charge": {
6868
"name": "One-time charge"
69+
},
70+
"identification_mode": {
71+
"name": "Identification mode"
72+
},
73+
"mounting_mode": {
74+
"name": "Mounting mode"
75+
},
76+
"child_safety_lock_mode": {
77+
"name": "Child safety lock"
78+
},
79+
"valve": {
80+
"name": "Valve"
6981
}
7082
},
7183
"button": {
@@ -502,6 +514,12 @@
502514
},
503515
"fuel_need": {
504516
"name": "Fuel need"
517+
},
518+
"zigbee_signal_strength": {
519+
"name": "[%key:component::sensor::entity_component::signal_strength::name%]"
520+
},
521+
"valve_position": {
522+
"name": "Valve position"
505523
}
506524
},
507525
"water_heater": {
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"data": [
3+
{
4+
"apiVersion": 1,
5+
"commands": {},
6+
"deviceId": "zigbee-################",
7+
"feature": "device.identification",
8+
"gatewayId": "################",
9+
"isEnabled": true,
10+
"isReady": true,
11+
"properties": {
12+
"triggered": {
13+
"type": "boolean",
14+
"value": false
15+
}
16+
},
17+
"timestamp": "2025-10-05T14:18:37.089Z",
18+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.identification"
19+
},
20+
{
21+
"apiVersion": 1,
22+
"commands": {},
23+
"deviceId": "zigbee-################",
24+
"feature": "device.messages.status.raw",
25+
"gatewayId": "################",
26+
"isEnabled": true,
27+
"isReady": true,
28+
"properties": {
29+
"entries": {
30+
"type": "array",
31+
"value": []
32+
}
33+
},
34+
"timestamp": "2025-10-05T14:18:37.089Z",
35+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.messages.status.raw"
36+
},
37+
{
38+
"apiVersion": 1,
39+
"commands": {
40+
"setName": {
41+
"isExecutable": true,
42+
"name": "setName",
43+
"params": {
44+
"name": {
45+
"constraints": {
46+
"maxLength": 40,
47+
"minLength": 1,
48+
"regEx": "^[\\p{L}0-9]+( [\\p{L}0-9]+)*$"
49+
},
50+
"required": true,
51+
"type": "string"
52+
}
53+
},
54+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.name/commands/setName"
55+
}
56+
},
57+
"deviceId": "zigbee-################",
58+
"feature": "device.name",
59+
"gatewayId": "################",
60+
"isEnabled": true,
61+
"isReady": true,
62+
"properties": {
63+
"name": {
64+
"type": "string",
65+
"value": "OG Repeater"
66+
}
67+
},
68+
"timestamp": "2025-10-05T14:18:37.089Z",
69+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.name"
70+
},
71+
{
72+
"apiVersion": 1,
73+
"commands": {},
74+
"deviceId": "zigbee-################",
75+
"feature": "device.zigbee.lqi",
76+
"gatewayId": "################",
77+
"isEnabled": true,
78+
"isReady": true,
79+
"properties": {
80+
"strength": {
81+
"type": "number",
82+
"unit": "percent",
83+
"value": 46
84+
}
85+
},
86+
"timestamp": "2025-10-06T11:06:23.603Z",
87+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.lqi"
88+
},
89+
{
90+
"apiVersion": 1,
91+
"commands": {},
92+
"deviceId": "zigbee-################",
93+
"feature": "device.zigbee.parent.id",
94+
"gatewayId": "################",
95+
"isEnabled": true,
96+
"isReady": true,
97+
"properties": {
98+
"value": {
99+
"type": "string",
100+
"value": "################"
101+
}
102+
},
103+
"timestamp": "2025-10-06T11:05:13.499Z",
104+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.parent.id"
105+
},
106+
{
107+
"apiVersion": 1,
108+
"commands": {},
109+
"deviceId": "zigbee-################",
110+
"feature": "device.zigbee.parent.rx",
111+
"gatewayId": "################",
112+
"isEnabled": true,
113+
"isReady": true,
114+
"properties": {
115+
"value": {
116+
"type": "number",
117+
"unit": "",
118+
"value": 125
119+
}
120+
},
121+
"timestamp": "2025-10-06T11:07:24.638Z",
122+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.parent.rx"
123+
},
124+
{
125+
"apiVersion": 1,
126+
"commands": {},
127+
"deviceId": "zigbee-################",
128+
"feature": "device.zigbee.parent.tx",
129+
"gatewayId": "################",
130+
"isEnabled": true,
131+
"isReady": true,
132+
"properties": {
133+
"value": {
134+
"type": "number",
135+
"unit": "",
136+
"value": 122
137+
}
138+
},
139+
"timestamp": "2025-10-06T11:06:23.603Z",
140+
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.parent.tx"
141+
}
142+
]
143+
}

0 commit comments

Comments
 (0)