diff --git a/lib/extension/homeassistant.ts b/lib/extension/homeassistant.ts index 3eb3070c..4211c610 100644 --- a/lib/extension/homeassistant.ts +++ b/lib/extension/homeassistant.ts @@ -856,6 +856,12 @@ export default class HomeAssistant extends Extension { delete discoveryEntry.discovery_payload.device_class; } + // entity_category config is not allowed for sensors + // https://github.com/Koenkk/zigbee2mqtt/issues/20252 + if (discoveryEntry.discovery_payload.entity_category === 'config') { + delete discoveryEntry.discovery_payload.entity_category; + } + // Let Home Assistant generate entity name when device_class is present if (discoveryEntry.discovery_payload.device_class) delete discoveryEntry.discovery_payload.name; diff --git a/test/publish.test.js b/test/publish.test.js index 8b3927d4..1a0f0d91 100644 --- a/test/publish.test.js +++ b/test/publish.test.js @@ -1407,7 +1407,7 @@ describe('Publish', () => { expect(MQTT.publish.mock.calls[3]).toEqual([ 'zigbee2mqtt/bulb_color', stringify({"state":"ON","brightness":150}), { qos: 0, retain: false }, expect.any(Function)]); }); - it('onlythis Scenes', async () => { + it('Scenes', async () => { const bulb_color_2 = zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1); const bulb_2 = zigbeeHerdsman.devices.bulb_2.getEndpoint(1); const group = zigbeeHerdsman.groups.group_tradfri_remote;