#However, I only see the picture centered
1 messages · Page 1 of 1 (latest)
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.)
This example is a bit more complex but you can see how the two custom_fields sections work. http://pastie.org/p/4zKfWEy4SELjvHd6vkm6wA (Link good for 24 hours.)
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?
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.
I am trying to make that card a home assistant button card instead and not sure how
Post a screenshot and lemme see what you have so far.
For right now, delete yaml entities_card: - position: absolute - left: 0% - top: 70%
Ok that part is removed, How is it that my picture click space id so much larger than the pic
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.
And everything else is the exact same as the code that you posted above? Because everything is working for me (for the most part.)
Wait its back, found a typo
Ok, so now how would I add my restart button to the lower left?
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.
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?
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.
So the style section precedes the actual card info?
There's two separate main sections: styles and custom_fields. An item has to be defined in both.
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
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```
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!
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```
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)
left, right, top, and bottom.
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
What is this?
Oh and the button has disappeared now
Definitely not what I showed you.#1185011327069081680 message
You just made a new custom_field called styles by putting that there.
So to style the restart card the style section goes under what
Styles. Litlerally, the styles section. Starting at Line 5 is the Styles sections.
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?