I’m attempting to create a generic binary switch blueprint based on sensor value.
It’s my first go at this and I’m struggling
Input appreciated on obvious faults.
I want to retrieve an attribute from the sensor called “price_level” but I’m clearly not understanding the syntax
error:
Invalid blueprint: Only one type can be specified. Found entity, target_light for dictionary value @ data['bl
blueprint:
name: Binary switch based on electricity price
description: Toggle an object ON/OFF depending on Tibbers Price levels
domain: automation
input:
sensor:
name: PriceSensor
description: This sensor will be used
selector:
entity:
domain: sensor
# Grab sensor with current price
target_light:
name: Lights
description: Object to toggle with Price Sensor
selector:
entity:
domain: light
#
trigger:
- platform: state
entity_id: !input PriceSensor
#
action:
- service: >
{% if trigger.to_state.state == "EXPENSIVE" OR "VERY_EXPENSIVE %}
light.turn_off
{% else %}
light.turn_on
{% endif %}
# If price is EXPENSIVE or VERY_EXPENSIVE - then toggle off.
# If price is NORMAL, CHEAP or VERY_CHEAP then toggle on
#
target: !input target_light