My Lovelace Plugins

I’ve noticed a problem using the map card in a layout-card which is in a vertical-stack
I’m currently on 0.86.4 (this was working a a previous version, not sure exactly when it broke).

This is what my config looks like:

views:
  ... other views ...
  - title: Location
    path: location
    panel: true
    cards:
      - type: vertical-stack
        cards:
          - type: 'custom:entity-markdown'
            entity: sensor.banner_text
          - type: 'custom:layout-card'
            cards:
              - type: map
                entities:
                  - device_tracker.my_phone
                  - zone.home
                  - zone.work

The entity-markdown card is my own card which displays Markdown formatted text from an entity state, which I use as a notification banner.

Initially everything looks fine, but if I do the following:

  1. Refresh the page when on the Location view
  2. Switch to another view
  3. Switch back to the Location view

The map fails to render probably, and I get the following error in the logs:

Uncaught Error: Map container is being reused by another instance

Once this has happened, the only way to fix it seems to be to switch back to another view and refresh

Changing panel: true to panel: false makes no difference.
If the layout-card is directly under the view rather than under the vertical-stack it works, but this means I can’t have any other cards above the layout-card.

I have also been unsuccessful with the close-popup option, using this event script:

browser_close_popup:
  sequence:
    - event: browser_command
      event_data:
        command: close_popup
browser_popup_1:
  sequence:
    - event: browser_command
      event_data:
        command: more-info
        entity_id: camera.front_door
        large: true

and this automation:

- alias: '[Browser] browser_popup_test'
  hide_entity: True
  trigger:
    - platform: state
      entity_id: binary_sensor.front_motion
      to: 'on'
  action:
    - service: script.turn_on
      data:
        entity_id: script.browser_popup_1
    - delay: '00:00:20'
    - service: script.turn_on
      data:
        entity_id: script.browser_close_popup

Tried with Chrome on PC & Chrome/Chrome beta on Android.

what am I missing? It does not display the design I want

  - type: vertical-stack
    cards:        
      - type: custom:card-modder
        card:
          type: conditional
          conditions:
            - entity: automation.vacuum_schedule_cleaning_on_weekdays
              state: "on"
          card:
            type: entities
            entities:
              - sensor.vacuum_start_time_weekdays
              - input_number.vacuum_start_hour_weekdays
              - input_number.vacuum_start_minutes_weekdays
        style:                 
          background-image: url("/local/lovelace/background/cardbackk.png")
          background-repeat: no-repeat
          background-color: rgba(50,50,50,0.3)
          background-size: 100% 200px
          border-radius: 20px
          border: solid 1px rgba(100,100,100,0.3)
          box-shadow: 3px 3px rgba(0,0,0,0.4)

Use the card-modder for the entities-card, not for the conditional.

The idea that I click an icon is to open the menu shown in the picture. So the card-modder should be all about. Or I’m wrong. You can give an example from my code.

No, he’s right.
Think of it as boxes.
You have a card-modder box containing a conditional box, containing an entities box.
conditional hides or displays anything that’s inside it, but card-modder can only mod what’s directly inside it, not what’s inside that.
As such, card-modder now mods the conditional card, but the conditional card has no visible parts of its own, so nothing changes.

1 Like

Can you provide me an example according to my code?

Step 1: Understand yaml. This might help: http://thomasloven.com/blog/2018/08/YAML-For-Nonprogrammers/
Step 2: Put the conditional box outside the card-modder box instead.

3 Likes

@thomasloven, i’m having problems with the new state-switch.
2019-02-04 14:16:03 ERROR (MainThread) [frontend.js.latest.201902030] http://192.168.1.123:8123/local/state-switch.js?v=dcb79b:47:11 ReferenceError: hass is not defined
Reverting back to c7dd70, everything works again.

Sorry about that.
Fixed!

2 Likes

@thomasloven Is this how the plugin should respond to? am I missing the concept? Thanks!

Sorry I haven’t gotten back to you earlier.

That should be close-popup with a dash, not an underscore.

Regarding your other questions from before, there’s no support in the library Home Assistant is using for its UI to adjust the position of the popups, that I know of. I have however added support for the large parameter to the popup command. Probably won’t work perfectly, but it’s the best I can do for now. Get the latest version from github.

1 Like

:shushing_face: don’t tell anyone I goofed :rofl:
Works like a charm…:clap:
Thanks again for the help and modifications. I know your time is very valuable and I respect that by not trying to ask too many questions… @thomasloven

1 Like

I do this because I like it.

And since I don’t use most of my plugins myself, I rely on people telling me what they need to improve them.

3 Likes

I’m using card-modder which I love. I’m struggling to figure out the style property to use on an entities card that has some scripts. HA puts the word “EXECUTE” beside each script. I want to change the color of this text, “EXECUTE”, but nothing I’m trying is working. Obviously I’m unable to figure out what CSS style affects this link.

I had the same issue sort of. I changed over to input_boolean switches to display in LL and use automations to return the state of switch back to ‘off’ after 5 seconds. Guess it depends on what look you are trying to achieve

1 Like

Yeah I like that idea. Thanks!

Browser-commander with type: picture-glance works in kiosk-mode just as I hoped, but ‘title:’ is needed for card to display. Not sure if that can be changed, but awesome enough ‘as is’ …thanks! @thomasloven

was barking up the wrong tree :thinking: using browser-commander’s navigate option is much faster and looks nicer. Just needed to make a view for each camera. Added browser_navigate_home & browser reload buttons along with alarm panic, alarm set, alarm disarm & lighting. Works awesome Thanks for the hard work!!!

That’s a great workaround!

I never even thought of that…

1 Like

@Dino-Tech and @PlayedIn I might be misunderstanding but why don’t you instead of having your automations trigger after 5 seconds, trigger them when the state of the script goes to ‘off’? That way you know exactly when the script has stopped running.

1 Like