I’m having an issue getting this properly formatted.
Removed all the IR codes because they are giant
heat_pump_lounge_on:
sequence:
service: broadlink.send_packet_192_168_2_109
data_template:
packet: >
{% if is_state('input_boolean.heat_pump_lounge_cool', 'off') and is_state('sensor.heatpump_temp', '75') %}
- 'JgBMAnE1=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'off') and is_state('sensor.heatpump_temp', '19') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'off') and is_state('sensor.heatpump_temp', '20') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'off') and is_state('sensor.heatpump_temp', '21') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'off') and is_state('sensor.heatpump_temp', '22') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'off') and is_state('sensor.heatpump_temp', '23') -%}
- '=='
{%- elif is_state('inpu t_boolean.heat_pump_lounge_cool', 'off') and is_state('sensor.heatpump_temp', '24') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'off') and is_state('sensor.heatpump_temp', '25') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'on') and is_state('sensor.heatpump_temp', '19') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'on') and is_state('sensor.heatpump_temp', '20') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'on') and is_state('sensor.heatpump_temp', '21') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'on') and is_state('sensor.heatpump_temp', '22') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'on') and is_state('sensor.heatpump_temp', '23') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'on') and is_state('sensor.heatpump_temp', '24') -%}
- '=='
{%- elif is_state('input_boolean.heat_pump_lounge_cool', 'on') and is_state('sensor.heatpump_temp', '25') -%}
- '=='
{%- else -%}
- '=='
{%- endif -%}
The first ‘if’ statement is purely for formatting reasons.
If I run the above through the dev tool I get;
heat_pump_lounge_on:
sequence:
service: broadlink.send_packet_192_168_2_109
data_template:
packet: >
- '=='
I believe the ‘>’ is causing the data to not be accepted.
For example this script will fire fine, it has no template data;
heat_pump_lounge_off:
sequence:
- service: broadlink.send_packet_192_168_2_109
data:
packet:
- 'blah'
Any help appreciated,
Cheers.