HATagScanner class

class HATagScanner : public HABaseDeviceType

HATagScanner allow to produce scan events that can be used in the HA automation.

Note

You can find more information about this entity in the Home Assistant documentation: https://www.home-assistant.io/integrations/tag.mqtt/

Public Functions

HATagScanner(const char *uniqueId)
Parameters

uniqueId – The unique ID of the scanner. It needs to be unique in a scope of your device.

bool tagScanned(const char *tag)

Sends “tag scanned” event to the MQTT (Home Assistant). Based on this event HA may perform user-defined automation.

Parameters

tag – Value of the scanned tag.

Returns

Returns true if MQTT message has been published successfully.

Protected Functions

virtual void buildSerializer() override
virtual void onMqttConnected() override