Input_boolean into binary sensor template as motion sensor

I have Zigbee motion detectors in the house, but if my kids or wife are watching TV they move so little that the motion detectors miss them. So I’m trying to add the TV as a binary sensor motion detector, that when it’s on it’s considered motion.

The motion detectors work fine and I’ve added them in a group. I have an input_boolean that is on or off depending on whether the TV is on or off, but I can’t seem to get the right configuration in the template binary sensor to get the binary sensor to change depending on the input_boolean. The binary sensor stays off, whatever the state of the TV / input_boolean is.

I followed the configuration from this topic, but that doesn’t seem to work: Is it possible to include an input_boolean in a binary_sensor group? - #6 by Didgeridrew

The template options are:
state: “{{ is_state(‘input_boolean.lg_tv_power_state’, ‘On’) }}”

What am I getting wrong? Thanks a lot!

Change this:

state: "{{ is_state('input_boolean.lg_tv_power_state', 'On') }}"

to this:

{{ is_state('input_boolean.lg_tv_power_state', 'on') }}

The State Template field is meant to contain the template and nothing else. You supplied it with a fragment of a YAML configuration by including a state: key. In addition, you used On but an Input Boolean’s state value is actually lowercase on. Only the UI displays it in titlecase.

FWIW, you’re not the first person to make this mistake. It’s ironic that the Template Helper was created in order to allow users to create a Template Sensor without using YAML, yet users continue to enter YAML into the State Template field.