Is this the example that you are refering to?
sensor:
- platform: template
sensors:
my_sensor:
availability_template: >-
{%- if not is_state("switch.some_sensor", "unavailable") %}
true
{%- endif %}
Where should i put my value_template?