EnigmaIOT
0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
|
Home Assistant trigger integration. More...
#include "haEntity.h"
Go to the source code of this file.
Classes | |
class | HATrigger |
Enumerations | |
enum | ha_triggerType_t { button_short_press = 0, button_short_release = 1, button_long_press = 2, button_long_release = 3, button_double_press = 4, button_triple_press = 5, button_quadruple_press = 6, button_quintuple_press = 7 } |
enum | ha_triggerSubtype_t { turn_on = 0, turn_off = 1, button_1 = 2, button_2 = 3, button_3 = 4, button_4 = 5, button_5 = 6, button_6 = 7 } |
Variables | |
static const char * | ha_triggerTypeStr [] |
static const char * | ha_triggerSubtypeStr [] |
enum ha_triggerSubtype_t |
Enumerator | |
---|---|
turn_on | |
turn_off | |
button_1 | |
button_2 | |
button_3 | |
button_4 | |
button_5 | |
button_6 |
Definition at line 104 of file haTrigger.h.
enum ha_triggerType_t |
The mqtt device trigger platform uses an MQTT message payload to generate device trigger events. An MQTT device trigger is a better option than a binary sensor for buttons, remote controls etc.
MQTT device triggers are only supported through MQTT discovery, manual setup through configuration.yaml is not supported.
https://www.home-assistant.io/integrations/device_trigger.mqtt/
An example of trigger discovery message may be like this:
Topic: homeassistant/device-trigger/button_button_short_press_button_1/config
Payload:
{ "automation_type":"trigger", // string REQUIRED The type of automation, must be ‘trigger’ "topic":"EnigmaTest/button/data", // string REQUIRED The MQTT topic subscribed to receive trigger events "payload":"{\"button":1}", // string (optional) Optional payload to match the payload being sent over the topic "type":"button_short_press", // string REQUIRED The type of the trigger, e.g. button_short_press. // Entries supported by the frontend: button_short_press, button_short_release, button_long_press, button_long_release, // button_double_press, button_triple_press, button_quadruple_press, button_quintuple_press. // If set to an unsupported value, will render as subtype type, e.g. First button spammed with type set to spammed and subtype set to button_1 "subtype":"button_1", // string REQUIRED The subtype of the trigger, e.g. button_1. // Entries supported by the frontend: turn_on, turn_off, button_1, button_2, button_3, button_4, button_5, button_6. // If set to an unsupported value, will render as subtype type, e.g. left_button pressed with type set to button_short_press and subtype set to left_button "device":{ // Information about the device this device trigger is a part of to tie it into the device registry "name":"button", // string (optional) The name of the device "identifiers":"button" // list | string (optional) A list of IDs that uniquely identify the device. For example a serial number } }
Template message for switch is this
Topic: homeassistant/device-trigger/<node_name>_<type>_<subtype>/config
Payload
Message to gateway is like following
Enumerator | |
---|---|
button_short_press | |
button_short_release | |
button_long_press | |
button_long_release | |
button_double_press | |
button_triple_press | |
button_quadruple_press | |
button_quintuple_press |
Definition at line 82 of file haTrigger.h.
|
static |
Definition at line 115 of file haTrigger.h.
|
static |
Definition at line 93 of file haTrigger.h.