You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/use/ble.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,13 @@ If you want to change this characteristic:
133
133
With Home Assistant, this command is directly avalaible through MQTT auto discovery as a switch into the HASS OpenMQTTGateway device entities list.
134
134
:::
135
135
136
+
## Setting if the gateway publish into Home Assistant Home presence topic
137
+
138
+
If you want to publish to Home Assistant presence topic, you can activate this function by the HASS interface (this command is auto discovered), [here is a yaml example](../integrate/home_assistant.md#mqtt-room-presence).
if (advertisedDevice->haveRSSI() && !publishOnlySensors) {
575
-
haRoomPresence(BLEdata); // this device has an rssi and we don't want only sensors so in consequence we can use it for home assistant room presence component
576
+
if (advertisedDevice->haveRSSI() && !publishOnlySensors && hassPresence) {
577
+
hass_presence(BLEdata); // this device has an rssi and we don't want only sensors so in consequence we can use it for home assistant room presence component
576
578
}
577
-
# endif
578
579
if (advertisedDevice->haveServiceData()) {
579
580
int serviceDataCount = advertisedDevice->getServiceDataCount();
580
581
Log.trace(F("Get services data number: %d" CR), serviceDataCount);
@@ -966,10 +967,8 @@ bool BTtoMQTT() {
966
967
returnfalse; //if we have at least one white mac and this mac is not white we go out
967
968
968
969
BLEdata.set("rssi", (int)rssi);
969
-
# ifdef subjectHomePresence
970
-
if (!publishOnlySensors)
971
-
haRoomPresence(BLEdata); // this device has an rssi and we don't want only sensors so in consequence we can use it for home assistant room presence component
972
-
# endif
970
+
if (!publishOnlySensors && hassPresence)
971
+
hass_presence(BLEdata); // this device has an rssi and we don't want only sensors so in consequence we can use it for home assistant room presence component
// if not commented Home presence integration with HOME ASSISTANT is activated
114
117
#definesubjectHomePresence "home_presence/" // will send Home Assistant room presence message to this topic (first part is same for all rooms, second is room name)
0 commit comments