Dashboard Template script with msg.payload

This has some worked examples: