Comfort Zone calculated by Temperature, Humidity, Clothing and Environment

Description

This flow uses the measurements of a temperature and humidity sensor and calculates the standardised comfort zone in relation to clothing, room conditions, metabolic rate and air circulation. It is focused on the use case of living rooms.

You can use this flow as a template for your own environment conditions, use cases and sensor setup.

Dependencies

[{"id":"f8cc4e4.08abcb","type":"ui_gauge","z":"61aa57b3.d74588","name":"Show Temperature","group":"cdcc200.969bbe","order":0,"width":"6","height":"6","gtype":"gage","title":"Temperature","label":"°C","format":"{{value}}","min":"0","max":"50","colors":["#0092b5","#00b500","#ca3838"],"seg1":"10","seg2":"30","x":910,"y":180,"wires":[]},{"id":"c80ac488.b4b508","type":"comment","z":"61aa57b3.d74588","name":"Get Temperature & Humidity","info":"","x":140,"y":120,"wires":[]},{"id":"1584e29d.e65d1d","type":"rpi-dht22","z":"61aa57b3.d74588","name":"Temperature & Humidity Sensor","topic":"Temperature","dht":"11","pintype":"2","pin":"37","x":230,"y":180,"wires":[["40005bd6.c8eb94","4815289b.5b7d78"]]},{"id":"b9339bda.dde228","type":"ui_gauge","z":"61aa57b3.d74588","name":"Show Humidity","group":"cdcc200.969bbe","order":0,"width":"6","height":"6","gtype":"wave","title":"Humidity","label":"%RH","format":"{{value}}","min":"0","max":"100","colors":["#0092b5","#00b500","#ca3838"],"seg1":"10","seg2":"30","x":900,"y":240,"wires":[]},{"id":"40005bd6.c8eb94","type":"change","z":"61aa57b3.d74588","name":"Get Humidity","rules":[{"t":"set","p":"payload","pt":"msg","to":"humidity","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Humidity","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":240,"wires":[["9953d62f.60f418"]]},{"id":"42f52f56.a5899","type":"inject","z":"61aa57b3.d74588","name":"Sensor pulse","topic":"","payload":"","payloadType":"date","repeat":"0.5","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":60,"wires":[["464a297.d5ae8d8"]]},{"id":"464a297.d5ae8d8","type":"link out","z":"61aa57b3.d74588","name":"","links":["2a686303.4a378c","d135ea4d.c340e8"],"x":235,"y":60,"wires":[]},{"id":"d135ea4d.c340e8","type":"link in","z":"61aa57b3.d74588","name":"Get Temperature & Humidity","links":["464a297.d5ae8d8"],"x":55,"y":180,"wires":[["1584e29d.e65d1d"]]},{"id":"4815289b.5b7d78","type":"change","z":"61aa57b3.d74588","name":"Save Temperature","rules":[{"t":"set","p":"state.temperature","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":180,"wires":[["f8cc4e4.08abcb"]]},{"id":"9953d62f.60f418","type":"change","z":"61aa57b3.d74588","name":"Save Humidity","rules":[{"t":"set","p":"state.humidity","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":240,"wires":[["b9339bda.dde228"]]},{"id":"a4f7980c.ef06a8","type":"comfort","z":"61aa57b3.d74588","name":"","tempField":"state.temperature","tempFieldType":"global","mrtField":"","mrtFieldType":"operative","humidityField":"state.humidity","humidityFieldType":"global","airspeedField":"0","airspeedFieldType":"num","metabolicRateField":"state.metabolic","metabolicRateFieldType":"global","clothingLevelField":"state.clothinglevel","clothingLevelFieldType":"global","comfortField":"state.comfort","comfortFieldType":"global","sensationField":"state.sensation","sensationFieldType":"global","x":160,"y":520,"wires":[["181c99a4.dd3f96","5028b222.b5098c"]]},{"id":"bc75eb2b.c7c838","type":"comment","z":"61aa57b3.d74588","name":"Get Comfort Level","info":"","x":110,"y":460,"wires":[]},{"id":"2a686303.4a378c","type":"link in","z":"61aa57b3.d74588","name":"Get Comfort Level","links":["464a297.d5ae8d8"],"x":55,"y":520,"wires":[["a4f7980c.ef06a8"]]},{"id":"56d94f9.8f6d9b","type":"ui_text","z":"61aa57b3.d74588","group":"5664af2f.e29e5","order":0,"width":"3","height":"1","name":"Display Comfort Level","label":"Comfort Level","format":"{{msg.payload | number:2}}","layout":"col-center","x":920,"y":500,"wires":[]},{"id":"181c99a4.dd3f96","type":"change","z":"61aa57b3.d74588","name":"Get Comfort Level","rules":[{"t":"set","p":"payload","pt":"msg","to":"state.comfort","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":500,"wires":[["56d94f9.8f6d9b"]]},{"id":"5028b222.b5098c","type":"change","z":"61aa57b3.d74588","name":"Get Comfort","rules":[{"t":"set","p":"payload","pt":"msg","to":"state.sensation","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":540,"wires":[["704677e1.e92088"]]},{"id":"704677e1.e92088","type":"ui_text","z":"61aa57b3.d74588","group":"5664af2f.e29e5","order":0,"width":"3","height":"1","name":"Display Comfort","label":"Sensation","format":"{{msg.payload}}","layout":"col-center","x":900,"y":540,"wires":[]},{"id":"17563110.150c9f","type":"ui_dropdown","z":"61aa57b3.d74588","name":"","label":"Metabolic Rate","place":"Select option","group":"5664af2f.e29e5","order":0,"width":0,"height":0,"passthru":true,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":600,"y":660,"wires":[["68d0f433.2368ec"]]},{"id":"940e5519.01dcf8","type":"change","z":"61aa57b3.d74588","name":"Set Metabolic Dropdown","rules":[{"t":"set","p":"options","pt":"msg","to":"[{\"Sleeping\":0.7},{\"Reclining\":0.8},{\"Sitting\":1},{\"Typing\":1.1},{\"Standing\":1.2},{\"Cooking\":1.8},{\"Cleaning\":2.7},{\"Walking - casually\":1.7},{\"Walking - slow\":2},{\"Walking - medium\":2.6},{\"Walking - fast\":3.8},{\"Working - light\":2.2},{\"Working - medium\":2.7},{\"Working - heavy\":4},{\"Exercise - light\":3.4},{\"Exercise - moderate\":3.8},{\"Exercise - hard\":7}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":660,"wires":[["17563110.150c9f"]]},{"id":"75bae571.98314c","type":"inject","z":"61aa57b3.d74588","name":"Initial Metabolic Rate","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":160,"y":660,"wires":[["940e5519.01dcf8"]]},{"id":"b74243e3.b3a6f","type":"comment","z":"61aa57b3.d74588","name":"Configure Comfort Level","info":"","x":130,"y":600,"wires":[]},{"id":"68d0f433.2368ec","type":"change","z":"61aa57b3.d74588","name":"Set Metabolic Rate","rules":[{"t":"set","p":"state.metabolic","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":660,"wires":[[]]},{"id":"b1dc2c71.98e6e","type":"change","z":"61aa57b3.d74588","name":"Set Clothing Dropdown","rules":[{"t":"set","p":"options","pt":"msg","to":"[{\"Naked\":0},{\"Summer indoor\":0.5},{\"Winter indoor\":1},{\"Sweat pants and sweatshirt\":0.74},{\"Sports wear\":0.36},{\"Business Suit - light\":0.79},{\"Business Suit - heavy\":1.02},{\"Coveralls\":0.72},{\"Hospital Gown\":0.31},{\"Pyjamas - short\":0.42},{\"Pyjamas - long\":0.57}]","tot":"json"},{"t":"set","p":"clothingAddOns","pt":"flow","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":720,"wires":[["a7366ec9.de69b"]]},{"id":"e2344439.4737d8","type":"inject","z":"61aa57b3.d74588","name":"Initial Clothing","topic":"","payload":"0.57","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":140,"y":720,"wires":[["b1dc2c71.98e6e"]]},{"id":"a7366ec9.de69b","type":"ui_dropdown","z":"61aa57b3.d74588","name":"","label":"Clothing","place":"Select option","group":"5664af2f.e29e5","order":0,"width":0,"height":0,"passthru":true,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":580,"y":720,"wires":[["65025c39.909584"]]},{"id":"65025c39.909584","type":"change","z":"61aa57b3.d74588","name":"Set Clothing","rules":[{"t":"set","p":"state.clothing","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":720,"wires":[["aaec160a.f86d68"]]},{"id":"f4099a08.72cc28","type":"ui_switch","z":"61aa57b3.d74588","name":"","label":"Blanket","group":"5664af2f.e29e5","order":0,"width":"3","height":"1","passthru":false,"decouple":"false","topic":"","style":"","onvalue":"0.2","onvalueType":"num","onicon":"","oncolor":"","offvalue":"-0.2","offvalueType":"num","officon":"","offcolor":"","x":580,"y":780,"wires":[["a1ec1e2e.0bfd1"]]},{"id":"aaec160a.f86d68","type":"change","z":"61aa57b3.d74588","name":"Set Clothing Level","rules":[{"t":"set","p":"state.clothinglevel","pt":"global","to":"$globalContext(\"state.clothing\") + $flowContext(\"clothingAddOns\")","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"state.clothinglevel","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":720,"wires":[[]]},{"id":"a1ec1e2e.0bfd1","type":"change","z":"61aa57b3.d74588","name":"Add On Clothing","rules":[{"t":"set","p":"clothingAddOns","pt":"flow","to":"$flowContext(\"clothingAddOns\") + msg.payload","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":780,"wires":[["aaec160a.f86d68"]]},{"id":"4d779e8c.3dc6a","type":"ui_switch","z":"61aa57b3.d74588","name":"","label":"Sheet","group":"5664af2f.e29e5","order":0,"width":"3","height":"1","passthru":false,"decouple":"false","topic":"","style":"","onvalue":"0.1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"-0.1","offvalueType":"num","officon":"","offcolor":"","x":570,"y":840,"wires":[["a1ec1e2e.0bfd1"]]},{"id":"8537004e.511","type":"ui_switch","z":"61aa57b3.d74588","name":"","label":"Chair","group":"5664af2f.e29e5","order":0,"width":"3","height":"1","passthru":false,"decouple":"false","topic":"","style":"","onvalue":"0.01","onvalueType":"num","onicon":"","oncolor":"","offvalue":"-0.01","offvalueType":"num","officon":"","offcolor":"","x":570,"y":900,"wires":[["a1ec1e2e.0bfd1"]]},{"id":"f05cc684.097048","type":"ui_switch","z":"61aa57b3.d74588","name":"","label":"Armchair","group":"5664af2f.e29e5","order":0,"width":"3","height":"1","passthru":false,"decouple":"false","topic":"","style":"","onvalue":"0.25","onvalueType":"num","onicon":"","oncolor":"","offvalue":"-0.25","offvalueType":"num","officon":"","offcolor":"","x":580,"y":960,"wires":[["a1ec1e2e.0bfd1"]]},{"id":"d7560887.d5c378","type":"ui_switch","z":"61aa57b3.d74588","name":"","label":"Coat","group":"5664af2f.e29e5","order":0,"width":"3","height":"1","passthru":false,"decouple":"false","topic":"","style":"","onvalue":"0.6","onvalueType":"num","onicon":"","oncolor":"","offvalue":"-0.6","offvalueType":"num","officon":"","offcolor":"","x":570,"y":1020,"wires":[["a1ec1e2e.0bfd1"]]},{"id":"cdcc200.969bbe","type":"ui_group","z":"","name":"Conditions","tab":"9cb4eb1e.6f02b8","order":1,"disp":true,"width":"18","collapse":false},{"id":"5664af2f.e29e5","type":"ui_group","z":"","name":"Comfort","tab":"9cb4eb1e.6f02b8","disp":true,"width":"6","collapse":false},{"id":"9cb4eb1e.6f02b8","type":"ui_tab","z":"","name":"Sensors","icon":"dashboard","order":3}]

Flow Info

Created 7 years, 8 months ago
Updated 7 years, 1 month ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x11)
  • comment (x3)
  • inject (x3)
  • link in (x2)
  • link out (x1)
Other

Tags

  • comfort
  • comfortzone
  • sensors
  • temperature
  • humidity
  • raspberrypi
  • raspi
  • dashboard
  • dht11
  • dht22
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option