OpenBK7231T_App icon indicating copy to clipboard operation
OpenBK7231T_App copied to clipboard

Add Button click(s) into HA's MQTT Device trigger using in Automation

Open ptiFisher0 opened this issue 1 year ago • 3 comments

New feature Add Button clicks into Home Assistant's MQTT Device trigger so that they can be used in Automation.

It should work same like if you put "SetOption73 1" in Tasmota, it will send all button clicks to HA (MQTT). Using HA's MQTT Device trigger which is a part of the HA's auto discovery, we can create triggers into the Automation UI. After using that we can select triggers like ("Second button" double clicked) or ("Second button" continuously pressed) inside Automation UI.

I tested this and it works great in my use. (tested with 3-Gang Touch Wall Switch and Mini Smart Switch) I put my sample code in GitHub branch. It will set this action now only into pins with role IOR_Button_ScriptOnly.

ptiFisher0 avatar Feb 08 '24 23:02 ptiFisher0

From a brief glance it looks very cool. I think you can open a Pull Request.

I am just wondering whether we need a flag to control MQTT button discovery, because, maybe not everyone wansts them discovered? But I can;'t think of any possible scenario where somebody may not want that button discovered, so let's go without a flag for now.

openshwprojects avatar Feb 09 '24 13:02 openshwprojects

Good, for me this is very nice adds. And I really, really like this project :) PR #1072

ptiFisher0 avatar Feb 09 '24 22:02 ptiFisher0

PR is updated now. I fix merge issue and made some other fix and adds too.

ptiFisher0 avatar Feb 14 '24 22:02 ptiFisher0