diff --git a/tasmota/deviceplugintasmota.cpp b/tasmota/deviceplugintasmota.cpp index f2b1444f..53154c59 100644 --- a/tasmota/deviceplugintasmota.cpp +++ b/tasmota/deviceplugintasmota.cpp @@ -299,6 +299,10 @@ void DevicePluginTasmota::onPublishReceived(MqttChannel *channel, const QString if (m_powerStateTypeMap.contains(child->deviceClassId())) { child->setStateValue(m_powerStateTypeMap.value(child->deviceClassId()), payload == "ON"); } + if (child->deviceClassId() == tasmotaSwitchDeviceClassId) { + Event event(tasmotaSwitchPressedEventTypeId, child->id()); + emit emitEvent(event); + } } } if (topic.startsWith(channel->topicPrefix() + "/sonoff/STATE")) { diff --git a/tasmota/deviceplugintasmota.json b/tasmota/deviceplugintasmota.json index 776132f7..5fd77a56 100644 --- a/tasmota/deviceplugintasmota.json +++ b/tasmota/deviceplugintasmota.json @@ -176,6 +176,13 @@ "defaultValue": false, "writable": true } + ], + "eventTypes": [ + { + "id": "1be4d6a1-475e-43bb-a47c-9063e279e78d", + "name": "pressed", + "displayName": "Pressed" + } ] }, {