{% extends "base.html" %} {% block title %}{{ board.name }} – Sonoff Gateway{% endblock %} {% block content %}
{# ── Page header ──────────────────────────────────────────────────── #}

{{ board.name }}

Sonoff eWeLink Gateway {% if board.is_online %} Online {% else %} Offline {% endif %}
{% if current_user.is_admin() %}
eWeLink Settings {% endif %}
{# ── Flash messages ───────────────────────────────────────────────── #} {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for cat, msg in messages %} {% endfor %} {% endif %} {% endwith %} {# ── No credentials warning ───────────────────────────────────────── #} {% if not has_credentials %} {% endif %} {# ── Device grid ──────────────────────────────────────────────────── #} {% if devices %}
{% for dev in devices %}
{# Kind icon #} {% set kind_icon = { 'switch': 'bi-toggles', 'light': 'bi-lightbulb-fill', 'fan': 'bi-fan', 'sensor': 'bi-thermometer-half', 'remote': 'bi-broadcast', 'cover': 'bi-door-open' }.get(dev.kind, 'bi-plug') %} {{ dev.name or dev.device_id }}
{% if dev.is_online %} Online {% else %} Offline {% endif %}
{{ dev.device_label }} {% if dev.firmware %}v{{ dev.firmware }}{% endif %}
{# ── Switch/relay device ────────────────────────────────────── #} {% if dev.kind in ('switch', 'light', 'fan') and dev.num_channels > 0 %}
{% for ch in dev.all_channel_states() %} {% set ch_on = ch.state %}
{{ ch.label }}
{% endfor %}
{# ── Sensor device ──────────────────────────────────────────── #} {% elif dev.kind == 'sensor' %}
{% if dev.temperature is not none %}
{{ dev.temperature }}°C
Temperature
{% endif %} {% if dev.humidity is not none %}
{{ dev.humidity }}%
Humidity
{% endif %}
{# ── Power meter ────────────────────────────────────────────── #} {% if dev.has_power_meter %}
{% if dev.power is not none %}
{{ dev.power }}W
Power
{% endif %} {% if dev.voltage is not none %}
{{ dev.voltage }}V
Voltage
{% endif %} {% if dev.current is not none %}
{{ dev.current }}A
Current
{% endif %}
{% endif %} {# ── RF Bridge / Remote ─────────────────────────────────────── #} {% elif dev.kind == 'remote' %}
RF Bridge – cloud only
{% endif %}
ID: {{ dev.device_id }} {% if dev.ip_address %}  ·  {{ dev.ip_address }} {% endif %}
{% endfor %}
{% else %}

No devices found.

{% if has_credentials %}
{% else %} Configure eWeLink Account {% endif %}
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}