Temperatur Daten auslesen und gegenrechnen

Rund um das Thema Node Red und das Zusammenspiel mit Home Assistant.
Ab man Node Red wirklich braucht, das ist einen andere Frage! 😉


Antworten
Sebastian
Beiträge: 9
Registriert: Do 1. Sep 2022, 13:27
Has thanked: 3 times
Been thanked: 1 time

Temperatur Daten auslesen und gegenrechnen

Beitrag von Sebastian »

Guten Morgen,

Mein Plan ist es, mich und meine Familie besser zu erziehen. :D

Der Winter steht vor der Tür, die Heizung muss an und auch der Kamin darf da nicht fehlen. Bei uns wird auch gerne und viel gelüftet. Beim Lüften passiert es allerdings gerne mal das wir vergessen das ein Fenster offen geblieben ist und dadurch die Wärme entweicht.

In Node Red habe ich schon soweit eine Automation erstellt, die nach einer Std. offenem Fenster und weniger als 14° Außentemperatur, diesbezüglich eine Ansage über die einzelnen Quasselstrippen im Haus ausgibt und auch eine Nachricht ans Handy schickt. In dieser Nachricht ist die die Aufforderung, das Fenster zu schließen und Welche Temperatur draußen aktuell ist. Ich möchte aber auch gerne das noch angegeben wird, wie hoch der Temperatur Unterschied zwischen dem Moment Fenster wird geöffnet und die Ansage wird gestartet ist.

Wie kann ich dieses am besten in Node Red umsetzen.

Code: Alles auswählen

[{"id":"2d2275eb49483f4c","type":"comment","z":"718b73456bed19b0","name":"Lüften Wohnzimmer","info":"","x":170,"y":820,"wires":[]},{"id":"1fac221d5be8b5a3","type":"server-state-changed","z":"718b73456bed19b0","name":"Fenster Wohnzimmer offen","server":"64eac69f.fe1218","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.hmip_fensterkontakt_mit_magnet_w","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"1","forType":"num","forUnits":"hours","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":190,"y":940,"wires":[["925808d669e3b687"],[]]},{"id":"925808d669e3b687","type":"time-range-switch","z":"718b73456bed19b0","name":"","lat":"","lon":"","startTime":"sunrise","endTime":"sunset","startOffset":"-60","endOffset":"60","x":420,"y":940,"wires":[["c56c782fffbfd09c"],[]]},{"id":"c56c782fffbfd09c","type":"api-current-state","z":"718b73456bed19b0","name":"Ausentemperatur","server":"64eac69f.fe1218","version":3,"outputs":2,"halt_if":"14","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.openweathermap_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":650,"y":940,"wires":[["a6a5b1c43786bb12"],[]]},{"id":"469f5813b6c35707","type":"inject","z":"718b73456bed19b0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":460,"y":860,"wires":[["c56c782fffbfd09c"]]},{"id":"69d09dda1b9276da","type":"server-state-changed","z":"718b73456bed19b0","name":"Ausentemperatur Unter 12°","server":"64eac69f.fe1218","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.openweathermap_temperature","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"12","halt_if_type":"num","halt_if_compare":"lte","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":200,"y":1000,"wires":[["78791c1eca83cac3"],[]]},{"id":"78791c1eca83cac3","type":"time-range-switch","z":"718b73456bed19b0","name":"","lat":"","lon":"","startTime":"sunrise","endTime":"sunset","startOffset":"-60","endOffset":"60","x":420,"y":1000,"wires":[["c72377628107cc03"],[]]},{"id":"c72377628107cc03","type":"api-current-state","z":"718b73456bed19b0","name":"Fenster über 1 Std. geöffnet","server":"64eac69f.fe1218","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.hmip_fensterkontakt_mit_magnet_w","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"1","forType":"num","forUnits":"hours","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":680,"y":1000,"wires":[["a6a5b1c43786bb12"],[]]},{"id":"403235f1c133ee93","type":"delay","z":"718b73456bed19b0","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1540,"y":880,"wires":[["302e604722ff2374"]]},{"id":"302e604722ff2374","type":"api-current-state","z":"718b73456bed19b0","name":"Fenster immer noch offen","server":"64eac69f.fe1218","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.hmip_fensterkontakt_mit_magnet_w","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1790,"y":880,"wires":[["dea873a6441a3307"],[]]},{"id":"ed126fbfc9bf960e","type":"api-call-service","z":"718b73456bed19b0","name":"","server":"64eac69f.fe1218","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_mamas_handy","areaId":[],"deviceId":[],"entityId":[],"data":"{\"title\":\"Lüften\",\"message\":\"Das Fenster im Wohnzimmer ist seit über einer Stunde geöffnet. Drausen sind {{states.sensor.openweathermap_temperature}}°. Bitte schließen. \",\"data\":{\"type\":\"announce\",\"method\":\"all\",\"group\":\"Verschattung\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1260,"y":940,"wires":[[]]},{"id":"1393358d1f759644","type":"api-call-service","z":"718b73456bed19b0","name":"","server":"64eac69f.fe1218","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_papas_handy","areaId":[],"deviceId":[],"entityId":[],"data":"{\"title\":\"Lüften\",\"message\":\"Das Fenster im Wohnzimmer ist seit über einer Stunde geöffnet. Drausen sind {{states.sensor.openweathermap_temperature}}°. Bitte schließen. \",\"data\":{\"type\":\"announce\",\"method\":\"all\",\"group\":\"Verschattung\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1250,"y":880,"wires":[["403235f1c133ee93"]]},{"id":"d3d1fe5ea1ba6c0b","type":"api-call-service","z":"718b73456bed19b0","name":"","server":"64eac69f.fe1218","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_ipad","areaId":[],"deviceId":[],"entityId":[],"data":"{\"title\":\"Lüften\",\"message\":\"Das Fenster im Wohnzimmer ist seit über einer Stunde geöffnet. Drausen sind {{states.sensor.openweathermap_temperature}}°. Bitte schließen. \",\"data\":{\"type\":\"announce\",\"method\":\"all\",\"group\":\"Verschattung\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1220,"y":1000,"wires":[[]]},{"id":"dea873a6441a3307","type":"api-call-service","z":"718b73456bed19b0","name":"","server":"64eac69f.fe1218","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media_wohnzimmer","areaId":[],"deviceId":[],"entityId":[],"data":"{\"title\":\"Lüften\",\"message\":\"Das Fenster im Wohnzimmer ist seit über einer Stunde geöffnet. Drausen sind {{states.sensor.openweathermap_temperature}}°. Bitte schließen. \",\"data\":{\"type\":\"announce\",\"method\":\"all\",\"group\":\"Verschattung\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1670,"y":1000,"wires":[["403235f1c133ee93"]]},{"id":"a6a5b1c43786bb12","type":"api-call-service","z":"718b73456bed19b0","name":"","server":"64eac69f.fe1218","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media_uberall","areaId":[],"deviceId":[],"entityId":[],"data":"{\"title\":\"Lüften\",\"message\":\"Das Fenster im Wohnzimmer ist seit über einer Stunde geöffnet. Drausen sind {{states.sensor.openweathermap_temperature}}°. Bitte schließen. \",\"data\":{\"type\":\"announce\",\"method\":\"all\",\"group\":\"Verschattung\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":920,"y":940,"wires":[["1393358d1f759644","ed126fbfc9bf960e","d3d1fe5ea1ba6c0b"]]},{"id":"64eac69f.fe1218","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]

Hier einmal das gebastelte von mir :D gerne auch Vorschläge wie ich diese besser umsetzen kann.

Benutzeravatar
Osorkon
Administrator
Beiträge: 987
Registriert: Sa 17. Jul 2021, 16:53
1
Wohnort: Langenargen
Has thanked: 21 times
Been thanked: 192 times
Kontaktdaten:

Re: Temperatur Daten auslesen und gegenrechnen

Beitrag von Osorkon »

Also um wieviel grad die Temperatur im Raum gefallen ist?
Bei Node Red bin ich leider raus.
An eine einfachen Lösung mit Home Assistant Boardmitteln bist Du nicht interessiert? 😉😀

Gruß
Osorkon

Einer muss ja für Ordnung sorgen. :D
Sebastian
Beiträge: 9
Registriert: Do 1. Sep 2022, 13:27
Has thanked: 3 times
Been thanked: 1 time

Re: Temperatur Daten auslesen und gegenrechnen

Beitrag von Sebastian »

Genau.
Um genau Nachvollziehen zu können welchen Verlust man dadurch nun hatte.

Am Liebsten wäre mir das mit Node-Red da bei mir 90 Prozent alles darüber läuft. Wenn das ganze allerdings "Einfach" mit Boardmittel umzusetzen ist bin ich da auch nicht von abgeneigt :D

Schöne Grüße
Basti

Tristan
Beiträge: 26
Registriert: Do 19. Mai 2022, 23:08
Has thanked: 8 times
Been thanked: 4 times

Re: Temperatur Daten auslesen und gegenrechnen

Beitrag von Tristan »

Hi Basti,

guck dir mal dieses Video an, wo ich die Temperaturdifferenz in Node-RED ermittelt habe. Daraus lässt sich deine Idee sicherlich ableiten:
QuickTipp: (Terrassen-)Tür-Hinweis bei Hitze abspielen mit Home Assistant und Node-RED
https://youtu.be/U6xC244W2rE

Benutzeravatar
Osorkon
Administrator
Beiträge: 987
Registriert: Sa 17. Jul 2021, 16:53
1
Wohnort: Langenargen
Has thanked: 21 times
Been thanked: 192 times
Kontaktdaten:

Re: Temperatur Daten auslesen und gegenrechnen

Beitrag von Osorkon »

Sebastian hat geschrieben: Di 4. Okt 2022, 19:25

Wenn das ganze allerdings "Einfach" mit Boardmittel umzusetzen ist bin ich da auch nicht von abgeneigt

Erstelle Dir zuerst zwei Template Sensoren. der eine speichert die Temperatur wenn das Fenster geöffnet wird und der zweite wenn das Fenster Geschlossen wird.
Die Entitäten für den Fenster Sensor und den Temperatur Sensor, muss Du natürlich gegen Deinen eignen ersetzen.

Auszug aus der template.yaml

Code: Alles auswählen

- trigger:
    platform: state
    entity_id:
      - binary_sensor.fenster_bad
    from: "off"
    to: "on"
  sensor:
    - name: Bad Temperatur Fenster wird geöffnet
      state: |
        {{ states('sensor.aqara_klima_bad_temperature') }} 
      device_class: temperature
      unit_of_measurement: '°C'
      unique_id: bad_temperatur_fenster_wird_geoeffnet

- trigger:
    platform: state
    entity_id:
      - binary_sensor.fenster_bad
    from: "on"
    to: "off"
  sensor:
    - name: Bad Temperatur Fenster wird geschlossen
      state: |
        {{ states('sensor.aqara_klima_bad_temperature') }} 
      device_class: temperature
      unit_of_measurement: '°C'
      unique_id: bad_temperatur_fenster_wird_geschlossen

Als Nachricht kannst Du dann diese Template verwenden. Hier wird nichts anders als die Differenz zwischen den zwei Temperatur Werten berechnet
und Abhängig vom Ergebnis ><= unterschiedliche Texte ausgegeben.

Code: Alles auswählen

{% set deltatmp = (states('sensor.bad_temperatur_fenster_wird_geschlossen') | float(0) - states('sensor.bad_temperatur_fenster_wird_geoffnet') | float(0)) |round(2) %}
{% if deltatmp > 0 %}
Temperatur ist um {{deltatmp}} °C gestiegen
{% elif deltatmp < 0%}
Temperatur ist um {{deltatmp}} °C gefallen
{% elif deltatmp == 0 %}
Temperatur blieb konstant
{% endif %}

Gruß
Osorkon

Einer muss ja für Ordnung sorgen. :D
Sebastian
Beiträge: 9
Registriert: Do 1. Sep 2022, 13:27
Has thanked: 3 times
Been thanked: 1 time

Re: Temperatur Daten auslesen und gegenrechnen

Beitrag von Sebastian »

Guten Morgen @Osorkon und @Tristan

Tristan hat geschrieben: Di 4. Okt 2022, 20:24

Hi Basti,

guck dir mal dieses Video an,
https://youtu.be/U6xC244W2rE

Genau daher kommt meine Idee. :-D Allerdings fehlte mir die Kenntnis, die Temperatur in einem Template Sensor zu speichern.

Osorkon hat geschrieben: Di 4. Okt 2022, 21:30

Erstelle Dir zuerst zwei Template Sensoren.

Genau das ist das was mir fehlte und die neu Angelegten Template Sensoren kann ich dann in der Funktion Node setzten.
Perfekt muss Ich später unbedingt Testen.

Ich danke euch beiden.

Schöne Grüße

Sebastian
Beiträge: 9
Registriert: Do 1. Sep 2022, 13:27
Has thanked: 3 times
Been thanked: 1 time

Re: Temperatur Daten auslesen und gegenrechnen

Beitrag von Sebastian »

Es hat etwas Länger gedauert.

Tut mir Leid das es so lange war, jetzt hab ich es aber soweit zum laufen gebracht das alle funktioniert.

Wer wissen möchte wie das alle bei mir Umgesetzt wurde, stelle ich unten gleich noch den Flow mit ein.
Damit der Flow funktioniert müssen die Template Sensoren wie von Osorkon Beschrieben:

Erstelle Dir zuerst zwei Template Sensoren. der eine speichert die Temperatur wenn das Fenster geöffnet wird und der zweite wenn das Fenster Geschlossen wird.
Die Entitäten für den Fenster Sensor und den Temperatur Sensor, muss Du natürlich gegen Deinen eignen ersetzen.

Auszug aus der template.yaml

Code: Alles auswählen

CODE: ALLES AUSWÄHLEN

- trigger:
    platform: state
    entity_id:
      - binary_sensor.fenster_bad
    from: "off"
    to: "on"
  sensor:
    - name: Bad Temperatur Fenster wird geöffnet
      state: |
        {{ states('sensor.aqara_klima_bad_temperature') }} 
      device_class: temperature
      unit_of_measurement: '°C'
      unique_id: bad_temperatur_fenster_wird_geoeffnet

Mit diesen beiden Templates werden Pro Fensterkontakt erstellt und in den jeweiligen Flow Integriert.

Code: Alles auswählen

[{"id":"9f4faa224602c535","type":"comment","z":"718b73456bed19b0","name":"Lüften ","info":"","x":470,"y":2200,"wires":[]},{"id":"84d3399f6830ac76","type":"server-state-changed","z":"718b73456bed19b0","name":"Fenster Wohnzimmer offen","server":"64eac69f.fe1218","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.hmip_fensterkontakt_mit_magnet_w","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"1","forType":"num","forUnits":"hours","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":540,"y":2320,"wires":[["e4110a7d1764e3f5"],[]]},{"id":"e4110a7d1764e3f5","type":"time-range-switch","z":"718b73456bed19b0","name":"","lat":"","lon":"","startTime":"sunrise","endTime":"sunset","startOffset":"-60","endOffset":"60","x":780,"y":2320,"wires":[["81f0051997b32060"],[]]},{"id":"81f0051997b32060","type":"api-current-state","z":"718b73456bed19b0","name":"Ausentemperatur","server":"64eac69f.fe1218","version":3,"outputs":2,"halt_if":"14","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.openweathermap_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1010,"y":2320,"wires":[["a1e8c56f9f8dfe1d"],[]]},{"id":"e55db8722311d4f7","type":"server-state-changed","z":"718b73456bed19b0","name":"Ausentemperatur Unter 12°","server":"64eac69f.fe1218","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.openweathermap_temperature","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"12","halt_if_type":"num","halt_if_compare":"lte","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":540,"y":2380,"wires":[["949905595f77a2a5"],[]]},{"id":"949905595f77a2a5","type":"time-range-switch","z":"718b73456bed19b0","name":"","lat":"","lon":"","startTime":"sunrise","endTime":"sunset","startOffset":"-60","endOffset":"60","x":780,"y":2380,"wires":[["559ed844334e65b4"],[]]},{"id":"559ed844334e65b4","type":"api-current-state","z":"718b73456bed19b0","name":"Fenster über 1 Std. geöffnet","server":"64eac69f.fe1218","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.hmip_fensterkontakt_mit_magnet_w","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"count","propertyType":"msg","value":"start","valueType":"str"}],"for":"1","forType":"num","forUnits":"hours","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1040,"y":2380,"wires":[["9051c45f4d583f4b"],[]]},{"id":"a85fe1dab75af849","type":"delay","z":"718b73456bed19b0","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":4300,"y":2260,"wires":[["fffd3930ad03cd43"]]},{"id":"fffd3930ad03cd43","type":"api-current-state","z":"718b73456bed19b0","name":"Fenster immer noch offen","server":"64eac69f.fe1218","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.hmip_fensterkontakt_mit_magnet_w","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":4550,"y":2260,"wires":[["5c1583cc2cc55a1d"],[]]},{"id":"f6d5e38721bfe5bf","type":"api-call-service","z":"718b73456bed19b0","name":"Mamas Handy","server":"64eac69f.fe1218","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_mamas_handy","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3960,"y":2320,"wires":[[]]},{"id":"53ac4a7a671f6408","type":"api-call-service","z":"718b73456bed19b0","name":"Papas Handy","server":"64eac69f.fe1218","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_papas_handy","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3960,"y":2260,"wires":[["a85fe1dab75af849"]]},{"id":"5c1583cc2cc55a1d","type":"api-call-service","z":"718b73456bed19b0","name":"Der betroffene Raum","server":"64eac69f.fe1218","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media_wohnzimmer","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":4400,"y":2380,"wires":[["a85fe1dab75af849"]]},{"id":"bd63b01afc9ef147","type":"api-call-service","z":"718b73456bed19b0","name":"Alle Sprachzylinder","server":"64eac69f.fe1218","version":5,"debugenabled":false,"domain":"notify","service":"alexa_media_uberall","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":3650,"y":2320,"wires":[["53ac4a7a671f6408","f6d5e38721bfe5bf"]]},{"id":"16588885bcdeefb7","type":"api-current-state","z":"718b73456bed19b0","name":"Daten Fenster zu","server":"64eac69f.fe1218","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.wohnzimmer_temperatur_fenster_wird_geschlossen","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payloadzu","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":2110,"y":2320,"wires":[["614a6b5c889a09fd"]]},{"id":"a1e8c56f9f8dfe1d","type":"api-current-state","z":"718b73456bed19b0","name":"Daten Fenster auf","server":"64eac69f.fe1218","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.wohnzimmer_temperatur_fenster_wird_geoffnet","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payloadauf","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1810,"y":2320,"wires":[["16588885bcdeefb7"]]},{"id":"b1c0e209f16064fc","type":"function","z":"718b73456bed19b0","name":"Berechnung Differenz","func":"var math = Number(msg.payloadzu) - Number(msg.payloadauf);\nmsg.payload = math;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2920,"y":2320,"wires":[["5e9cc44d59aef293"]]},{"id":"e3da1e611002ba31","type":"function","z":"718b73456bed19b0","name":"Message in Payload","func":"msg.payload = { \"data\": { \"title\": \"Lüften\", \"message\": \"Das Fenster im Wohnzimmer ist seit über einer Stunde geöffnet. Die Temperatur ist um \" + msg.payload + \"°C, auf \" + msg.wztemp +\" gefallen. Drausen sind es nur \" + msg.payloadtemp + \"°C. Bitte schließen. \", \"data\": { \"type\": \"announce\", \"method\": \"all\", \"group\": \"Lüften\" } } }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":3380,"y":2320,"wires":[["bd63b01afc9ef147"]]},{"id":"614a6b5c889a09fd","type":"api-current-state","z":"718b73456bed19b0","name":"Daten Temperatur Drausen","server":"64eac69f.fe1218","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.openweathermap_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payloadtemp","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":2360,"y":2320,"wires":[["1e33d10988e7de0b"]]},{"id":"5e9cc44d59aef293","type":"function","z":"718b73456bed19b0","name":"Differenz Runden","func":"msg.payload = msg.payload.toFixed(2).replace(\"-\", \"\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":3150,"y":2320,"wires":[["e3da1e611002ba31"]]},{"id":"1e33d10988e7de0b","type":"api-current-state","z":"718b73456bed19b0","name":"Daten Temperatur im Raum","server":"64eac69f.fe1218","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.hmip_heizkorperthermostat_temperature_4","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"wztemp","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":2640,"y":2320,"wires":[["b1c0e209f16064fc"]]},{"id":"9051c45f4d583f4b","type":"counter","z":"718b73456bed19b0","name":"","init":"0","step":"1","lower":null,"upper":null,"mode":"increment","outputs":"1","x":1300,"y":2400,"wires":[["4d433edf18a40637"]]},{"id":"4d433edf18a40637","type":"switch","z":"718b73456bed19b0","name":"","property":"count","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1530,"y":2360,"wires":[["a1e8c56f9f8dfe1d"],[]]},{"id":"d5b18b5d9e29b371","type":"comment","z":"718b73456bed19b0","name":"Die Trigger","info":"Einmal das Fenster ganz logisch und auch \ndie Aussentemperatur, da nur Nachriten \nTagsüber und auch nur Unter einem \nBestimmten Wert kommen sollen.","x":490,"y":2260,"wires":[]},{"id":"c67afd3c56159676","type":"comment","z":"718b73456bed19b0","name":"von wann bis wann Aktiv","info":"","x":790,"y":2260,"wires":[]},{"id":"4b49648a7469467c","type":"comment","z":"718b73456bed19b0","name":"Parameter abfragen","info":"","x":1040,"y":2260,"wires":[]},{"id":"84c0ca5d7abc7ee0","type":"comment","z":"718b73456bed19b0","name":"Payload begrenzen","info":"Da die Außentemperatur sich mehrfach,\nwährend einer Öffnungszeit ändern \nkann, wird dieser aif Einmal Für jedes\noffene Fenster über eine Std. begrenzt.","x":1550,"y":2460,"wires":[]},{"id":"ca67408e9ed40006","type":"server-state-changed","z":"718b73456bed19b0","name":"Counter zurücksetzen","server":"64eac69f.fe1218","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.hmip_fensterkontakt_mit_magnet_w","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"reset","propertyType":"msg","value":"reset","valueType":"str"}],"x":520,"y":2440,"wires":[["9051c45f4d583f4b"],[]]},{"id":"691fb2c3475a8285","type":"comment","z":"718b73456bed19b0","name":"Parameter abfragen","info":"","x":1836.3154296875,"y":2243.31201171875,"wires":[]},{"id":"1cac20bf5ae8af22","type":"comment","z":"718b73456bed19b0","name":"Parameter abfragen","info":"","x":2120,"y":2220,"wires":[]},{"id":"9f13106155ad3b4a","type":"comment","z":"718b73456bed19b0","name":"Parameter abfragen","info":"","x":2340,"y":2220,"wires":[]},{"id":"6b1e275319231885","type":"comment","z":"718b73456bed19b0","name":"Parameter abfragen","info":"","x":2600,"y":2220,"wires":[]},{"id":"7321a46444d9b3e8","type":"comment","z":"718b73456bed19b0","name":"§ Funktion Nodes","info":"Die drei Funktion Nods nutze ich um, die \ndifferenz, der gemessenen Temperaturen,\nim msg.payload, das der errechnete Wert\nauf 2 stellen nach Komma gerundet wird\nund um das ganze dann in den msg.payload\nzu schreiben.","x":2950,"y":2220,"wires":[]},{"id":"d47056a850049f08","type":"comment","z":"718b73456bed19b0","name":"Notifys","info":"Hier werden erstmal alle Geräte \nangertriggert, um die Message abzuspielen.","x":3670,"y":2200,"wires":[]},{"id":"612840643add6a93","type":"comment","z":"718b73456bed19b0","name":"Notify Wiederholung","info":"Hier wiederholt der Sprachzylinder, der in \ndem selben Raum wie das geöffnete Fenster\nist, alle 5 Minuten die Nachricht.","x":4450,"y":2200,"wires":[]},{"id":"cb6f38d34afb0f97","type":"inject","z":"718b73456bed19b0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":800,"y":2160,"wires":[["81f0051997b32060"]]},{"id":"64eac69f.fe1218","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]

Ich habe das ganze weder Studiert noch gelernt, bitte gebt mir Tipps und Tricks wie man das eventuell besser im Flow umsetzten kann. Gerade das mit den Drei Funktion Nodes denke ich das es bestimmt besser umzusetzen ist. Mir leider noch nicht bekannt.

Schöne Grüße von der Ostsee
Basti

Antworten