@golfvert est toujours de bon conseil sur Node Red, suis plutôt ses conseils mais je te donne tout de même une solution avec les variables globales, ici l’addition de deux températures.
Le flow à importer que je ne sais toujours pas mettre sur une ligne ! :
Bob
[{« id »:« 01a63541077d22de »,« type »:« function »,« z »:« 6cefb841c43b034d »,« name »:« »,« func »:« msg.payload = msg.payload;\nvar temp1 = global.get(‹ val1 ›);\nvar temp2 = global.get(‹ val2 ›);\nvar addtemp = temp1 + temp2;\n\nmsg.payload = Number(addtemp);\nreturn msg; »,« outputs »:1,« noerr »:0,« initialize »:« »,« finalize »:« »,« libs »:[],« x »:900,« y »:160,« wires »:[[« 8cbcbaedda1c1c4e »]]},{« id »:« 8cbcbaedda1c1c4e »,« type »:« debug »,« z »:« 6cefb841c43b034d »,« name »:« debug 64 »,« active »:true,« tosidebar »:true,« console »:false,« tostatus »:false,« complete »:« false »,« statusVal »:« »,« statusType »:« auto »,« x »:1140,« y »:160,« wires »:[]},{« id »:« d8cd1fc5b7e2669f »,« type »:« api-current-state »,« z »:« 6cefb841c43b034d »,« name »:« »,« server »:« 443ff1c5.63d78 »,« version »:3,« outputs »:1,« halt_if »:« »,« halt_if_type »:« str »,« halt_if_compare »:« is »,« entity_id »:« sensor.psalon_temperature »,« state_type »:« num »,« blockInputOverrides »:false,« outputProperties »:[{« property »:« payload »,« propertyType »:« msg »,« value »:« »,« valueType »:« entityState »},{« property »:« data »,« propertyType »:« msg »,« value »:« »,« valueType »:« entity »},{« property »:« t1 »,« 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 »:380,« y »:140,« wires »:[[« 0cbfed6f285f7813 »]]},{« id »:« cfef959b2fcdecfd »,« type »:« api-current-state »,« z »:« 6cefb841c43b034d »,« name »:« »,« server »:« 443ff1c5.63d78 »,« version »:3,« outputs »:1,« halt_if »:« »,« halt_if_type »:« str »,« halt_if_compare »:« is »,« entity_id »:« sensor.psalon2_temperature »,« state_type »:« num »,« blockInputOverrides »:false,« outputProperties »:[{« property »:« payload »,« propertyType »:« msg »,« value »:« »,« valueType »:« entityState »},{« property »:« data »,« propertyType »:« msg »,« value »:« »,« valueType »:« entity »},{« property »:« t2 »,« 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 »:390,« y »:200,« wires »:[[« 279a8fb74ccedeb2 »]]},{« id »:« 133ffd74ce0972ca »,« type »:« inject »,« z »:« 6cefb841c43b034d »,« name »:« »,« props »:[{« p »:« payload »},{« p »:« topic »,« vt »:« str »}],« repeat »:« »,« crontab »:« »,« once »:false,« onceDelay »:0.1,« topic »:« »,« payload »:« »,« payloadType »:« date »,« x »:120,« y »:160,« wires »:[[« d8cd1fc5b7e2669f »,« cfef959b2fcdecfd »]]},{« id »:« 49f0a545787155f8 »,« type »:« debug »,« z »:« 6cefb841c43b034d »,« name »:« debug 65 »,« active »:true,« tosidebar »:true,« console »:false,« tostatus »:false,« complete »:« payload »,« targetType »:« msg »,« statusVal »:« »,« statusType »:« auto »,« x »:1000,« y »:60,« wires »:[]},{« id »:« 8ffe6335a0b09820 »,« type »:« debug »,« z »:« 6cefb841c43b034d »,« name »:« debug 66 »,« active »:true,« tosidebar »:true,« console »:false,« tostatus »:false,« complete »:« payload »,« targetType »:« msg »,« statusVal »:« »,« statusType »:« auto »,« x »:1000,« y »:240,« wires »:[]},{« id »:« 0cbfed6f285f7813 »,« type »:« function »,« z »:« 6cefb841c43b034d »,« name »:« function 1 »,« func »:« msg.payload = msg.payload;\nglobal.set(‹ val1 ›, msg.payload);\nreturn msg; »,« outputs »:1,« noerr »:0,« initialize »:« »,« finalize »:« »,« libs »:[],« x »:700,« y »:140,« wires »:[[« 01a63541077d22de »,« 49f0a545787155f8 »]]},{« id »:« 279a8fb74ccedeb2 »,« type »:« function »,« z »:« 6cefb841c43b034d »,« name »:« function 2 »,« func »:« msg.payload = msg.payload;\nglobal.set(‹ val2 ›, msg.payload);\nreturn msg; »,« outputs »:1,« noerr »:0,« initialize »:« »,« finalize »:« »,« libs »:[],« x »:700,« y »:200,« wires »:[[« 01a63541077d22de »,« 8ffe6335a0b09820 »]]},{« id »:« 443ff1c5.63d78 »,« type »:« server »,« name »:« Home Assistant »,« version »:5,« 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 »,« enableGlobalContextStore »:true}]