{% extends "base.html" %} {% block title %}{% if device %}Edit Device – {{ device.name }}{% else %}New Device{% endif %}{% endblock %} {% block content %}

{% if device %}Edit Device{% else %}New Device{% endif %}

{% if device %} Update identity or change the hardware binding below. {% else %} Define the device identity first — hardware binding is optional and can be added later. {% endif %}

Device Identity Required — the virtual device exists independent of any hardware
Details
{% if device and device.app_id %} {% endif %}
Stable identifier for layouts & automations. Leave blank to keep current or auto-generate.
Device Type

Defines default icon, state labels and colours.

{% for tkey, tdef in relay_types.items() %} {% endfor %}
Custom Icon
Leave blank to use device type default.
{% for icon_cls, icon_name in icon_palette %} {% endfor %}
Hardware Binding Optional Link to a physical relay, sensor, Tuya or Sonoff channel

Select a board, then click a channel to bind this device to physical hardware. Leave unbound to use the device as a virtual entity in layouts and automations. Once bound, the device can be toggled ON/OFF and shows live state.

Select a board above to see its relay and sensor channels.
Bound to: {% if device and device.board %} {{ device.board.name }} · {{ device.name }} {% if device.hardware_device_id %} [{{ device.hardware_device_id }}] {% endif %} {% endif %}
Cancel
{% endblock %} {% block scripts %} {% endblock %}