#How to open popup in custom:button-card using javascript template onclick

1 messages · Page 1 of 1 (latest)

white zinc
#
type: custom:button-card
custom_fields:
    btn1: |
      [[[
        return `
            <div style="display: flex; align-items: center; justify-content: center; gap: 10px;">
              <ha-icon
                icon="mdi:cog-outline"
                style="width: 2.4em; height: 2.4em; color: grey; cursor: pointer;"
                onclick="browser_mod.navigate({ path: '#printer' })">
              </ha-icon>
            </div>
      ]]]

tried below as well. none opened the popup. Am I missing something?

onclick='hass.callService("browser_mod.navigate({ path: '#printer' })")'
onclick="hass.callService('homeassistant', 'browser_mod', 'navigate', { path: '#printer' })"