Stoper Node Red

Witam

Mam taki mały problemem mam nadzieje ze pomożecie mi go rozwiązać. Znalazłem w sieci taki flow który ma służyć jako stoper.


I chciałbym żeby ten czas wyświetlał mi się w HA jako sensor.
Jak widać w debug jest ten czas i teraz pytanie co mam ustawić w nodze entity żeby pokazał mi ten czas w HA ?

[{"id":"9f9165b1.212818","type":"tab","label":"czas dzialania pralki","disabled":false,"info":""},{"id":"92109e0a.88d96","type":"hourglass","z":"9f9165b1.212818","name":"","humanizeLocale":"","x":740,"y":140,"wires":[["f6e6d040.cd42","987737aa.83b468"]]},{"id":"5a0a72af.5c5fc4","type":"change","z":"9f9165b1.212818","name":"{command:'reset'}","rules":[{"t":"set","p":"command","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":453,"y":240,"wires":[["5f57def2.775bb","92109e0a.88d96"]]},{"id":"cfff0e2d.ada0e8","type":"change","z":"9f9165b1.212818","name":"{command:'start'}","rules":[{"t":"set","p":"command","pt":"msg","to":"start","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":451,"y":140,"wires":[["5f57def2.775bb","92109e0a.88d96"]]},{"id":"a0a2d80e.88f7d","type":"change","z":"9f9165b1.212818","name":"{command:'stop'}","rules":[{"t":"set","p":"command","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":451,"y":180,"wires":[["5f57def2.775bb","92109e0a.88d96"]]},{"id":"f8480416.0850d","type":"debug","z":"9f9165b1.212818","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"elapsed.millis","targetType":"msg","statusVal":"elapsed.millis","statusType":"auto","x":1090,"y":200,"wires":[]},{"id":"5f57def2.775bb","type":"debug","z":"9f9165b1.212818","name":"last command","active":false,"tosidebar":false,"console":false,"tostatus":true,"complete":"command","targetType":"msg","statusVal":"command","statusType":"auto","x":750,"y":200,"wires":[]},{"id":"5d200463.e6e644","type":"inject","z":"9f9165b1.212818","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":239,"y":180,"wires":[["a0a2d80e.88f7d"]]},{"id":"894f06df.59219","type":"inject","z":"9f9165b1.212818","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":239,"y":240,"wires":[["5a0a72af.5c5fc4"]]},{"id":"f8935576.4a4ae","type":"inject","z":"9f9165b1.212818","name":"","props":[{"p":"payload","v":"","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":239,"y":140,"wires":[["cfff0e2d.ada0e8"]]},{"id":"6384eb1d.90bca4","type":"inject","z":"9f9165b1.212818","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":239,"y":280,"wires":[["5bb3a7b5.cb8b9"]]},{"id":"5bb3a7b5.cb8b9","type":"change","z":"9f9165b1.212818","name":"{command:'status'}","rules":[{"t":"set","p":"command","pt":"msg","to":"status","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":451,"y":280,"wires":[["92109e0a.88d96","5f57def2.775bb"]]},{"id":"f6e6d040.cd42","type":"debug","z":"9f9165b1.212818","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1020,"y":120,"wires":[]},{"id":"987737aa.83b468","type":"ha-entity","z":"9f9165b1.212818","name":"","server":"f9e531b8.ef5ef","version":1,"debugenabled":true,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"czaspracyzmywarki"},{"property":"device_class","value":"sensor"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[{"property":"time","value":"payload","valueType":"num"}],"resend":false,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":970,"y":280,"wires":[["a4e7cad1.5019b8"]]},{"id":"a4e7cad1.5019b8","type":"debug","z":"9f9165b1.212818","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":300,"wires":[]},{"id":"f9e531b8.ef5ef","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

U mnie wygląda to tak :
Screenshot - 23.05.2021 , 18_42_23



Kod NR:
timer.json (1,9 KB)

Mam problem żeby zaimportować ten flow to raz. A dwa to chyba nie jest stoper tylko timer który odlicza w dół ? Czy może się mylę. Ja chciałbym żeby to działało na zasadzie stopera czyli Start jakiś przycisk i stop jakiś inny przycisk i żeby mi podał czas jaki byl pomiędzy start a stop.

Napisz może do czego to ma służyć ?

Chciałbym znać czas pracy zmywarki ile trwał jeden cykl. I próbuje to na różne sposoby zrobić już wcześniej zapytał w tym wątku.

Spróbuj tego:
licznik.json (5,7 KB)
W NR trzeba zainstalować gate node

1 Like

Dzięki właśnie testuje i podpiłem do zmywarki i zobaczę czy dobrze zlicza. Wszystko przetestowane działa jak należy dzięki serdeczne Artur.