fake_entities: binary_sensor.true: True binary_sensor.false: False binary_sensor.off: 'off' binary_sensor.on: 'on' sensor.int17: 17 sensor.int170: 170 sensor.int200: 200 sensor.int3: 3 sensor.float10: 10.0 sensor.float5: 5.0 sensor.strNuit: 'Nuit' sensor.strHome: 'home' binary_sensor.nottrue: False constants: andtrap: False templates_library: T1: binary_sensor.true or binary_sensor.false T2: binary_sensor.on and binary_sensor.off == False T3: trigger_conditions: binary_sensor.off == False blocking_conditions: - binary_sensor.on T4: local_expressions: local_threshold: "binary_sensor.true ? 170 : 200" trigger_conditions: sensor.int170 == local_threshold tests: test_1: expected_result: Succeeded conditions: test_2: expected_result: Succeeded conditions: template_conditions: trigger_conditions: binary_sensor.true test_3: expected_result: Succeeded conditions: , test_4: expected_result: Failed conditions: template_conditions: , trigger_conditions: binary_sensor.true and binary_sensor.false # local_expressions in a template test_5_local_expr_in_template_true: expected_result: Succeeded conditions: template_conditions: # local_expressions declared directly in conditions block test_6_local_expr_inline_true: expected_result: Succeeded conditions: local_expressions: my_threshold: "binary_sensor.true ? 17 : 200" trigger_conditions: sensor.int17 == my_threshold # local_expressions inline, condition not met test_7_local_expr_inline_false: expected_result: Failed conditions: local_expressions: my_threshold: "binary_sensor.false ? 17 : 200" trigger_conditions: sensor.int17 == my_threshold