I tried, but both HA en Domoticz give me errors if i don't specify a command topic.
Do you have a sample discovery message?
Moderator: leecollings
I tried, but both HA en Domoticz give me errors if i don't specify a command topic.
The cmd topic is mandatory for non sensor devices. You can set it with a dummy value if not used.
Code: Select all
topic_config : `<autodiscovery prefix>/sensor/.../config`
payload_config :
{
"~": `<update prefix>/../..`,
"name": `<name in domoticz>`,
"device_class": "power_factor",
"unit_of_measurement": "%",
"stat_t": "~/state",
"unique_id": `<unique id>`
}
Code: Select all
"value_template": "{{ value_json.value }}"
that's clear, but i responded to your statement here:mgugu wrote: ↑Saturday 04 February 2023 13:09The cmd topic is mandatory for non sensor devices. You can set it with a dummy value if not used.
For pure sensor, appearaing in domoticz utilities, I use that:I your case you may need a value template directive:Code: Select all
topic_config : `<autodiscovery prefix>/sensor/.../config` payload_config : { "~": `<update prefix>/../..`, "name": `<name in domoticz>`, "device_class": "power_factor", "unit_of_measurement": "%", "stat_t": "~/state", "unique_id": `<unique id>` }
You can put other unit_of_measurement.Code: Select all
"value_template": "{{ value_json.value }}"
Many other device classes are available in HA but not all are implemented in domoticz.
so what's the discovery message for that one? the goal is to have a sensor without unit of measurement.
Hi! Interesting. Seems that I have the same problem: the need of configuring all devices again after startup the raspberry. Did you find a clean solution for this? Looking forward for your findings! Grtz Martinakamming wrote: ↑Tuesday 06 December 2022 20:34The ha docs specifically State not to use retained mesaages for this Reason. Any other suggestions?
UPDATE: The HA docs seem to contradict themselves. Now also found this link: , statingwhere i read somewhere else this is bad practive (if you delete a device it will be rediscovered). Anyway not happy with it.Retain: The -r switch is added to retain the configuration topic in the broker. Without this, the sensor will not be available after Home Assistant restarts.
I will do some testing, see what works better: Retained messages or periodically publishing the discovery messages.
i did not find a clean solutions.mcipjvw wrote: ↑Friday 26 May 2023 16:43Hi! Interesting. Seems that I have the same problem: the need of configuring all devices again after startup the raspberry. Did you find a clean solution for this? Looking forward for your findings! Grtz Martinakamming wrote: ↑Tuesday 06 December 2022 20:34The ha docs specifically State not to use retained mesaages for this Reason. Any other suggestions?
UPDATE: The HA docs seem to contradict themselves. Now also found this link: , statingwhere i read somewhere else this is bad practive (if you delete a device it will be rediscovered). Anyway not happy with it.Retain: The -r switch is added to retain the configuration topic in the broker. Without this, the sensor will not be available after Home Assistant restarts.
I will do some testing, see what works better: Retained messages or periodically publishing the discovery messages.
Users browsing this forum: No registered users and 1 guest