Last active 1742733642

Toggle your unifi access point led with homeassistant. Create a homeassistant helper (toggle) named input_boolean.unifi_ap_led for example and create an automation that runs this shell script when the state of the helper toggle changes. Place your id_ed25519 key in config/.ssh/id_ed25519.

configuration.yml Raw
1shell_command:
2 unifi_ap_led_update: ssh -o StrictHostKeyChecking=no USERNAME@UNIFI_AP_IP -i ./.ssh/id_ed25519 "sed -i 's/^mgmt\.led_enabled=.*/mgmt\.led_enabled={% if is_state("input_boolean.unifi_ap_led", "on") %}true{% else %}false{% endif %}/' /var/etc/persistent/cfg/mgmt && echo {% if is_state("input_boolean.unifi_ap_led", "on") %}1{% else %}0{% endif %} > /proc/gpio/led_pattern"
3