GithubHelp home page GithubHelp logo

lovelace-popup-card's Introduction

popup-card

This is deprecated - Use browser_mod instead

Replace the more-info dialog of one entity with a custom lovelace card

popup-card

Breaking changes!

popup-card is no longer a card. See usage instructions below.

Installation instructions

This card requires card-tools to be installed.

For installation instructions see this guide.

The recommended type of this plugin is: js

Note: By adding ?debug after the url (&debug if you already have ?track=true) popup-card will print some extra information to your browser console when you open a more-info dialog. This may or may not be helpful if you run into problems.

If you are using custom_updater:

resources:
- url: /customcards/github/thomasloven/card-tools.js?track=true
  type: js
- url: /customcards/github/thomasloven/popup-card.js?track=true
  type: js

Usage instructions

First of all, there are a few things you need to know about what this plugin is and is not.

Normally, when you click e.g. a line in an entities card, the more-info dialog for that entity is opened. Using this plugin, a card of your choosing can be displayed instead.

Things to note:

  • This will replace every more-info dialog for the chosen entity on the same view. There is no way to open the popup-card when clicking one thing, and the normal more-info dialog when clicking another - In the same view. However:
  • The opened card doesn't need to be related to the chosen entity in any way.
  • By default - if everything is working - you will not see any difference. Until you open the card by clicking something else, nothing will pop up.
  • That means that the popup-card does not magically appear by itself. You need to supply the means to open it. (I'm really rubbing this in at this point, but you wonuldn't believe the ammount of questions I get about this)
  • This is not a card and should not be configured as if it is.

Still with me? Ok. Let's go.

There are two ways to define a popup-card. Either per-view, or globally.

Per-view configuration

To define a popup-card in a certain view, add a popup_cards: section to the views configuration:

views:
  - title: My view
    icon: mdi:home-assistant
    popup_cards:
      # popup-card configuration goes here
    cards:
      - type: entities
        ...etc...

Popup-cards defined in this way will replace the more-info dialogs only in the current view.

Global configuration

To define a popup-card in all views, add a popup_cards: section to the root of your lovelace configuration:

title: My awesome lovelace interface
resources:
  - url: /customcards/github/thomasloven/card-tools.js?track=true
    type: js
  - url: /customcards/github/thomasloven/popup-card.js?track=true
    type: js
popup_cards:
  # popup-card configuration goes here
views:
  - title: My view
   ...etc...

Popup-cards defined in this way will replace the more-info dialogs in all views.

It's possible to mix global and per-view popup-card configurations. Per-view takes precedence.

Popup-card configuration

Whether per-view of global, a popup-card is defined in the following form:

  <entity id>:
    title: <title>
    large: <true/false>
    style:
      <styles>
    card:
      <card>

<entity id>

The entity id of the entity whose more-info dialog is to be replaced, e.g. light.bed_light, device_tracker.my_phone, sun.sun, sensor.dummy_sensor_1.

<title>

Required

The heading title of the popup. This is required

<large>

Optional. Default: false

If true the popup will be a bit wider.

`

Optional. Default: none

Dictionary of CSS styles to apply to the more-info-dialog root.

<card>

Required

The specification of the card to pop up.

E.g:

type: entities
entities:
  - light.bed_light
  - type: custom:time-input-row
    entity: input_datetime.on_time
  - type: custom:time-input-row
    entity: input_datetime.off_time
  - input_boolean.weekdays_only

Repeating cards

If you would like the same card to replace the more-info dialog for multiple entities, you can add a redirection to your popup card configurations on the form:

  <entity id 1>: <entity id 2>

If a popup-card has been defined for <entity id 2>, it will now replace the more-info dialog for both <entity id 1> and <entity id 2>.

Example configuration

title: My awesome lovelace interface
resources:
  - url: /customcards/github/thomasloven/card-tools.js?track=true
    type: js
  - url: /customcards/github/thomasloven/popup-card.js?track=true
    type: js
views:
  - title: My view
    icon: mdi:home-assistant
    popup_cards:
      light.bed_light:
        title: Bedside lamp settings
        card:
          type: entities
          entities:
            - light.bed_light
            - type: custom:time-input-row
              entity: input_datetime.on_time
            - type: custom:time-input-row
              entity: input_datetime.off_time
            - input_boolean.weekdays_only
    cards:
      - type: entities
        entities:
          - light.bed_light
          - light.ceiling_lights
          - light.kitchen_lights
  • Screenshot at top of page*

FAQ

Can a popup-card be opened programatically, e.g. by a Home Assistant automation?

No, but this can be done using browser-commander.

Can the size or position of the popup be changed?

The only way to change the size is the large option, which does the same thing as clicking on the title.

Can I remove the title or the X for closing the dialog?

No, but you can set an empty title title: " "

Why do I need to override a more-info dialog? Can't you just make it pop-up?

Well... yes, actually you can, by using browser-commander and something with a call-service tap_action.

Why can't I open the more-info dialog of an entity from the popup-card.

Limitations of Home Assistant.


Buy Me A Coffee

lovelace-popup-card's People

Contributors

johanleirnes avatar thomasloven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lovelace-popup-card's Issues

css popup card does not work in Fully kiosk browser

High Thomas, I am experimenting with your popup-card. Things are looking very good. I have two litlle problems.

  1. I have one popup which is double. I made a popup card for a alarmpanel and I see two alarmpanels under eachother.

  2. The second is that the ccs from the popup doe snot work in Fully kiosk browser on android. The css from the regular cards work fine (custom card modder) and the css from the popup also works fine in Google Chrome on the mac.

Hope you can help.

Grtz,

Daniel

this card is not working in 0.97

My Home Assistant version: 0.XX.X
0.97

My lovelace configuration method (GUI or yaml):
gui

What I am doing:
popup card not working. instead regular more-info is showing up.

What I expected to happen:
popup card not working. instead regular more-info is showing up.

What happened instead:
popup card not working. instead regular more-info is showing up.

Minimal steps to reproduce:

# The least ammount of code possible to reproduce my error



# End of code

Error messages from the browser console:


By putting an X in the boxes ([ ]) below, I indicate that I:

  • Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
  • Have made sure I am using the latest version of popup-card.
  • Have made sure I am using the latest version of card-tools.
  • Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
  • Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

Scrolling

**Sorry, how do I format the code to not appear as one huge block?

My Home Assistant version: 0.90.0

My lovelace configuration method (GUI or yaml):

      media_player.living_room:  # LIVING ROOM MEDIA PLAYER POPUP
        title: Apple TV
        card:
          type: vertical-stack
          cards:
            - type: entities
              entities:
                - type: media-control
                  entity: media_player.living_room
                - type: custom:mini-media-player
                  entity: media_player.sonos
                  more_info: false
                  artwork: full-cover-fit
                  idle_view:
                    when_idle: true
                  hide:
                    power: true
                    name: true
                    controls: true
                    icon: true
                    source: true
                    artwork_border: true 
            - type: picture-elements
              image: /local/images/short-empty.png?v2.2
              elements:
                - type: image # Watch TV Button + STYLE ANCHOR
                  entity: switch.living_room_tv
                  tap_action:
                    action: toggle
                  image: /local/images/remote/tv.svg?v1
                  state_filter:
                    "on": invert(.5) sepia(1) saturate(8) hue-rotate(10deg)
                  style:
                    top: 50%
                    left: 20%
                    # Reuse these values with <<: *style_anchor in the style section for each button
                    <<: &style_anchor
                      width: 2em
                      height: 2em
                      padding: 15px
                      background-color: var(--paper-item-icon-color)
                      border-radius: 50%
                      box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px 0 rgba(0,0,0,.14), 0 1px 18px 0 rgba(0,0,0,.12)
                - type: image #Apple TV Button
                  entity: switch.apple_tv
                  tap_action:
                    action: toggle
                  image: /local/images/remote/apple.svg?v1
                  state_filter:
                    "on": invert(.5) sepia(1) saturate(8) hue-rotate(10deg)
                  style:
                    <<: *style_anchor
                    top: 50%
                    left: 50%
                - type: image # Start PS4 Button
                  entity: switch.ps4
                  tap_action:
                    action: toggle
                  image: /local/images/remote/playstation.svg?v1
                  state_filter:
                    "on": invert(.5) sepia(1) saturate(8) hue-rotate(10deg)
                  style:
                    <<: *style_anchor
                    top: 50%
                    left: 80% 
            - type: conditional # Display volume controls when any Activity is on
              conditions:
              - entity: remote.living_room_hub
                state: "on"
              card:
                type: picture-elements
                image: /local/images/short-empty.png?v2.1
                elements:
                - type: image  # Volume Up
                  tap_action:
                    action: call-service
                    service: remote.send_command
                    service_data:
                      entity_id: remote.living_room_hub
                      device: 60032870
                      command: VolumeUp
                  image: /local/images/remote/volup.svg?v1
                  style:
                    <<: *style_anchor
                    top: 50%
                    left: 80%
                - type: image  # Mute
                  tap_action:
                    action: call-service
                    service: remote.send_command
                    service_data:
                      entity_id: remote.living_room_hub
                      device: 60032870
                      command: Mute
                  image: /local/images/remote/mute.svg?v1
                  style:
                    <<: *style_anchor
                    top: 50%
                    left: 50%
                - type: image  # Volume Down
                  tap_action:
                    action: call-service
                    service: remote.send_command
                    service_data:
                      entity_id: remote.living_room_hub
                      device: 60032870
                      command: VolumeDown
                  image: /local/images/remote/voldown.svg?v1
                  style:
                    <<: *style_anchor
                    top: 50%
                    left: 20%

What I am doing:
The pop up works great, however some of the content is below the end of the screen and I'm not able to scroll down to see the rest of it. Any suggestions for what I should change?
Many thanks

Light toggles don't work after using popup card (map)

I have a custom:popup-card to open up a map with my location from device_tracker. If I call that popup I am no longer able to toggle my lights. They'll only send the last command.

I've tried changing the popup-card to another type (ie entities) and my lights don't have any issues after that. As far as I can tell, it's only affected with the map type.

Can't use this with custom:banner-card

My Home Assistant version: 0.97.0

My lovelace configuration method (GUI or yaml): yaml

What I am doing:
trying to display a custom:dual-thermostat as a popup while using custom:banner-card to display my living room entities.

What I expected to happen:
a dual thermostat card appear

What happened instead:
no custom:dual thermostat card just the normal climate card for 1 of my entities

Minimal steps to reproduce:
Well I would say you need to have the dual thermostat, banner card, and try the pop. Can't see how else to reproduce. Maybe with a custom card?

# The least ammount of code possible to reproduce my error

path: mobile_home
title: Mobile
icon: mdi:home
popup_cards:
  climate.trane_corporation_model_tcont624as42daa_cooling_1:
    title: Downstairs Thermostat
    card:
      type: entities
      entities:
        - type: custom:dual-thermostat
          name: Downstairs
          entities:
          - entity: climate.trane_corporation_model_tcont624as42daa_cooling_1
            type: cool
          - entity: climate.trane_corporation_model_tcont624as42daa_heating_1
            type: heat
          fan_control: true
          min_slider: 60
          max_slider: 80
cards:
- type: custom:banner-card
  heading: "Living Room"
  background: "#f0ffff"
  entities:
    - entity: sensor.house_mode
      name: A&M
    - entity: climate.trane_corporation_model_tcont624as42daa_cooling_1
      name: Temperature
      attribute: current_temperature
    - entity: light.jasco_products_14294_in_wall_smart_dimmer_level_2
      name: Ceiling
    - entity: light.living_room
      name: Lamps

# End of code

Error messages from the browser console:

2019-08-22 12:38:45 ERROR (MainThread) [frontend.js.latest.201908050] https://1ew1eroute9eloklzo09iv9e0loekip1.ui.nabu.casa/local/plugins/dual-thermostat/dual-thermostat.js?v=1:174:90343 Error: Specify cool and heat entities from within the climate domain.


By putting an X in the boxes ([ ]) below, I indicate that I:

  • [X ] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
  • Have made sure I am using the latest version of popup-card.
  • Have made sure I am using the latest version of card-tools.
  • Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
  • Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

The card defined for the popup is repeated + Console error messages

My Home Assistant version: 0.XX.X

  • 0.88.2
  • Chrome: 72.0.3626.121 in incognito mode, no plugins

My lovelace configuration method (GUI or yaml):

  • GUI / Storage

What I am doing:

  • Trying to add a simple popup for testing

What I expected to happen:

  • I click on the defined entity for the the popup and I get the expected popup

What happened instead:

  • I get a popup BUT the card defined to show up in the popup is duplicated multiple times.

Minimal steps to reproduce:
Use the below code lovelace code, save and click on the sun.sun entity

# The least amount of code possible to reproduce my error

name: Home Dashboard
resources:
  - type: js
    url: /customcards/card-tools.js?track=true
  - type: js
    url: /customcards/popup-card.js?track=true
views:
  - cards:
      - type: entities
        entities:
          - entity: sun.sun
        title: Sun
        show_header_toggle: false
    badges: []
    title: Test
    icon: ''
    popup_cards:
      sun.sun:
        title: Testing
        card:
          type: entities
          entities:
            - sensor.moon

# End of code

Error messages from the browser console:

  • This is just part of the console log since it looks like it's just repeating over and over again. The saved log ended up having over 370,000 lines.
  • Maybe a bug in card-tools?
card-tools.js?track=true:403 CARD-TOOLS IS INSTALLEDDeviceID: ######-######
card-tools.js?track=true:80 Uncaught RangeError: Maximum call stack size exceeded.
    at _createThing (card-tools.js?track=true:80)
    at Function.createThing (card-tools.js?track=true:112)
    at Function.createCard (card-tools.js?track=true:133)
    at HTMLElement.document.querySelector.addEventListener (popup-card.js?track=true:22)
    at Function.fireEvent (card-tools.js?track=true:59)
    at Function.moreInfo (card-tools.js?track=true:199)
    at Function.popUp (card-tools.js?track=true:367)
    at HTMLElement.document.querySelector.addEventListener (popup-card.js?track=true:24)
    at Function.fireEvent (card-tools.js?track=true:59)
    at Function.moreInfo (card-tools.js?track=true:199)
_createThing @ card-tools.js?track=true:80
createThing @ card-tools.js?track=true:112
createCard @ card-tools.js?track=true:133
document.querySelector.addEventListener @ popup-card.js?track=true:22
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ card-tools.js?track=true:59
moreInfo @ card-tools.js?track=true:199
popUp @ card-tools.js?track=true:367
document.querySelector.addEventListener @ popup-card.js?track=true:24
fireEvent @ app-2a009154.js:1305
_handleClick @ c44e5d59e2d7eb01278d.chunk.js:5393
element.addEventListener @ c44e5d59e2d7eb01278d.chunk.js:5391

By putting an X in the boxes ([ ]) below, I indicate that I:

[X] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

[X] Have made sure I am using the latest version of popup-card.

[X] Have made sure I am using the latest version of card-tools.

[X] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

[X] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

Change more-info for whole domain - (hacky) code included

Firstly, thanks for all the cards you have created!

For my project I wanted to change the more-info dialog for all entities in a domain so I hacked the lovelace-popup-card.js

Usage example (can be global or per view, the same as the original)

popup_cards_domain:
      climate:
        title: "###ENTITYNAME###"
        card:
          type: vertical-stack
          cards:
            - type: history-graph
              entities:
                - "###ENTITY###"
            - type: entities
              entities:
                - "###ENTITY###"

Where ###ENTITY### is a sort-of template for the actual entity id and ###ENTITYNAME### is the friendly_name.

Code below

(function (){
const thisScript = document.currentScript;
customElements.whenDefined('card-tools').then(() => {
  let cardTools = customElements.get('card-tools');

  let moreInfo = null;
  document.querySelector("home-assistant").addEventListener("hass-more-info", (e) => {
    if(moreInfo && !moreInfo.getAttribute('aria-hidden')) return;
    if(!cardTools.lovelace) return;
    const data = Object.assign({},
      cardTools.lovelace.config.popup_cards_domain,
      cardTools.lovelace.config.views[cardTools.lovelace.current_view].popup_cards_domain
    );
    if(e.detail) {
      cardTools.logger(`Opening more-info dialog for ${e.detail.entityId}`, thisScript);
      cardTools.logger(`AD extra info ${JSON.stringify(e)}`, thisScript);
      cardTools.logger(`Overridden dialogs:`, thisScript);
      cardTools.logger(Object.keys(data), thisScript);
      cardTools.logger(`Settings: ${JSON.stringify(data[e.detail.entityId])}`, thisScript);
    }
    if(e.detail && e.detail.entityId && data[e.detail.entityId.split(".")[0]]) {
      let settings = data[e.detail.entityId.split(".")[0]];
      while(settings && typeof settings === "string") settings = data[settings];
      if(!settings) return;
      
      if(cardTools.hass) myhass = cardTools.hass;
      
      friendlyname = myhass.states[e.detail.entityId].attributes.friendly_name;
      
      settings = JSON.parse(JSON.stringify(settings).replace(/###ENTITY###/g, e.detail.entityId));
      settings = JSON.parse(JSON.stringify(settings).replace(/###ENTITYNAME###/g,friendlyname));
      
      cardTools.logger(`Settings: ${JSON.stringify(settings)}`, thisScript);
    
      const card = cardTools.createCard(settings.card);
      if(cardTools.hass) card.hass = cardTools.hass;
      moreInfo = cardTools.popUp(settings.title, card, settings.large || false);
      if(settings.style) {
        let oldStyle = {};
        for(var k in settings.style) {
          oldStyle[k] = moreInfo.style[k];
          moreInfo.style.setProperty(k, settings.style[k]);
        }
        setTimeout(() =>{
        let interval = setInterval(() => {
          if(moreInfo.getAttribute('aria-hidden')) {
            for(var k in oldStyle)
              moreInfo.style.setProperty(k, oldStyle[k]);
            clearInterval(interval);
          }
        }, 100)
        }, 1000);
      }
    }
  });

});
})();

As I said...hacky!

Close button

Is it possible to add a button to close the pop-up card? I mean, a custom button

Custom popup not displayed in Chrome Mobile on Android

My Home Assistant version: 0.91.3

My lovelace configuration method (GUI or yaml): yaml

What I am doing: clicking on element with custom popup attached

What I expected to happen: display the customized popup

What happened instead: the default HA 'more details' popup is displayed

Minimal steps to reproduce:

# The least ammount of code possible to reproduce my error



# End of code

Error messages from the browser console: cannot see that at this point - working on configuring Chrome Mobiel Debugger via adb


By putting an X in the boxes ([ ]) below, I indicate that I:

[X] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

[X] Have made sure I am using the latest version of popup-card.

[X] Have made sure I am using the latest version of card-tools.

[X] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

[X] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

The popup is displayed correctly and works as expected on all my desktop browsers and on multiple computers. The issue is only with Chrome Mobile on Android devices. I tried it on the latest Chrome version on Android 9 and Android 8.1. At this point I cannot tell you if there are any errors in console on the mobile device browser but working on it. It maybe something related to the way the plugin overrides the default HA popup as the default is shown and not the custom one. I also tried it with the example configuration and the same behavior is observed.

Calling another popup within first

Hey, so this is kinda a long shot, and probably a limitation with polymer, but would it be possible to click on an glance item from within a popup, which would call a different one? I have my device trackers in a popup, and would like to click those and see more info on that item.

In any event, great work, I use this card a ton in my Hass to clean up my front end (and got rid of a bunch of views!

Content Relative to Caller

Hello, is it possible to have the content of the card relative to the caller Attributes? I set the card to repeat across several entities... all of them have the same Attributes names, and I would like to have a card to all of them... accessing his own attributes.

Is this possible or planed?

Thank You

Switch position (light, input booleans...) and sensor icon not refreshed correctly

Hello,
first of all.. thank you for your great work !

I have a problem with popup-card in my HA, ver. 0.91.0
OS: Windows 10
Browser: Chrome

When I switch ON a light or input boolean in a popup card, the switch works correctly in HA, but it reverts back to OFF after a couple of seconds in the initial position in the popup-card.

The light icon is not showed correctly in popup-card, but it's showed correctly in glances card.

These are the steps followed (images attached):
01 - Light is OFF
02 - Turning light ON
03 - Light is ON but turns OFF automatically in the popup card after a couple of seconds (not correct)
04 - In the glance card Light is ON (correct)
05 - If I open popup card light is ON (correct)

I have the same issue also with input boolean switches.
Am I doing something wrong?
Thank you

This is the lovelace configuration used:

resources:
  - url: /local/card-tools/card-tools.js?v=0.4
    type: js
  - url: /local/more-info-card/more-info-card.js
    type: js
  - url: /local/popup-card/popup-card.js
    type: js    
  - url: /local/fold-entity-row/fold-entity-row.js
    type: js
  - url: /local/card-modder/card-modder.js
    type: js
  - url: /local/time-input-row/time-input-row.js
    type: js
  - url: /local/dual-gauge-card/dual-gauge-card.js
    type: js
  - url: /local/vertical-stack-in-card/vertical-stack-in-card.js?v=0.1.2
    type: js
  - url: /local/bar-card/bar-card.js?v=0.1.9.7.1
    type: js
  - url: /local/mini-graph-card-bundle/mini-graph-card-bundle.js?v=0.3.3
    type: js
  - url: /local/slider-entity-row/slider-entity-row.js
    type: js
  - url: /local/button-card/button-card.js
    type: js
  - url: /local/popup-scroll-fix/popup.js
    type: js

# popup_cards Section
views:
  - title: Zona Giorno
    icon: 'mdi:weather-sunny'
    panel: false
    path: default_view
    badges: []
    popup_cards:
      light.01_ingresso_1_corridoio:
        title: Luci 01 Ingresso
        large: true
        card:
          type: entities
          show_header_toggle: false
          entities:
            - type: custom:more-info-card
              entity: light.01_ingresso_1_corridoio
            - type: custom:more-info-card
              entity: light.01_ingresso_2_zona_giorno
            - type: custom:more-info-card
              entity: light.01_ingresso_3_zona_notte

#cards Section
    cards:
      - type: custom:vertical-stack-in-card
        title: Ingresso
        cards:
        - type: glance
          columns: 2
          show_icon: true
          show_name: false
          show_state: true
          entities:
            - entity: light.01_ingresso_1_corridoio
            - entity: input_select.ismart_alarm

01 - Light is OFF
02 - Turning Light ON
03 - Light is ON but turns OFF automatically (not correct)
04 - In the glance card Light is ON (correct)
05 - If I open popup card light is ON (correct)

Scroll Bar on Popup

I am getting a scroll bar on the side whenever I use this popup card. Any idea what could be causing this?

I have tried both mini-graph-card and history-graph and get the same result. I have also played with the settings of mini-graph-card (height and removing title/icon) trying to adjust its height, but still resulted in the scroll bar.

image

Edit: Sorry, should have added my config as well...

image

Edit 2: It seems to go away with an added entity at the bottom.

image

Card leaves a space in layout

Would be nice if the space was not there as the card has nothing to do with your layout.
Not sure if is an easy fix, as a workaround is putting the popup-card inside of a custom:vertical-stack-in-card, but not sure if that is ideal.

More dialog info instead of popup card

My Home Assistant version: 0.90.2

My lovelace configuration method (GUI or yaml): yaml

What I am doing:

Using exact same configuration as on older version of hassio with popup card and it was working perfectly.

What I expected to happen:

After Upgrading it doesnt work anymore. more dialog info is not a popup card anymore. Using custom updater so i have the newest version of popupcard and card tool

What happened instead:

More dialog info came back. instead of popup card. I even tried second instance of hassio. same problem

Minimal steps to reproduce:

title: My awesome lovelace interface
resources:
  - url: /local/github/thomasloven/card-tools.js?track=true
    type: js
  - url: /local/github/thomasloven/popup-card.js?track=true
    type: js
views:
  - title: My view
    icon: mdi:home-assistant
    popup_cards:
      light.swiatlo1:
        title: Bedside lamp settings
        card:
          type: entities
          entities:
            - light.swiatlo2
    cards:
      - type: entities
        entities:
          - light.swiatlo1


# End of code

Error messages from the browser console:


By putting an X in the boxes ([ ]) below, I indicate that I:

[x] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

[x] Have made sure I am using the latest version of popup-card.

[x] Have made sure I am using the latest version of card-tools.

[x] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

[x] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

Not displaying

This is probably unique to me, but I'm not finding help in the forums. The pop-up card will not display unless I enter edit mode. There are no browser (chrome 72. canary 74) or HA log errors.

cards:
  card:
    entities:
      - entity: media_player.kitchen_roku
        type: 'custom:roku-card'
title: Rokus
type: 'custom:popup-card'
resources:
  - type: js
    url: /local/card-tools.js?v=7
  - type: js
    url: /local/popup-card.js?v=15
  - type: module
    url: /local/roku-card-editor.js?v=28
  - type: module
    url: /local/roku-card.js?v=9

HA 87.1, hassos 2.8

Have problem after upgrade HA 0.88.1

After upgrade to HA 0.88.1 found the button is too big and the width of popup card is not enough. Is there any way to adjust the width of the popup card?

Popup repeatedly added

Hello,
I wanted a popup showing the plant status card of my plant when clicking on the custom mini-graph-card that shows a graph of my plant moisture (and light intensity).

Everything's working fine but when you click (accidentally... or not) on the plant moisture entity within the plant status's popup, it shows a new popup, and so on. That makes sense since the plant moisture sensor is the trigger in this particular view but that's obviously not a 'normal' behavior.

I'm taking the opportunity to ask. Would it be possible to have a boolean parameter for whether showing or not the title of the popup card ? - Actually, if you visualize my example well, you'll see that the popup will show both the popup's title and the plant status card's name (I'm using a workaround by setting the name to an empty space) which is not really nice (at least, IMO)
edit. Nevermind, I guess I would prefer that the plant status card itself had this option...

The code:

title: Plants
popup_cards:
  sensor.miflora_palmtree_moisture:
    title: 'Palmtree'
    large: false
    card:
      type: plant-status
      entity: plant.palmtree
      name: ' '
cards:
  - type: custom:mini-graph-card
    entities:
    - entity: sensor.miflora_palmtree_moisture
      name: 'Moisture'
    - entity: sensor.miflora_palmtree_light_intensity
      name: 'Light intensity'

Thanks!

Problem with input_select on popup card

Hi Thomas,

First of all, thanks for your great work with HA.

I'm trying to add a input_select in the popup card, but It seems that the options are cutted by the card. In my mobile works great, but in a computer shows in this way:

image

Thanks again!

New format still supports all card types?

I have this popup-card thermostat entry (from a twitch stream of Frenck)
It shows a temp graph and you can open the thermostat by clicking on it.
I cannot seem to convert it to the new format, is this still supported?

  - type: custom:mini-graph-card
    entities: sensor.temperatuur_woonkamer
    location_icon: left
    location_state: center
    show:
      fill: false
      extrema: true
    height: 75
    animate: true
    hour24: true
    line_color: var(--primary-color)
    line_color_above: 
      - value: 21
        color: red
    line_color_below:
      - value: 15
        color: white
  - type: custom:popup-card
    entity: sensor.temperatuur_woonkamer
    title: Verwarming
    card:
      type: 'custom:simple-thermostat'
      entity: climate.toon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.