Toggle switch initial value?

I've got a toggle switch which triggers a MQTT node to control a heater, it works fine but the initial value is always shown as OFF even if the heater is ON.

I'm feeding the msg.payload value of "ON" into the toggle switch and I've tried using an input value of both msg.payload and {{msg.payload}} but it doesn't appear to make any difference.

Hope someone can help, it's probably something very obvious I am missing.

Node code:
[{"id":"9a574584.75e57","type":"ui_switch","z":"212aea8.56fb016","name":"","label":"Toggle upstairs heater","tooltip":"","group":"249cb4f3.de0cdc","order":4,"width":4,"height":1,"passthru":false,"decouple":"false","topic":"cmnd/sonoff_garage_upstairs/power","style":"","onvalue":"On","onvalueType":"str","onicon":"","oncolor":"","offvalue":"Off","offvalueType":"str","officon":"","offcolor":"","x":620,"y":548,"wires":[["e5e9f696.80fbc","f024e819.9aea68"]],"inputLabels":["msg.payload"]},{"id":"249cb4f3.de0cdc","type":"ui_group","z":"","name":"Garage","tab":"e47a88e5.385c7","order":2,"disp":true,"width":"8","collapse":false},{"id":"e47a88e5.385c7","type":"ui_tab","z":"","name":"Main","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

The input must exactly match the output... - you have set the output to "On" , but said you are sending msg.payload of "ON"

I changed everything to uppercase and debug shows all uppercase but still the switch initially shows off when the heater is ON, I've got a text node which shows the correct state (in uppercase as well)

If it helps under the node it shows lowercase on or off which doesn't match with the debug

You need to select thsi to allow messages through....

Alternatively, if you don't want to pass the message through (which can create an mqtt loop) but want the switch to show the current MQTT state then leave Pass Through clear and select Show State of Input.

When I did "show state of input" the toggle switch didn't work, however the other solution worked fine so problem solved.

Thanks to both you and dceejay