{% extends "base.html" %} {% block title %}{{ device.name or device.device_id }} – Sonoff Device{% endblock %} {% block content %}
{# breadcrumb #} {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for cat, msg in messages %} {% endfor %} {% endif %} {% endwith %} {# ── Device header card ───────────────────────────────────────────── #}

{% 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(device.kind, 'bi-plug') %} {{ device.name or device.device_id }}

{{ device.device_label }} {% if device.firmware %}  ·  v{{ device.firmware }}{% endif %} {% if device.model %}  ·  {{ device.model }}{% endif %}
{% if device.is_online %} Online {% else %} Offline {% endif %}
{# Rename form #} {% if current_user.is_admin() %}
{% endif %}
{# ── Channel controls ─────────────────────────────────────────────── #} {% if device.kind in ('switch', 'light', 'fan') and device.num_channels > 0 %}
Channels
{% for ch in device.all_channel_states() %} {% set ch_on = ch.state %}
{{ ch.label }}
{% endfor %}
{% endif %} {# ── Sensor readings ──────────────────────────────────────────────── #} {% if device.temperature is not none or device.humidity is not none or device.power is not none %}
Sensor Readings
{% if device.temperature is not none %}
{{ device.temperature }}°C
Temperature
{% endif %} {% if device.humidity is not none %}
{{ device.humidity }}%
Humidity
{% endif %} {% if device.power is not none %}
{{ device.power }}W
Power
{% endif %} {% if device.voltage is not none %}
{{ device.voltage }}V
Voltage
{% endif %} {% if device.current is not none %}
{{ device.current }}A
Current
{% endif %}
{% endif %} {# ── Device info ──────────────────────────────────────────────────── #}
Device Info
{% if device.firmware %} {% endif %} {% if device.last_seen %} {% endif %}
Device ID{{ device.device_id }}
UIID{{ device.uiid }} ({{ device.device_label }})
Type{{ device.kind }}
Channels{{ device.num_channels }}
Firmware{{ device.firmware }}
LAN IP {{ device.ip_address or 'Not detected'|safe }}
Connection {% if device.ip_address %} LAN available {% else %} Cloud only {% endif %}
Last Seen {{ device.last_seen.strftime('%Y-%m-%d %H:%M:%S') }}
{# ── Set LAN IP manually ──────────────────────────────────────────── #} {% if current_user.is_admin() %}
Manual LAN Override

By default the LAN IP is auto-detected during cloud sync. You can override it here if the device is reachable on a static IP.

{% endif %} {# ── Raw params ───────────────────────────────────────────────────── #}
Raw Params
{{ device.params_json }}
{% endblock %} {% block scripts %} {% endblock %}