mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-03 10:31:37 +00:00
Expose pi_heating_demand to Home Assistant (#9759)
* homeassistant: expose pi_heating_demand on climate This allows homeassistant to access the actual percentage actuation currently used on thermostats. * Update homeassistant.ts Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
This commit is contained in:
@@ -288,6 +288,23 @@ export default class HomeAssistant extends Extension {
|
||||
discoveryEntries.push(discoveryEntry);
|
||||
}
|
||||
|
||||
const piHeatingDemand = firstExpose.features.find((f) => f.name === 'pi_heating_demand');
|
||||
if (piHeatingDemand) {
|
||||
const discoveryEntry = {
|
||||
type: 'sensor',
|
||||
object_id: endpoint ? `${piHeatingDemand.name}_${endpoint}` : `${piHeatingDemand.name}`,
|
||||
mockProperties: [piHeatingDemand.property],
|
||||
discovery_payload: {
|
||||
value_template: `{{ value_json.${piHeatingDemand.property} }}`,
|
||||
...(piHeatingDemand.unit && {unit_of_measurement: piHeatingDemand.unit}),
|
||||
entity_category: 'diagnostic',
|
||||
icon: 'mdi:radiator',
|
||||
},
|
||||
};
|
||||
|
||||
discoveryEntries.push(discoveryEntry);
|
||||
}
|
||||
|
||||
discoveryEntries.push(discoveryEntry);
|
||||
} else if (firstExpose.type === 'lock') {
|
||||
assert(!endpoint, `Endpoint not supported for lock type`);
|
||||
|
||||
Reference in New Issue
Block a user