Turn on Boiler Automation

Hi, please, please help. I am trying to turn on my boiler when the temperature in a room is below the set temperature. I’ve got the following code, which seems to make sense to me, but its giving an error in config. I’m at a loss. If it helps I’m using the Max Cube turned in to a CUN.

alias: 'Living Room Boiler On'
trigger:
  platform: template
  value_template: {{states.climate.neq1577639.attributes.set_temperature < states.climate.neq1577639.attributes.current_temperature}}
action:
  service: switch.turn_on
  entity_id: switch.horstmann_secure_meters_asr_zw_thermostat_receiver_switch

Put double quotes around the template.

Thank you for your help. Did you just mean the word template like below? Still saying config error - all my other automations are working and I’m using same indentation.

alias: 'Living Room Boiler On'
trigger:
  platform: "template"
  value_template: {{states.climate.neq1577639.attributes.set_temperature < states.climate.neq1577639.attributes.current_temperature}}
action:
  service: switch.turn_on
  entity_id: switch.horstmann_secure_meters_asr_zw_thermostat_receiver_switch

No, the template

value_template: "{{ your template }}" 

Theres no validation errors now so thank you - but does the code look right? I’ve adapted it slightly, and its not firing the boiler at all?

alias: 'Living Room Boiler On'
trigger:
  platform: time_pattern
  minutes: "/5"
condition:
  condition: template
  value_template: '{{states.climate.neq1577639.attributes.set_temperature > states.climate.neq1577639.attributes.current_temperature}}'
action:
  service: switch.turn_on
  entity_id: switch.horstmann_secure_meters_asr_zw_thermostat_receiver_switch

Looks right to me, have you tried the template in the template checker developer tool to make sure it’s giving you true/false at the right times?

You are comparing strings. Convert them to numbers.

value_template: '{{states.climate.neq1577639.attributes.set_temperature|float > states.climate.neq1577639.attributes.current_temperature|float}}'

Or better still (no errors if unavailable right after a restart):

value_template: "{{state_attr('climate.neq1577639', 'set_temperature')|float > state_attr('climate.neq1577639', 'current_temperature')|float}}"

See the warning here:

Thank you both, thats brilliant advice… I’ve found out my Zwave extender dies which meant the boiler wasnt connected to the network - so it was triggering, just not turning it on. Waiting for a new extender and will try then.

:slight_smile: