akamming wrote: Saturday 04 February 2023 10:47
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?
The 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:
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>`
}
I your case you may need a value template directive:
Code: Select all
"value_template": "{{ value_json.value }}"
You can put other unit_of_measurement.
Many other device classes are available in HA but not all are implemented in domoticz.