Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seems to fail when states values contain spaces #116

Open
cperrier opened this issue May 30, 2024 · 2 comments
Open

Seems to fail when states values contain spaces #116

cperrier opened this issue May 30, 2024 · 2 comments

Comments

@cperrier
Copy link

It seems that when the tested entity's status contains a space character, the card that should be displayed isn't.
That happens for instance with the following

type: custom:state-switch entity: sensor.template_lixee_zlinky_tic_tarif_fournisseur states: HC BLEU: type: vertical-stack cards: - type: markdown content: Heures Creuses Jour **BLEU**

I expect a simple markdown card with "Heures Creuses tarif BLEU" to appear as soon as the value of the referenced sensor is "HC BLEU". It actually works with a simple conditional card, but not with state-switch....while whenever the sensor has a value that does NOT contain any space, it works as expected.

I tried quoting the expected states values (with double or single quotes, whatever), but nothing has been helpful.

@ildar170975
Copy link

ildar170975 commented May 30, 2024

See no issues here:
изображение

type: vertical-stack
cards:
  - type: entities
    entities:
      - input_text.test_text
  - type: custom:state-switch
    entity: input_text.test_text
    default: one one
    states:
      one one:
        type: entity
        entity: sun.sun
        name: one
      two two:
        type: entity
        entity: sun.sun
        name: two
      three three:
        type: entity
        entity: sun.sun
        name: three

@cperrier
Copy link
Author

Hmmm, I suspect something weird in the sensor status but can't really find what. Just to be sure, I made a quick test with the standard conditional card

type: conditional conditions: - condition: state entity: sensor.template_lixee_zlinky_tic_tarif_fournisseur state: HP BLEU card: type: markdown content: Heures Pleines tarif **BLEU**

....and this actually works as expected : if my sensor's value is "HP BLEU" then the markdown card is shown as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants