Closed pmagyar closed 3 months ago
What approach do you want to take? Do we want a library of known models with preformed configuration, or do you want to inspect the capabilities from devices.json
and build a configuration from that?
I think generally we should use the devices.json
as base.
To maintain a library with known models and expand that, doesn't sound sustainable.
Maybe we need special configurations for some devices. This can be done through a library.
But as start the devices.json
is enough.
I use the mqtt sensor setting (simple):
Example:
mqtt:
- sensor:
- name: "Dishwasher"
unique_id: "dishwasher_SERIAL"
icon: mdi:dishwasher
state_topic: "homeconnect/dishwasher/state"
device:
identifiers: "dishwasher_SERIAL"
name: "Dishwasher"
manufacturer: "SIEMENS"
model: "SN55TS00CE"
serial_number: "SERIAL"
suggested_area: Kitchen
availability:
- topic: "homeconnect/dishwasher/LWT"
availability_mode: all
- name: "Internal Errot"
unique_id: "dishwasher_InternalError"
icon: mdi:dishwasher-alert
state_topic: "homeconnect/dishwasher/state"
value_template: "{{value_json.InternalError|default('Off')}}"
payload_on: "On"
payload_off: "Off"
entity_category: diagnostic
device:
name: "Dishwasher"
identifiers: "dishwasher_SERIAL"
availability:
- topic: "homeconnect/dishwasher/LWT"
availability_mode: all
see: https://github.com/zibous/homeconnect-hcpy/blob/main/homeassistant/dishwasher.yaml
I started to play around with this before I discovered this issue: https://github.com/jamesremuscat/hcpy/tree/feature/ha-discovery
Currently generates discovery messages based on devices.json
. My next step will be to try and work out how to specify appropriate Home Assistant "component types" - right now everything's a generic sensor
, but for some things e.g. binary_sensor
might be better; likewise some things could use a specified device_class
.
https://www.home-assistant.io/integrations/mqtt/#discovery-messages we can create sensors directly in mqtt which the mqtt integration will automatically add to homeassistant.
Eg.