I'm at my wits' end. I want to dynamically set a color in hex format (e.g., ‘#167099’) as the background color of a template. I've tried all the available examples—without success.
Also on the page linked to by @E1cid above, pay attention to this part:
Important Note: On first load, msg.payload may be null or undefined, and trying to access a nested property will throw an error. Using the optional chaining (?.) operator, e.g. msg.payload?.nested?.property will prevent these errors occurring