#However, I only see the picture centered

1 messages · Page 1 of 1 (latest)

finite sphinx
#

So, the custom_fields should be two sections. A main section within the card that defines the cards/info to show and then another section within styles that actually styles the custom_fields. This is the beginning part of the toggle button example: yaml type: custom:button-card entity: light.living_room_lights styles: card: - width: 250px - height: 200px custom_fields: entities_card: - position: absolute - left: 0% - top: 0% - transform: rotate(270deg) - opacity: 75% custom_button_card: - position: absolute - right: 2% - top: 5% - transform: rotate(270deg) - opacity: 75% custom_fields: entities_card: card: type: entities entities: - entity: input_boolean.tester card_mod:EDIT: Full example code: http://pastie.org/p/799OWosw8tpcHmg4RCeb9g (Good for 24 hours.)

lilac wedge
#

Here is what I have now

#
entity: update.u6_mesh
show_icon: false
show_name: false
styles:
  card:
    - width: 450px
    - height: 200px
  custom_fields:
    entities_card:
      - position: absolute
      - left: 0%
      - top: 70%
    custom_button_card:
      - position: absolute
      - right: 20%
      - top: 7%
      - opacity: 100%
custom_fields:
  custom_button_card:
    card:
      type: custom:button-card
      entity: update.u6_mesh
      show_entity_picture: true
      entity_picture: /local/UnifiU6Mesh.png
      show_name: false
      show_icon: false
      styles:
        card:
          - border-radius: 10px
          - padding: 10px
          - flex-direction: column
          - position: left
          - right: 25%
          - top: 0%
  tap_action:
    action: more-info
#

So I was able to left align the picture but now I have a weird [object][object] text on the lower right side. How would I add a normal button card for my restart entity where the text is?

#

Also can I curve the corners of my image?

finite sphinx
#

It looks like you defined a entities_card: in the styles > custom_fields but don't actually have an entities_card: in the custom_fields section.

lilac wedge
#

I am trying to make that card a home assistant button card instead and not sure how

finite sphinx
#

Post a screenshot and lemme see what you have so far.

lilac wedge
finite sphinx
#

For right now, delete yaml entities_card: - position: absolute - left: 0% - top: 70%

lilac wedge
#

Ok that part is removed, How is it that my picture click space id so much larger than the pic

finite sphinx
#

I don't understand why that Object is still showing up.

#

Ah. I'm dumb. The tap_action at the bottom is not spaced properly. Highlight the last two lines and either tab twice to add it to the custom:button-card at the bottom. Or shift+Tab once to put it in the entire custom:button-card. (Or just get rid of it for now.)

#

It is technically a new custom_field called tap_action with its current spacing.

lilac wedge
#

Ok tabbed it over, Now I don't see my image at all

finite sphinx
#

And everything else is the exact same as the code that you posted above? Because everything is working for me (for the most part.)

lilac wedge
#

Wait its back, found a typo

#

Ok, so now how would I add my restart button to the lower left?

finite sphinx
#

I would say the easiest way is to add a stock button card. yaml restart_button: card: type: button name: Restart show_state: false tap_action: action: call-service service: button.press service_data: entity_id: button.u6_mesh_restartAnd then it needs a style section.

lilac wedge
#

Like this?

#
entity: update.u6_mesh
show_icon: false
show_name: false
styles:
  card:
    - width: 450px
    - height: 200px
  custom_fields:
    custom_button_card:
      - position: absolute
      - right: 20%
      - top: 7%
      - opacity: 100%
custom_fields:
  custom_button_card:
    card:
      type: custom:button-card
      entity: update.u6_mesh
      show_entity_picture: true
      entity_picture: /local/UnifiU6Mesh.png
      show_name: false
      show_icon: false
      styles:
        card:
          - border-radius: 10px
          - padding: 10px
          - flex-direction: column
          - position: left
          - right: 25%
          - top: 0%
      tap_action:
        action: more-info
  restart_button:
    card:
      type: button
      name: Restart
      icon: mdi:restart
      show_name: false
      show_state: false
      tap_action:
        action: call-service
        service: button.press
        service_data:
          entity_id: button.u6_mesh_restart
      styles:
      custom_fields:
        custom_button_card:
          - position: absolute```
#

How do I edit the size?

#

And is it possible to curve the edges of the picture?

finite sphinx
#

Needs a style in the style section: yaml styles: card: - width: 450px - height: 200px custom_fields: custom_button_card: - position: absolute - right: 20% - top: 7% - opacity: 100% restart_button: - stuff goes here.

lilac wedge
#

So the style section precedes the actual card info?

finite sphinx
#

There's two separate main sections: styles and custom_fields. An item has to be defined in both.

lilac wedge
#
entity: update.u6_mesh
show_icon: false
show_name: false
styles:
  card:
    - width: 450px
    - height: 200px
  custom_fields:
    custom_button_card:
      - position: absolute
      - right: 20%
      - top: 7%
      - opacity: 100%
custom_fields:
  custom_button_card:
    card:
      type: custom:button-card
      entity: update.u6_mesh
      show_entity_picture: true
      entity_picture: /local/UnifiU6Mesh.png
      show_name: false
      show_icon: false
      styles:
        card:
          - border-radius: 10px
          - padding: 10px
          - flex-direction: column
          - position: left
          - right: 25%
          - top: 0%
      tap_action:
        action: more-info
  restart_button:
    card:
      type: button
      name: Restart
      icon: mdi:restart
      show_name: false
      show_state: false
      tap_action:
        action: call-service
        service: button.press
        service_data:
          entity_id: button.u6_mesh_restart
      styles:
      custom_fields:
        custom_button_card:
          - position: absolute
          - border-radius: 5px
          - padding: 5px
finite sphinx
#
type: custom:button-card
entity: update.u6_mesh
show_icon: false
show_name: false
styles:  <------ Styles - Main Section
  card:
    - width: 450px
    - height: 200px
  custom_fields:```[...]```yaml
     - top: 7%
      - opacity: 100%
custom_fields:  <---- Custom_fields - Main section
  custom_button_card:
    card:
      type: c```
lilac wedge
#

This is getting very tricky for me to understand, I think I'll come back to it with a fresh mind tomorrow, Thanks for you help today!

finite sphinx
#

Hold on a second. Let's take a step back and make it a bit more simple.

#
type: custom:button-card
entity: update.hacs_update
show_icon: false
show_name: false
styles:
  card:
    - width: 450px
    - height: 200px
  custom_fields:
    picture_card:
      - position: relative
      - left: 0%
      - top: 0%
      - opacity: 100%
      - padding: 0px
      - margins: 0px
      - width: null
    restart_button:
      - position: absolute
      - left: 80%
      - top: 7%
      - opacity: 100%
custom_fields:
  picture_card:
    card:
      type: picture
      image: /local/front.jpg
  restart_button:
    card:
      type: button
      name: Restart
      show_state: false
      tap_action:
        action: call-service
        service: button.press
        service_data:
          entity_id: button.u6_mesh_restart```
lilac wedge
#

Ok, then what is the variable name to put in the style to move it down, also I think I want the corners on the button to be less curved, also the slight border on the top (which I assume is because of the button)

finite sphinx
#

left, right, top, and bottom.

lilac wedge
#

So I insert the styles here? This doesn't seem right becaus eits doesn't look like its applying

#
type: custom:button-card
entity: update.hacs_update
show_icon: false
show_name: false
styles:
  card:
    - width: 450px
    - height: 200px
  custom_fields:
    custom_button_card:
      - position: relative
      - left: 0%
      - top: 0%
      - opacity: 100%
      - padding: 0px
      - margins: 0px
      - width: null
    restart_button:
      - position: absolute
      - left: 80%
      - top: 7%
      - opacity: 100%
custom_fields:
  custom_button_card:
    card:
      type: picture
      image: /local/UnifiU6Mesh.png
  styles:
    card:
      - bottom: 20%
    restart_button:
      card:
        type: button
        name: Restart
        icon: mdi:restart
        show_state: false
        show_name: false
        tap_action:
          action: call-service
          service: button.press
          service_data:
            entity_id: button.u6_mesh_restart
finite sphinx
#

What is this?

lilac wedge
#

Oh and the button has disappeared now

finite sphinx
#

You just made a new custom_field called styles by putting that there.

lilac wedge
#

So to style the restart card the style section goes under what

finite sphinx
#

Styles. Litlerally, the styles section. Starting at Line 5 is the Styles sections.

lilac wedge
#

I thought that was just for the image card? Is that my styling for the whole button card? If so then do i select the individual elements by specifying the field?