Totally right, I was hesitant posting it to start with for this very same reason, but I thought let me get something out there for now.
I had to right my wrong so I’m posting a new one which follows the official way of doing things and it’s pretty much what Panopilian posted in the original post.
Zigbee2MQTT - Tuya 4-Button Switch (MQTT Device Trigger) - rdeangel
SROLL UP
TO IMPORT BLUEPRINT
I suggest anyone using my last automation to use this one instead
This one uses the MQTT device trigger instead and will only trigger for manually defined device mqtt actions, which is much better.
What I dislike about this one is the manual definition of all the triggers (very long) but there is no way around that (from what I can tell) as the triggers are loaded when the blueprints loads (not when the automation loads) so they need to be manually defined within the blueprint (at least for now).
What I still couldn’t resolve, is to efficiently allow for multiple devices of the same type to be controlled by a single automation.
For this purpose I’m reposting the same automation I originally posted before with multiple inputs (which again has the issue of getting triggered with any mqtt device actions). You can use it if you don’t mind the trigger happy behaviour.
PLEASE DON’T USE THIS ONE IF YOU JUST NEED THE AUTOMATION TO BE TRIGGERED BY A SINGLE DEVICE, USE THE ONE ABOVE:
Zigbee2MQTT - Tuya 4-Button Switch (MQTT Subscribe Any - Filters Multiple Devices)
SROLL UP
TO IMPORT BLUEPRINT
I’ll also update the links at the top of the post in a minute.
FYI, these new blueprints have a different filename, but instead of redifining your automations manually (which get wiped when you switch the blueprint in your automation) you can just import the blueprint, then go to your automation, click edit yaml at the top right and change:
use_blueprint:
path: rdeangel/zigbee2mqtt-tuya-4-button-scene-switch-ts0044-rdeangel-mod.yaml
to
use_blueprint:
path: rdeangel/zigbee2mqtt-tuya-4-button-switch-mqtt-device-trigger_rdeangel.yaml
and save.