Hi I am trying to figure out how to setup a binary sensor to evaluate multiple states and one state attribute of the same sensor. I am using the “next holiday” integration from HACS. This integration provides a sensor that list the next major holiday as the state. It also has a state attribute that lists if that next holiday is today. If it is today that state attribute says “true”. Below is the yaml I wrote. If I don’t include the last line with the “is_state_attr” the sensors works as expected. When I add that line I get an error in the logs that says
invalid config for 'template' at configuration.yaml, line 125: required key 'state' not provided Invalid config for 'template' at configuration.yaml, line 126: 'value_template' is an invalid option for 'template', check: binary_sensor->0->value_template
obvisouly I have set something up incorrectly. Any help would be appreciated.
Template:
- binary_sensor:
- name: Xcel Holiday
state: >
{{ is_state('sensor.next_holiday', 'New Year's Day')
or is_state('sensor.next_holiday', 'Good Friday')
or is_state('sensor.next_holiday', 'Memorial Day')
or is_state('sensor.next_holiday', 'Independence Day')
or is_state('sensor.next_holiday', 'Labor Day')
or is_state('sensor.next_holiday', 'Thanksgiving')
or is_state('sensor.next_holiday', 'Christmas Day')
or is_state('sensor.next_holiday', 'Washington's Birthday')
and is_state_attr('sensor.next_holiday', 'Today is holiday', true) }}