I am using the MQTT publishing action to control a digital picture frame and that works just fine. For a date based image smart list, I now want to send the current date in “YYYY:MM.DD” format as payload.
Is this done via templating or is there an easier way? Thanks!
Thanks Taras, that exactly looks like what it would need!
However, when I paste the action code into YAML of a script, I get the error message “Message malformed: extra keys not allowed @ data[‘sequence’][0][‘action’]”.
The example I provided was intended for use in an automation. You are creating a script. Scripts don’t use the action keyword and so that’s why the error message reports “extra keys not allowed”. Remove the entire line containing action: from your script.
You should know that I never use the Script Editor and prefer to create automations and scripts using a text editor. If I remember correctly, the Automation Editor does not support templates so, perhaps, neither does the Script Editor.
Only thing I can suggest is that you try variations like these and if it still fails then it may be due to the Script Editor’s lack of support for templates (perhaps someone else can comment on my assumption).
You’re welcome! Glad to hear one of those was acceptable to the Script Editor (I learned something new).
To help other users (who may have a similar question) find the answer, please mark my first post (containing the template) with the Solution tag. Only you, the author of this topic, can do that. It will automatically place a check-mark next to the topic’s title. It signals to other users that this topic has an accepted solution.