RPi Web Server - ESP8266 MQTT

{% for pin in pins %}

{{ pins[pin].name }} {% if pins[pin].state == 'True' %} is currently on

Turn off
{% else %} is currently off
Turn on
{% endif %} {% endfor %}