Zwei Fenstersensoren eine Ausgabe

Hallo danke,

das scheint zu funktionieren. Da ich unterwegs bin konnte ich es nur mit dem Handy testen, da erscheint nun so ein Bild

siehe ganz unten. Evtl. liegt es auch an meinem gewählten Sensoren. Muss ich morgen am PC schauen.

Danke.

Gruß Werner

Hallo,

habe nun nochmals alles geprüft. Die Lösung ist genial.
Vielen, vielen Dank.

Nur noch zwei Fragen:

  1. Ist es einfach möglich die Symbole von allen Fenstern die nicht geschlossen sind gelb zu färben?
    2.Wenn ich alle Fenster so eingefügt habe, dann ist meine configuration.yaml sehr voll. Könnte man alle Fenstersensoren z.B. in eine fenstersensoren.yaml auslagern?

Nochmals herzlichen Dank. Wie kann man diese Programiersprache nur so verstehen?

Gruß Werner

Hi there,

have now checked everything again. The solution is awesome.
Thanks alot.

Just two more questions:

  1. Is it easy to color the symbols of all windows that are not closed yellow?
  2. When I have inserted all windows like this, then my configuration.yaml is very full. Could all window sensors be outsourced, for example in a window sensors.yaml?

Again thank you very much. How can you understand this programming language in that way?

Greetings Werner

As far as I know, there is no possibility to color the icon of a custom sensor. But you can adjust your theme.

It’s possible to outsource your sensors but be aware that all sensors have to go to the other file. Because you can’t duplicate sensor:

sensor: !include sensoren.yaml

sensor: 
  …
  

For a more adjustable split you could use directories (I’m doing it by using packages):

homeassistant:
  packages: !include_dir_named pakete

(„pakete“ is just an example)

In this new directory you can put unique files (and other directories), for example

fenstersensoren.yaml
tueren.yaml
telegram.yaml (if you want to outsource more than just sensors)

Hallo und vielen Dank.

die Auslagerung habe ich soweit verstanden und würde mich bei Problemen nochmals melden.
Mit dem Einfärben (Thema) werde ich mich auch beschäftzigen.

Das Hauptziel ist auf jedenfall erreicht.

Vielen Dank.

Gruß Werner

Hello and thank you very much.

I have understood the outsourcing as far as possible and would contact me again if there were any problems.
I will also deal with the coloring (topic).

The main goal has definitely been achieved.

Thanks very much.

Greetings Werner

I’m curious: When you click on your profile (last entry in sidebar menu), what is set under „theme“?

Hi there,

“Backend-Select” is selected.

Greetings Werner

Hallo,

da ist “Backend-Select” ausgewählt.

Gruß Werner

Then the colors should work. Strange.

The colors also work normally. The symbols only remain blue for the newly created window sensors

Normal funktionieren die Farben auch. Nur bei den neu erstellten Fenstersensoren bleiben die Symbole blau.

I was wrong. Also the default theme can’t change the colors of a custom sensor in a generic frontend card. What a pity.

Hi there,

no problem. If this does not work, I will display all open or tilted windows on a map. I use this system for this:
🔹 Auto-entities - Automatically fill cards with entities

Unfortunately, I still can’t do that either.
Tried to select “fensterstatus” as Entities - that also worked.
However, if I enter “offen” as the “State”, it doesn’t work.

I changed the sensor code a bit, for example:

      fensterstatus_schlafzimmer_dg:
        friendly_name: Fenster Schlafzimmer-DG
        value_template: |
          {% set b1 = states('binary_sensor.lumi_lumi_sensor_magnet_aq2_007cf906_on_off') %}
          {% set b2 = states('binary_sensor.lumi_lumi_sensor_magnet_aq2_698aff06_on_off') %}
          {% if b1 == 'off' and b2 == 'off' %} geschlossen
          {% elif b1 == 'on' and b2 == 'off' %} gekippt
          {% elif b2 == 'on' %} offen
          {% elif b1 == 'unavailable' or b2 == 'unavailable' %} nicht verfügbar
          {% else %} ?
          {% endif %}
        icon_template: |
          {% set b1 = states('binary_sensor.lumi_lumi_sensor_magnet_aq2_007cf906_on_off') %}
          {% set b2 = states('binary_sensor.lumi_lumi_sensor_magnet_aq2_698aff06_on_off') %}
          {% if b1 == 'off' and b2 == 'off' %} mdi:window-closed-variant
          {% elif b1 == 'on' and b2 == 'off' %} mdi:angle-acute
          {% elif b2 == 'on' %} mdi:window-open-variant
          {% elif b1 == 'unavailable' or b2 == 'unavailable' %} mdi:exclamation
          {% else %} ?
          {% endif %}

Greetings Werner

Hallo,

kein Problem. Wenn es so nicht geht, werde ich mir alle offenen oder gekippten Fenster in einer Karte anzeigen lassen. Ich nutze dazu dieses System:

Leider bekomme ich auch das noch nicht hin.
Habe versucht als Entities fensterstatus zu wählen - das hat auch funktioniert.
Jedoch wenn ich als “State” z.B. “offen” eingebe, da funktioniert es nicht.

Den Sensorencode habe ich noch etwas geändert, z.B.:

      fensterstatus_schlafzimmer_dg:
        friendly_name: Fenster Schlafzimmer-DG
        value_template: |
          {% set b1 = states('binary_sensor.lumi_lumi_sensor_magnet_aq2_007cf906_on_off') %}
          {% set b2 = states('binary_sensor.lumi_lumi_sensor_magnet_aq2_698aff06_on_off') %}
          {% if b1 == 'off' and b2 == 'off' %} geschlossen
          {% elif b1 == 'on' and b2 == 'off' %} gekippt
          {% elif b2 == 'on' %} offen
          {% elif b1 == 'unavailable' or b2 == 'unavailable' %} nicht verfügbar
          {% else %} ?
          {% endif %}
        icon_template: |
          {% set b1 = states('binary_sensor.lumi_lumi_sensor_magnet_aq2_007cf906_on_off') %}
          {% set b2 = states('binary_sensor.lumi_lumi_sensor_magnet_aq2_698aff06_on_off') %}
          {% if b1 == 'off' and b2 == 'off' %} mdi:window-closed-variant
          {% elif b1 == 'on' and b2 == 'off' %} mdi:angle-acute
          {% elif b2 == 'on' %} mdi:window-open-variant
          {% elif b1 == 'unavailable' or b2 == 'unavailable' %} mdi:exclamation
          {% else %} ?
          {% endif %}

Gruß Werner

Sorry it works, with this code:

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - entity_id: '*fensterstatus*'
      state: '*offen*'
  exclude: []

But how can I define a state as offen or gekippt?

Sorry es funktioniert doch, mit diesem Code:

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - entity_id: '*fensterstatus*'
      state: '*offen*'
  exclude: []

Aber wie kann ich als state offen oder gekippt definieren?

My first success.

It works like this:

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - entity_id: '*fensterstatus*'
      state: '*offen*'
    - entity_id: '*fensterstatus*'
      state: '*gekippt*'
  exclude: []

Mein erster Erfolg.

Es funktioniert so:

type: custom:auto-entities
card:
  type: entities
filter:
  include:
    - entity_id: '*fensterstatus*'
      state: '*offen*'
    - entity_id: '*fensterstatus*'
      state: '*gekippt*'
  exclude: []
1 Like

Who did you work that?

I have do a new card but nothing would show? I have one entity_id for open and one for gekippt.

I would show it on the card if its open or gekippt or closed.

Hi there,

so i ended up in the l:

type: custom:auto-entities
card:
  type: entities
  title: Offene Fenster
  state_color: true
  show_header_toggle: false
filter:
  include:
    - entity_id: '*fensterstatus*'
      state: offen
    - entity_id: '*fensterstatus*'
      state: '*offen oder gekippt*'
    - entity_id: '*fensterstatus*'
      state: gekippt
    - entity_id: '*fensterstatus*'
      state: '*nicht*'
    - entity_id: '*fensterstatus*'
      state: '?'
  exclude:
    - entity_id: '*fensterstatus*'
      state: '*geschlossen*'
sort:
  method: friendly_name


Greetings Werner

thx for this piece of code!