Skip to content

Instantly share code, notes, and snippets.

@markusvankempen
Created September 23, 2020 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markusvankempen/c182e2731cd30550b6e645198820167b to your computer and use it in GitHub Desktop.
Save markusvankempen/c182e2731cd30550b6e645198820167b to your computer and use it in GitHub Desktop.
Weather Underground Raw PWD Data Update
[{"id":"5675c6cf.d139e8","type":"tab","label":"WU Flow","disabled":false,"info":""},{"id":"304fb3fd.ffb6ac","type":"http request","z":"5675c6cf.d139e8","name":"Post to WU","method":"POST","ret":"txt","paytoqs":false,"url":"","tls":"","persist":false,"proxy":"","authType":"","x":610,"y":400,"wires":[["86b6b307.a04d4"]]},{"id":"446ae5e6.81bc6c","type":"function","z":"5675c6cf.d139e8","name":"Craete URL","func":"pwsid= flow.get(\"pwdid\");\npwspw= flow.get(\"pwdpw\");\nif(pwsid === undefined)\n{\nnode.warn(\"Please set PWS id and Password/key 1st!\")\nreturn null\n}\nvar str = \"https://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=\"+pwsid+\"&PASSWORD=\"+pwspw\nstr += \"&dateutc=now\";\nstr += \"&tempf=\";\nstr += flow.get(\"tempf\");\nstr += \"&humidity=\";\nstr += flow.get(\"humidity\");\nstr += \"&windspeedmph=\";\nstr += flow.get(\"windspeedmph\");\nstr += \"&rainin=\";\nstr += flow.get(\"rainin\");\nstr += \"&winddir=\";\nstr += flow.get(\"winddir\");\nstr += \"&uv=\";\nstr += flow.get(\"uv\");\nstr += \"&solarradiation=\";\nstr += flow.get(\"solarradiation\");\nstr += \"&action=updateraw\";\nstr += \"&realtime=1&rtfreq=30\"\nmsg.time=Date.now()\nmsg.url = str\n\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":400,"wires":[["304fb3fd.ffb6ac","7041683.98e9398"]]},{"id":"22126ed.0674b92","type":"inject","z":"5675c6cf.d139e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":400,"wires":[["446ae5e6.81bc6c"]]},{"id":"7041683.98e9398","type":"debug","z":"5675c6cf.d139e8","name":"RawUpdateToWU","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":630,"y":440,"wires":[]},{"id":"86b6b307.a04d4","type":"debug","z":"5675c6cf.d139e8","name":"to WU","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":810,"y":400,"wires":[]},{"id":"9ec5b11.b39075","type":"function","z":"5675c6cf.d139e8","name":"SetFlow Vars With Random Weather Data","func":"/*\ntime: \"2020-09-19 13:32:33\"\nmodel: \"Acurite-Atlas\"\nid: 889\nchannel: \"A\"\nsequence_num: 1\nbattery_ok: 1\nsubtype: 5\nwind_avg_mi_h: 2\ntemperature_F: 69.9\nhumidity: 46\nexception: 0\nraw_msg: \"c779c581884b2e87\"\ntemperature_C: 21.06\n*/\nmsg={}\nmsg.payload={}\nmsg.payload.temperature_F=Math.floor(Math.random() * 100); \nmsg.payload.humidity=Math.floor(Math.random() * 100);\nmsg.payload.wind_avg_mi_h=Math.floor(Math.random() * 100);\n\nflow.set(\"tempf\",msg.payload.temperature_F)\nflow.set(\"lastmsg\",Date.now())\nflow.set(\"humidity\",msg.payload.humidity)\n//flow.set(\"windspeedmph\",msg.payload.wind_avg_mi_h)\n/*\n{\"time\":\"2020-09-19 13:55:13\",\n\"model\":\"Acurite-Atlas\",\"id\":889,\n\"channel\":\"A\",\"sequence_num\":2,\n\"battery_ok\":1,\"subtype\":6,\"\nwind_avg_mi_h\":2,\n\"wind_dir_deg\":93,\n\"rain_in\":0,\"exception\":0,\"raw_msg\":\"cb79c68182740081\"}\n\n*/\nmsg.payload.rain_in=Math.floor(Math.random() * 5)\nmsg.payload.wind_dir_deg=Math.floor(Math.random() * 360)\nmsg.payload.wind_avg_mi_h=Math.floor(Math.random() * 360)\nflow.set(\"rainin\",msg.payload.rain_in)\nflow.set(\"winddir\",msg.payload.wind_dir_deg)\nflow.set(\"windspeedmph\",msg.payload.wind_avg_mi_h)\n/*\ntime: \"2020-09-19 13:50:53\"\nmodel: \"Acurite-Atlas\"\nid: 889\nchannel: \"A\"\nsequence_num: 2\nbattery_ok: 1\nsubtype: 7\nwind_avg_mi_h: 2\nuv: 2\nlux: 71930\nexception: 0\n*/\n//https://cumulus.hosiene.co.uk/viewtopic.php?t=3979\nmsg.payload.lux=Math.floor(Math.random() * 1000)\nmsg.payload.uv==Math.floor(Math.random() * 10)\nsolarradiation=msg.payload.lux*0.0079\nflow.set(\"solarradiation\",solarradiation)\nflow.set(\"uv\",msg.payload.uv)\n//flow.set(\"windspeedmph\",msg.payload.wind_avg_mi_h)\n\n\n return msg;","outputs":1,"noerr":0,"x":460,"y":340,"wires":[["446ae5e6.81bc6c"]]},{"id":"3f45f560.ff6fba","type":"comment","z":"5675c6cf.d139e8","name":"TWC/WU Api / URL and Parameter infos","info":"PWS Upload Protocol\nPWS Upload Protocol\nHere is how to create a Personal Weather Station update to wunderground.com:\n\nBackground\nTo upload a weather condition, you make a standard HTTP GET request with the ID, PASSWORD and weather conditions as GET parameters\nURL\nHere is the URL used in the uploading (if you browse here without parameters you will get a brief usage):\nhttps://weatherstation.wunderground.com/weatherstation/updateweatherstation.php\n \nGET parameters\nNOT all fields need to be set, the _required_ elements are:\nID\nPASSWORD \ndateutc\nIMPORTANT all fields must be url escaped\nreference http://www.w3schools.com/tags/ref_urlencode.asp\nexample\n 2001-01-01 10:32:35\n becomes\n 2000-01-01+10%3A32%3A35\nif the weather station is not capable of producing a timestamp, our system will accept \"now\". Example:\ndateutc=now\nlist of fields:\naction [action=updateraw] -- always supply this parameter to indicate you are making a weather observation upload\nID [ID as registered by wunderground.com]\nPASSWORD [Station Key registered with this PWS ID, case sensitive]\ndateutc - [YYYY-MM-DD HH:MM:SS (mysql format)] In Universal Coordinated Time (UTC) Not local time\nwinddir - [0-360 instantaneous wind direction]\nwindspeedmph - [mph instantaneous wind speed]\nwindgustmph - [mph current wind gust, using software specific time period]\nwindgustdir - [0-360 using software specific time period]\nwindspdmph_avg2m - [mph 2 minute average wind speed mph]\nwinddir_avg2m - [0-360 2 minute average wind direction]\nwindgustmph_10m - [mph past 10 minutes wind gust mph ]\nwindgustdir_10m - [0-360 past 10 minutes wind gust direction]\nhumidity - [% outdoor humidity 0-100%]\ndewptf- [F outdoor dewpoint F]\ntempf - [F outdoor temperature]\n* for extra outdoor sensors use temp2f, temp3f, and so on\nrainin - [rain inches over the past hour)] -- the accumulated rainfall in the past 60 min\ndailyrainin - [rain inches so far today in local time]\nbaromin - [barometric pressure inches]\nweather - [text] -- metar style (+RA)\nclouds - [text] -- SKC, FEW, SCT, BKN, OVC\nsoiltempf - [F soil temperature]\n* for sensors 2,3,4 use soiltemp2f, soiltemp3f, and soiltemp4f\nsoilmoisture - [%]\n* for sensors 2,3,4 use soilmoisture2, soilmoisture3, and soilmoisture4\nleafwetness - [%]\n+ for sensor 2 use leafwetness2\nsolarradiation - [W/m^2]\nUV - [index]\nvisibility - [nm visibility]\nindoortempf - [F indoor temperature F]\nindoorhumidity - [% indoor humidity 0-100]\nPollution Fields:\nAqNO - [ NO (nitric oxide) ppb ]\nAqNO2T - (nitrogen dioxide), true measure ppb\nAqNO2 - NO2 computed, NOx-NO ppb\nAqNO2Y - NO2 computed, NOy-NO ppb\nAqNOX - NOx (nitrogen oxides) - ppb\nAqNOY - NOy (total reactive nitrogen) - ppb\nAqNO3 -NO3 ion (nitrate, not adjusted for ammonium ion) UG/M3\nAqSO4 -SO4 ion (sulfate, not adjusted for ammonium ion) UG/M3\nAqSO2 -(sulfur dioxide), conventional ppb\nAqSO2T -trace levels ppb\nAqCO -CO (carbon monoxide), conventional ppm\nAqCOT -CO trace levels ppb\nAqEC -EC (elemental carbon) – PM2.5 UG/M3\nAqOC -OC (organic carbon, not adjusted for oxygen and hydrogen) – PM2.5 UG/M3\nAqBC -BC (black carbon at 880 nm) UG/M3\nAqUV-AETH -UV-AETH (second channel of Aethalometer at 370 nm) UG/M3\nAqPM2.5 - PM2.5 mass - UG/M3\nAqPM10 - PM10 mass - PM10 mass\nAqOZONE - Ozone - ppb\nsoftwaretype - [text] ie: WeatherLink, VWS, WeatherDisplay\n\nExample URL\nHere is an example of a full URL:\nhttps://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=KCASANFR5&PASSWORD=XXXXXX&dateutc=2000-01-01+10%3A32%3A35&winddir=230&windspeedmph=12&windgustmph=12&tempf=70&rainin=0&baromin=29.1&dewptf=68.2&humidity=90&weather=&clouds=&softwaretype=vws%20versionxx&action=updateraw\nNOTE: not all fields need to be set\nResponse Text\nThe response from an HTTP GET request contains some debugging data.\nRESPONSES and MEANINGS:\nresponse\n\"success\"\nthe observation was ingested successfully\nresponse\n\"INVALIDPASSWORDID|Password and/or id are incorrect\"\ninvalid user data entered in the ID and PASSWORD GET parameters\nresponse\n<b>RapidFire Server</b><br><br>\n<b>usage</b><br>\nthe minimum GET parameters ID, PASSWORD (Station Key registered with this PWS ID, case sensitive), action, and dateutc were not set\nRapidFire Updates\nRapidFire Updates allow you to update weather station conditions at a frequency up to once observation every 2.5 seconds. Web site visitors will see these observations change in real-time on the wunderground.com site.\nA real-time update should look almost like the standard update.\nHowever, the server to request is:\nrtupdate.wunderground.com, not weatherstation.wunderground.com\nAnd, please add to the query string:\n&realtime=1&rtfreq=2.5\nwhere rtrfreq is the frequency of updates in seconds.\nhere is an example:\nhttps://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?ID=KCASANFR5&PASSWORD=XXXXXX&dateutc=2000-01-01+10%3A32%3A35&winddir=230&windspeedmph=12&windgustmph=12&tempf=70&rainin=0&baromin=29.1&dewptf=68.2&humidity=90&weather=&clouds=&softwaretype=vws%20versionxx&action=updateraw&realtime=1&rtfreq=2.5\nAlert\nCan","x":220,"y":180,"wires":[]},{"id":"dec325d0.f65ec8","type":"function","z":"5675c6cf.d139e8","name":"Create URL/Parameter","func":"var str = \"https://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=IRIVER22&PASSWORD=hKiHuzsa\"\nstr += \"&dateutc=now\";\nstr += \"&tempf=\";\nstr += flow.get(\"tempf\");\nstr += \"&humidity=\";\nstr += flow.get(\"humidity\");\nstr += \"&windspeedmph=\";\nstr += flow.get(\"windspeedmph\");\nstr += \"&rainin=\";\nstr += flow.get(\"rainin\");\nstr += \"&winddir=\";\nstr += flow.get(\"winddir\");\nstr += \"&uv=\";\nstr += flow.get(\"uv\");\nstr += \"&solarradiation=\";\nstr += flow.get(\"solarradiation\");\nstr += \"&action=updateraw\";\nstr += \"&realtime=1&rtfreq=30\"\nmsg.lastmsg=flow.get(\"lastmsg\")\nmsg.url = str\nmsg.payload = str.split(\"&\");\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":500,"wires":[["a59804ea.fb14f8"]]},{"id":"e0b1fe0.0d741","type":"inject","z":"5675c6cf.d139e8","name":"Debug","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":500,"wires":[["dec325d0.f65ec8"]]},{"id":"a59804ea.fb14f8","type":"debug","z":"5675c6cf.d139e8","name":"Show WU Url and Parameter","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":660,"y":500,"wires":[]},{"id":"8b2ad915.5262e8","type":"comment","z":"5675c6cf.d139e8","name":"This is a Flow to send Raw data to Weather Underground","info":"","x":270,"y":60,"wires":[]},{"id":"217db527.7e1d9a","type":"inject","z":"5675c6cf.d139e8","name":"GenerateData","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":340,"wires":[["9ec5b11.b39075"]]},{"id":"7f02aeaa.a2689","type":"comment","z":"5675c6cf.d139e8","name":"https://www.wunderground.com/member/devices","info":"","x":490,"y":120,"wires":[]},{"id":"aa3045fb.3cceb8","type":"comment","z":"5675c6cf.d139e8","name":"Create a Device/PWS here ","info":"","x":170,"y":120,"wires":[]},{"id":"e66a5f6b.536fc","type":"comment","z":"5675c6cf.d139e8","name":"Adjust the Station ID & Password >>> ","info":"https://www.wunderground.com/member/devices","x":210,"y":240,"wires":[]},{"id":"d8cdeb9c.274d28","type":"function","z":"5675c6cf.d139e8","name":"Set PWSID and Password on the flow ","func":"pwsid= flow.set(\"pwdid\",\"\");// Example ITORON113\t...\npwspw= flow.set(\"pwdpw\",\"\");\npwsid= flow.get(\"pwdid\");\npwspw= flow.get(\"pwdpw\");\nif(pwsid === undefined)\n{\nnode.warn(\"Please set PWS id and Password/key 1st!\")\nreturn null\n}\nmsg.payload=\"PWD ID set !\"\nreturn msg;","outputs":1,"noerr":0,"x":690,"y":240,"wires":[["cc322fa5.30b1b"]]},{"id":"ce0cad74.21ca","type":"inject","z":"5675c6cf.d139e8","name":"Run 1st","topic":"Set PWDIS and Password","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":450,"y":240,"wires":[["d8cdeb9c.274d28"]]},{"id":"cc322fa5.30b1b","type":"debug","z":"5675c6cf.d139e8","name":"PwsID/Key set","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":960,"y":240,"wires":[]}]
@mash727
Copy link

mash727 commented Feb 15, 2022

Markus, flow works well and generates the random data. As I am new to node red and not SW orientation can you give me a stear on how to replace the random maths generator with the messages from my PWS that are already in node red. Thanks M

@markusvankempen
Copy link
Author

Hello @mash727 you can just change the formulas in "SetFlow Vars With Random Weather Data" with your data .
Hope it helps
Cheers

@mash727
Copy link

mash727 commented Feb 16, 2022 via email

@markusvankempen
Copy link
Author

Hello mash727

maybe post your node-red flow your image was not visible . How di you get your sensor data via http / api ? add it to the flow... will post than back how to change this. Cheers

@mash727
Copy link

mash727 commented Feb 17, 2022 via email

@mash727
Copy link

mash727 commented Feb 17, 2022

Hello Markus,
hope this is what you need,
have simply isolated just the temperatur node and connected it to your flow.
Uplad is disconnected so as not to send junk to WU.
As you see I have no idea really and would really appricate a steer.
The temp node output shows just a payload with the current value.
Many thx
Mash

[{"id":"d626068c.a66488","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"a547c1e5.02311","type":"ccu-sysvar","z":"d626068c.a66488","name":"w_temperatur","ccuConfig":"b66dd3a1.5ff8e","topic":"ReGaHSS/${Name}","change":false,"cache":true,"x":320,"y":180,"wires":[["8c0cf057.bdebf","321ad039.dcae"]]},{"id":"a920c3b4.d959c","type":"http request","z":"d626068c.a66488","name":"Post to WU","method":"POST","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":670,"y":440,"wires":[["2df5b8fb.91ee58"]]},{"id":"bb350f6e.e8e13","type":"function","z":"d626068c.a66488","name":"Craete URL","func":"pwsid= flow.get(\"pwdid\");\npwspw= flow.get(\"pwdpw\");\nif(pwsid === undefined)\n{\nnode.warn(\"Please set PWS id and Password/key 1st!\")\nreturn null\n}\nvar str = \"https://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=\"+pwsid+\"&PASSWORD=\"+pwspw\nstr += \"&dateutc=now\";\nstr += \"&tempf=\";\nstr += flow.get(\"tempf\");\nstr += \"&humidity=\";\nstr += flow.get(\"humidity\");\nstr += \"&windspeedmph=\";\nstr += flow.get(\"windspeedmph\");\nstr += \"&rainin=\";\nstr += flow.get(\"rainin\");\nstr += \"&winddir=\";\nstr += flow.get(\"winddir\");\nstr += \"&uv=\";\nstr += flow.get(\"uv\");\nstr += \"&solarradiation=\";\nstr += flow.get(\"solarradiation\");\nstr += \"&action=updateraw\";\nstr += \"&realtime=1&rtfreq=30\"\nmsg.time=Date.now()\nmsg.url = str\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":430,"y":440,"wires":[[]]},{"id":"2df5b8fb.91ee58","type":"debug","z":"d626068c.a66488","name":"to WU","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":870,"y":440,"wires":[]},{"id":"a17756ce.9a4a98","type":"function","z":"d626068c.a66488","name":"Create URL/Parameter","func":"var str = \"https://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=IRIVER22&PASSWORD=hKiHuzsa\"\nstr += \"&dateutc=now\";\nstr += \"&tempf=\";\nstr += flow.get(\"tempf\");\nstr += \"&humidity=\";\nstr += flow.get(\"humidity\");\nstr += \"&windspeedmph=\";\nstr += flow.get(\"windspeedmph\");\nstr += \"&rainin=\";\nstr += flow.get(\"rainin\");\nstr += \"&winddir=\";\nstr += flow.get(\"winddir\");\nstr += \"&uv=\";\nstr += flow.get(\"uv\");\nstr += \"&solarradiation=\";\nstr += flow.get(\"solarradiation\");\nstr += \"&action=updateraw\";\nstr += \"&realtime=1&rtfreq=30\"\nmsg.lastmsg=flow.get(\"lastmsg\")\nmsg.url = str\nmsg.payload = str.split(\"&\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":540,"wires":[["dc0e0a1.f3340f8"]]},{"id":"55fd1703.67db88","type":"inject","z":"d626068c.a66488","name":"Debug","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":190,"y":540,"wires":[["a17756ce.9a4a98"]]},{"id":"dc0e0a1.f3340f8","type":"debug","z":"d626068c.a66488","name":"Show WU Url and Parameter","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":720,"y":540,"wires":[]},{"id":"5cb43e09.b7172","type":"inject","z":"d626068c.a66488","name":"GenerateData","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":360,"wires":[[]]},{"id":"d3c92ae4.3a0da8","type":"function","z":"d626068c.a66488","name":"Set PWSID and Password on the flow ","func":"pwsid= flow.set(\"pwdid\",\"IMNCHS14\");// Example ITORON113\t...\npwspw= flow.set(\"pwdpw\",\"XXXXX\");\npwsid= flow.get(\"pwdid\");\npwspw= flow.get(\"pwdpw\");\nif(pwsid === undefined)\n{\nnode.warn(\"Please set PWS id and Password/key 1st!\")\nreturn null\n}\nmsg.payload=\"PWD ID set !\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":750,"y":280,"wires":[["1bfdcc1b.b5bad4"]]},{"id":"c55c31d8.17e9d","type":"inject","z":"d626068c.a66488","name":"Run 1st","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Set PWDIS and Password","payload":"","payloadType":"date","x":510,"y":280,"wires":[["d3c92ae4.3a0da8"]]},{"id":"1bfdcc1b.b5bad4","type":"debug","z":"d626068c.a66488","name":"PwsID/Key set","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1020,"y":280,"wires":[]},{"id":"38342d79.736fb2","type":"debug","z":"d626068c.a66488","name":"RawUpdateToWU","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":870,"y":380,"wires":[]},{"id":"8c0cf057.bdebf","type":"function","z":"d626068c.a66488","name":"SetFlow Vars With Random Weather Data","func":"/*\ntime: \"2020-09-19 13:32:33\"\nmodel: \"Acurite-Atlas\"\nid: 889\nchannel: \"A\"\nsequence_num: 1\nbattery_ok: 1\nsubtype: 5\nwind_avg_mi_h: 2\ntemperature_F: 0\nhumidity: 46\nexception: 0\nraw_msg: \"c779c581884b2e87\"\ntemperature_C: 21.06\n*/\ntopic=(\"ReGaHSS/w_temperatur\")\n\nmsg={}\nmsg.payload={}\n\nmsg.payload.temperature_F=topic(\"ReGaHSS/w_temperatur\").value(); \nmsg.payload.humidity=topic(\"w_feuchte_rel\").Value();\nmsg.payload.wind_avg_mi_h=Math.floor(Math.random() * 100);\n\nflow.set(\"tempf\",msg.payload.temperature_F)\nflow.set(\"lastmsg\",Date.now())\nflow.set(\"humidity\",msg.payload.humidity)\n//flow.set(\"windspeedmph\",msg.payload.wind_avg_mi_h)\n/*\n{\"time\":\"2020-09-19 13:55:13\",\n\"model\":\"Acurite-Atlas\",\"id\":889,\n\"channel\":\"A\",\"sequence_num\":2,\n\"battery_ok\":1,\"subtype\":6,\"\nwind_avg_mi_h\":2,\n\"wind_dir_deg\":93,\n\"rain_in\":0,\"exception\":0,\"raw_msg\":\"cb79c68182740081\"}\n\n*/\nmsg.payload.rain_in=Math.floor(Math.random() * 5)\nmsg.payload.wind_dir_deg=Math.floor(Math.random() * 360)\nmsg.payload.wind_avg_mi_h=Math.floor(Math.random() * 360)\nflow.set(\"rainin\",msg.payload.rain_in)\nflow.set(\"winddir\",msg.payload.wind_dir_deg)\nflow.set(\"windspeedmph\",msg.payload.wind_avg_mi_h)\n/*\ntime: \"2020-09-19 13:50:53\"\nmodel: \"Acurite-Atlas\"\nid: 889\nchannel: \"A\"\nsequence_num: 2\nbattery_ok: 1\nsubtype: 7\nwind_avg_mi_h: 2\nuv: 2\nlux: 71930\nexception: 0\n*/\n//https://cumulus.hosiene.co.uk/viewtopic.php?t=3979\nmsg.payload.lux=Math.floor(Math.random() * 1000)\nmsg.payload.uv==Math.floor(Math.random() * 10)\nsolarradiation=msg.payload.lux*0.0079\nflow.set(\"solarradiation\",solarradiation)\nflow.set(\"uv\",msg.payload.uv)\n//flow.set(\"windspeedmph\",msg.payload.wind_avg_mi_h)\n\n\n return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":360,"wires":[["bb350f6e.e8e13","38342d79.736fb2"]]},{"id":"321ad039.dcae","type":"debug","z":"d626068c.a66488","name":"temperatur","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":180,"wires":[]},{"id":"b66dd3a1.5ff8e","type":"ccu-connection","name":"192.168.178.50","host":"192.168.178.50","regaEnabled":true,"bcrfEnabled":true,"iprfEnabled":true,"virtEnabled":true,"bcwiEnabled":false,"cuxdEnabled":false,"regaPoll":true,"regaInterval":"30","rpcPingTimeout":"60","rpcInitAddress":"","rpcServerHost":"192.168.1.129","rpcBinPort":"2068","rpcXmlPort":"2069","tls":false,"inSecure":false,"authentication":false,"username":"","password":"","queueTimeout":"5000","queuePause":"250","contextStore":""}]

@markusvankempen
Copy link
Author

hi Mash727 ... looks like the ccu node sysvar does not give you a temperature value
See documentatio https://flows.nodered.org/node/node-red-contrib-ccu
You may have to check the other ccu notes like getvalue ... maybe reachout to the owner of node-red-contrib-ccu to get a demo node-red flow?

i can not see if you would get data from

topic("ReGaHSS/w_temperatur").value();

you can check via node.warn(topic("ReGaHSS/w_temperatur").value();)

anyway i would ask the node-red-contrib-ccu own for a demo flow 1st

sysvar
msg.payload=
{
"ccu": "localhost",
"iface": "ReGaHSS",
"type": "SYSVAR",
"name": "Anwesenheit",
"payload": false,
"value": false,
"valueType": "boolean",
"valueEnum": "nicht anwesend",
"ts": 1525197999611,
"lc": 1525197999611,
"enum": ["nicht anwesend", "anwesend"],
"id": 950,
"topic": "ReGaHSS/Anwesenheit"
}

@mash727
Copy link

mash727 commented Feb 17, 2022 via email

@markusvankempen
Copy link
Author

Hello mash

can you send me an example payload/msg object of of the ccu.
all you have to do if you have the value just add it to

msg1.payload.temperature_F=YOURTEMPERATURE - in Fahrenheit
you may want to convert you Celsius Temperature to fahrenheit via since WU want it in Fahrenheit
C to F
msg1.payload.temperature_F=(YOURTEMPERATURE)*1.8+32

hope it helps

@mash727
Copy link

mash727 commented Feb 18, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment