State_not doesn't work

Hey,

first of all. I am very new in home assistant and try to enlarge m knowlegde.

I have a problem with the state. I have a socket at my washing-machine. This socket is meter the flow. In the YAML of the card, I will get a condition, that if the flow is “0”, than don’t show the card. If it is >0, than show the card.

Background is, that I will show a green icon, if the washing-machine is free “flow = 0 W” and if the washing-machine is in operation “flow > 0 W”, that the icon is red.

Does anybody has an idea?

Maybe anybody has an easier solution :slight_smile:

type: tile
entity: sensor.felix_heizer_leistung
vertical: true
hide_state: false
name: Waschmaschine
icon: mdi:washing-machine
color: pink
visibility:
  - condition: state
    entity: sensor.felix_heizer_leistung
    state_not: 0,000

State is a string, so try changing it to ‘0’ (in quotes) or use numerical_state.

Thank you. I tried both but it doesn‘t work. :frowning:


condition: numerical_state 
entity: sensor.felix_heizer_leistung 
state_not: 0

I would probably use template to create binary sensor. Developer → Template you can write and test jinja statement. Jinja I think is quite good at allowing states to be tested and caught first.

Change that to:

visibility:
  - condition: nunmeric_state
    entity: sensor.felix_heizer_leistung
    above: 0
2 Likes

I tried this, but it doesn’t work :frowning:

Please share your card config. I just tested it and it works.