How to combine into or statement?

Id like this combined into an or statement if possible?

      family_room_occupied_both:
        friendly_name: "living room"
        value_template: >-
          {% if is_state('sensor.davids_apple_watch_room_presence', 'livingroom2')
          or is_state('sensor.davids_apple_watch_room_presence', 'livingroom2') %}
          true
          {% else %}
          false
          {% endif %}

i think i had the wrong sensor, basically if theres motion or presense from either motion sensor (its on), the room is occupied

I don’t understand the question. The template already ORs the two state tests. The fact that the two test are the same makes it pointless though. :thinking:

Also there’s no need to use an if/else. This will resolve to true or false:

        value_template: >
          {{ is_state('sensor.davids_apple_watch_room_presence', 'livingroom2') 
          or is_state('sensor.davids_apple_watch_room_presence', 'some_oter_place') }}

Invalid config for [binary_sensor.template]: invalid template (TemplateSyntaxError: unexpected ‘%’) for dictionary value @ data[‘sensors’][‘family_room_occupied_both’][‘value_template’]. Got “{{% is_state(‘binary_sensor.family_room_occupied’, ‘on’) or is_state(‘binary_sensor.family_room_occupied2’, ‘on’) }}”. (See ?, line ?).

doesnt work :frowning:

You didn’t copy it correctly. Look at it again.

you have an extra % in there. Like the error tells you.