Placing text inside picture-elements card

I was wondering whether I could place text with some properties inside the picture-elements card

Thanks

Hello,

same question from me.
Already treid the type: markdown but it doesnā€™t work.

Anyone an idea for configuration?
Well, i could do with a pictureā€¦

Tahnks, Ralf

You can use type: state-label with a dummy sensor and place the text in prefix.
I have one with non-existence sensor.blank to display the text ā€œFront Doorā€ in my picture-elements:

    - type: state-label
      entity: sensor.blank
      prefix: "Front Door "
      style:
        top: 90%
        left: 14%
        font-size: 1.1vw
        color: white
        font-weight: bold
2 Likes

Wondering if you have solved this with a more recent release @JTPublic. This just produces a yellow warning triangle now.

Yes, latest HA tightened entities, that ā€˜hackā€™ would work anymore.
Youā€™ll have to use something valid, like define an input_text entity for state-label.

I use this:

1 Like

@Holdestmade the custom-cards/text-element was recently depreciated. Do you know of any other options.?

Itā€™s only archived, so no more development, still works fine. Iā€™ve removed it from HACS and manually installed it

Not aware of any other way to do it.

It does not still work fine.

Works for me with manual install

Try this alternantive:

2 Likes

2024 now.
Anyone know how i add just text to an element?

Greetings!
In order to display the text and other necessary information, I made a new sensor. With this you can display whatever information you want. The sensor code is located in the template.yaml file.
I added the following line to the configuration.yaml file:

# include
template: !include template.yaml

In template.yaml:

  - sensor:
    - name: 'Greeting'
      state: >
          {%- if states('sensor.time') > '22:00' and states('sensor.time') < '06:00' %}Good night!
          {%- elif states('sensor.time') >'06:00' and states('sensor.time') < '12:00' %}Good morning!
          {%- elif states('sensor.time') > '12:00' and states('sensor.time') < '18:00' %}Good day!
          {%- elif states('sensor.time') > '18:00' and states('sensor.time') < '21:59' %}Good evening!
          {%- endif %}
           MORE TEXT HERE IF YOU WANT

An example. Sensor information in the upper right corner:

I hope it helps someone. I am a beginner and have no programming knowledge.
Best wishes!

The original solution of using a state-label still works (2024.09), but you will need to create a fake sensor that you can address.

Add this to configuration.yaml:

sensor:
  - platform: template
    sensors:
      blank_blank:
        friendly_name: "Blank Blank"
        value_template: " "

Then just like the original solution you can use a state-label, but the only change is that you need to reference your fake blank_blank sensor.

  - type: state-label
    entity: sensor.blank_blank
    prefix: Living Room
    style:
      left: 51%
      top: 65%
      font-size: 1.5em
      color: rgb(200,200,200)
      font-weight: bold