Macro problem

Please format the YAML in posts as described here. Please post the YAML for your template sensor.