diff --git a/home-panel/rootfs/etc/cont-init.d/discovery.sh b/home-panel/rootfs/etc/cont-init.d/discovery.sh new file mode 100644 index 0000000..44afcbf --- /dev/null +++ b/home-panel/rootfs/etc/cont-init.d/discovery.sh @@ -0,0 +1,18 @@ +#!/usr/bin/with-contenv bashio +# ============================================================================== +# Community Hass.io Add-ons: Home Panel +# Sends discovery information to Home Assistant. +# ============================================================================== +declare config + +config=$(\ + bashio::var.json \ + host "127.0.0.1" \ + port "^45158" \ +) + +if bashio::discovery "home_panel" "${config}" > /dev/null; then + bashio::log.info "Successfully send discovery information to Home Assistant." +else + bashio::log.error "Discovery message to Home Assistant failed!" +fi