I’ll prefix this post by saying I’m new to HA (coming from Homeseer) and I’m running hassos as a VM on proxmox. I have a dedicated mosquitto broker that is all working.
I have a sprinkler application that sends status updates (ON/OFF) to an mqtt topic. I also have a Paradox alarm panel using the PAI integration (which supports HA discovery).
My questions:
Can I mix and match discovery vs manual configuration? (manual for the sprinklers, auto for the alarm)
Is there a way to write a “template” for the sprinklers to find all the topics and create entities for them automatically or do I need to manually add each device & associated state topic as a YAML entry in a file?
Not with unknown topics. You can build code based off a known topic structure and force discovery at startup but you need to follow the discovery protocols.
Mixing discovery vs manual follow up: Can I override a discovered device - for example all of discovered alarm zones are marked with device_class = “motion” but some are door contacts, but it seems if I change this using the GUI (Configuration/Customisations) they are reset to the discovered values.
EDIT: I think I was just missing the customize: !include customize.yaml line in my config.
2nd EDIT - Nope - even including the customize.yaml seems to have no effect
You can build code based off a known topic structure and force discovery at startup but you need to follow the discovery protocols.
I know a topic structure, so this may be possible, can you point me to a starting point to code my own discovery please?
You can define an MQTT Sensor (or MQTT Switch, Light, Lock, cover, etc) in YAML or you can create a script to define it via MQTT Discovery.
I provided someone else with an example here:
The script can also be used to override a discovered device. However, you must override all of the discovered device’s configuration and not just one part of it (i.e. you can’t just override its device_class alone).
MQTT Discovery is nothing more than Home Assistant subscribing to all topics beginning with homeassistant. A new entity will be created if the topic is in the correct format, namely something like this:
homeassistant/sensor/hallway_motion/config
and if it contains a payload that is also in the correct format. The format of the topic and payload are described here: