The payload you are feeding into the template in the flow you posted is a number. You have not shown what you fed in from your sensor, but i suspect it's an object.
Below is an example of feeding a number and a object. You will see the object produces the [object Object] output in the template..
In the last inject i feed an object but i move the value of the object to the global context, not the object.
Have a play, hope it helps.
[{"id":"1cb3fdc4.19e5ba","type":"inject","z":"5a245aa1.510164","name":"simulate http in","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":3980,"wires":[["57b1ecda.eed20c"]]},{"id":"57b1ecda.eed20c","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"replace","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":3980,"wires":[["3c861534.f6423a"]]},{"id":"3c861534.f6423a","type":"template","z":"5a245aa1.510164","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<div>This is the payload: {{payload}} !</div>","output":"str","x":490,"y":3980,"wires":[["5b5812de.71eeec"]]},{"id":"5b5812de.71eeec","type":"debug","z":"5a245aa1.510164","name":"http response","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":3980,"wires":[]},{"id":"fe41594e.17c69","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"test\":8}","payloadType":"json","x":160,"y":4100,"wires":[["7e6931c8.e12188"]]},{"id":"a2d27855.3db768","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"8","payloadType":"num","x":150,"y":4060,"wires":[["7e6931c8.e12188"]]},{"id":"587e85ed.13e8ec","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"test\":8}","payloadType":"json","x":160,"y":4160,"wires":[["51fab315.562834"]]},{"id":"51fab315.562834","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"replace","pt":"global","to":"payload.test","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":4160,"wires":[[]]},{"id":"7e6931c8.e12188","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"replace","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":4080,"wires":[[]]}]
You could also target the the value of the object in the template.
eg.
[{"id":"1cb3fdc4.19e5ba","type":"inject","z":"5a245aa1.510164","name":"simulate http in","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":3980,"wires":[["57b1ecda.eed20c"]]},{"id":"57b1ecda.eed20c","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"replace","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":3980,"wires":[["3c861534.f6423a","9099db5.f466ba8"]]},{"id":"9099db5.f466ba8","type":"template","z":"5a245aa1.510164","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<div>This is the payload: {{payload.test}} !</div>","output":"str","x":490,"y":4020,"wires":[["1c1cec2.087e614"]]},{"id":"1c1cec2.087e614","type":"debug","z":"5a245aa1.510164","name":"http response target payload.test","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":750,"y":4020,"wires":[]},{"id":"fe41594e.17c69","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"test\":8}","payloadType":"json","x":160,"y":4100,"wires":[["7e6931c8.e12188"]]},{"id":"7e6931c8.e12188","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"replace","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":4080,"wires":[[]]}]