Value template with if confition

Hi,

I am trying to use json value in if condition as below but its not working I am getting “offline” all the time:

  value_template: >- 
            {% if value_json.list[0]['isOnline'] is equalto '1' %}
            Online
            {% else %}Offline
            {% endif %}