I may be daydreaming here, but I'm wondering if there's a way to dynamically send a command RESTART 1 to either all topics, or all sub-topics within a topic.
background info: I have dozens of tasmota devices around my house from outlets to relays to switches to bulbs. some of the switches are dimmer switches which I'm running older tasmota firmware with custom scripting on to manage/control the touch slider and LED arrays. I'm not the original writer of these scripts and I can't get them to work on newer versions of tasmota, so I'm kind of hamstrung here. these devices occasionally "lock up" and stop responding to physical interaction or HK/HB/tasmota control so I have to either load their HTTP interface or send MQTT restart commands.
These devices are few on my network and I could easily write a flow to reboot the four of them every night, but I'd like to do a system wide reboot. Since I'm regularly adding devices and sometimes removing/renaming devices, a manually programmed or static list of devices isn't ideal.
I'm confident that a script on my MQTT server could manage this, but ssh'ing into my server to manage it and having no real visibility into it isn't ideal either. I could script the individual devices with their own restart logic, but there's a comparable level of blindness and a comparable lack of control there.
determined to complete this within nodered, I'm thinking my options are:
- discover a way to make it work with wildcards, for instance: "cmnd/lighting/*/RESTART 1" I can't get this to work, and I don't think it would reasonably allow me to exclude any devices. there aren't any devices I want to exclude, but I like to think about the future.
- (learn how to) Write a function to get all subscribed topics, parse them, and generate restart commands from said list. This feels the most robust and future proof of all options.
Thanks in advance for any insight/guidance here. I'm admittedly pretty amateur with both nodered and MQTT.