|
EnigmaIOT
0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
|
Go to the documentation of this file.
9 #ifndef _BINARY_SENSOR_h
10 #define _BINARY_SENSOR_h
14 #if SUPPORT_HA_DISCOVERY
91 capacity = JSON_OBJECT_SIZE (10) + 250;
164 static size_t getDiscoveryJson (
char* buffer,
size_t buflen,
const char* nodeName,
const char* networkName, DynamicJsonDocument* inputJSON);
186 #endif // SUPPORT_HA_DISCOVERY
188 #endif // _BINARY_SENSOR_h
DynamicJsonDocument * entityConfig
JSON object to be sent to gateway.
Defines an entity for Home Assistant autodiscovery.
static String deviceClassStr(haBinarySensorClass_t sensorClass)
Gets binary sensor class name from haBinarySensorClass_t https://www.home-assistant....
size_t capacity
JSON object memory reservation length.
void setValueField(const char *payload)
Defines a template that returns a string to be compared to payload_on/payload_off or an empty string,...
void setValueTemplate(const char *payload)
Defines a template that defines binary sensor value. When setting this you should not call setValueFi...
constexpr auto ha_expiration
static size_t getDiscoveryJson(char *buffer, size_t buflen, const char *nodeName, const char *networkName, DynamicJsonDocument *inputJSON)
Allows Gateway to get Home Assistant discovery message using Binary Sensor template.
void setPayloadOff(const char *payload)
Defines the string that represents the off state. It will be compared to the message in the state_top...
constexpr auto ha_device_type
void addExpiration(uint seconds)
Defines the number of seconds after the sensor’s state expires, if it’s not updated....
haDeviceType_t deviceType
HomeAssistant entity device type.
void setPayloadOn(const char *payload)
Defines the string that represents the on state. It will be compared to the message in the state_topi...
void setOffDelay(uint payload)
For sensors that only send on state updates (like PIRs), this sets a delay in seconds after which the...
HABinarySensor()
Binary sensor constructor.
void setDeviceClass(haBinarySensorClass_t devClass)
Define binary sensor class as haBinarySensorClass_t