diff --git a/contrib/etc/ebusd/mqtt-hassio.cfg b/contrib/etc/ebusd/mqtt-hassio.cfg index af97d40bb..824e9df96 100644 --- a/contrib/etc/ebusd/mqtt-hassio.cfg +++ b/contrib/etc/ebusd/mqtt-hassio.cfg @@ -355,14 +355,14 @@ def_global_updatecheck-payload = %global_prefix, } -# optional secondary update check for the eBUS device (consuming the same topic though!) +# optional secondary update check for the enhanced eBUS device (consuming the same topic though!) def_global_updatecheck_device-topic = %haprefix/update/%{TOPIC}_device/config def_global_updatecheck_device-payload = { "unique_id":"%{TOPIC}_device", "device":{ "identifiers":"%{PREFIXN}_device", "manufacturer":"ebusd.eu", - "name":"%prefixn device", + "name":"%prefixn eBUS device", "via_device":"%PREFIXN", "suggested_area":"%area" }, diff --git a/contrib/etc/ebusd/mqtt-integration.cfg b/contrib/etc/ebusd/mqtt-integration.cfg index ecbf52c1a..d07e3d4e6 100644 --- a/contrib/etc/ebusd/mqtt-integration.cfg +++ b/contrib/etc/ebusd/mqtt-integration.cfg @@ -178,8 +178,8 @@ def_global-payload = { #def_global-retain = 0 # individual global running, version, signal, uptime, updatecheck, and scan config topic, payload, and retain setting. -# a secondary update check for the eBUS device (consuming the same updatecheck topic) can be set up additionally, which -# does not use the common global defaults. +# a secondary update check for the eBUS device (consuming the same updatecheck topic) can be set up, which will only be +# used if an enhanced eBUS device supporting extra info is present (does not make use of the common global defaults). #def_global_running-... #def_global_version-... #def_global_signal-... diff --git a/src/ebusd/bushandler.h b/src/ebusd/bushandler.h index 58441d9c1..e9a9e7d31 100755 --- a/src/ebusd/bushandler.h +++ b/src/ebusd/bushandler.h @@ -423,6 +423,11 @@ class BusHandler : public WaitThread { } } + /** + * @return the @a Device instance for accessing the bus. + */ + const Device* getDevice() const { return m_device; } + /** * Clear stored values (e.g. scan results). */ diff --git a/src/ebusd/mqtthandler.cpp b/src/ebusd/mqtthandler.cpp index d8a5f7b57..cdd0baa81 100755 --- a/src/ebusd/mqtthandler.cpp +++ b/src/ebusd/mqtthandler.cpp @@ -952,8 +952,10 @@ void MqttHandler::run() { publishDefinition(m_replacers, "def_global_uptime-", uptimeTopic, "global", "uptime", "def_global-"); publishDefinition(m_replacers, "def_global_updatecheck-", m_globalTopic.get("", "updatecheck"), "global", "updatecheck", "def_global-"); - publishDefinition(m_replacers, "def_global_updatecheck_device-", m_globalTopic.get("", "updatecheck"), "global", - "updatecheck_device", ""); + if (m_busHandler->getDevice()->supportsEnhancedInfos()) { + publishDefinition(m_replacers, "def_global_updatecheck_device-", m_globalTopic.get("", "updatecheck"), + "global", "updatecheck_device", ""); + } publishDefinition(m_replacers, "def_global_scan-", m_globalTopic.get("", "scan"), "global", "scan", "def_global-"); } diff --git a/src/lib/ebus/device.h b/src/lib/ebus/device.h index ff97472db..f28ec09b5 100755 --- a/src/lib/ebus/device.h +++ b/src/lib/ebus/device.h @@ -205,6 +205,11 @@ class Device { */ bool isEnhancedProto() const { return m_enhancedProto; } + /** + * @return whether the device supports the ebusd enhanced protocol and supports querying extra infos. + */ + bool supportsEnhancedInfos() const { return m_enhancedProto && m_extraFatures & 0x01; } + /** * Set the @a DeviceListener. * @param listener the @a DeviceListener.