Weather Page with real time data

Hello,
I need help in the creation of a weather page that I can fetch real time data from it. Can someone please direct me with the steps and possibly scripts and any working api that I can use. Thanks

1 Like
var = system.net.httpGet("https://api.darksky.net/forecast/*your key*/*your lattitude*,*your longitude*?exclude=alerts,flags,daily,hourly,minutely")
obj = system.util.jsonDecode(var)

var1 = obj['currently']['temperature']
var2 = obj['currently']['summary']
var3 = obj['currently']['icon']
var4 = obj['currently']['windSpeed']


paths = [
            "[default]SCADA/Weather/summary.value",
            "[default]SCADA/Weather/temp.value",
            "[default]SCADA/Weather/wind speed",
            "[default]SCADA/Weather/icon"
        ]
 
# Specify the values
values = [
            var2,
            var1,
            var4,
            var3
        ]
# Send the writes off
system.tag.writeBlocking(paths, values)

image

<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
	<defs>
		<style>
			.icon { display: none }
			.icon:target { display: inline }
		</style>
	</defs>
	<svg viewBox="0 0 24 24">
		<g class="icon" id="clear-day" transform="matrix(0.03921585,0,0,0.03974102,0.2878929,-0.00747)">
			<path transform="matrix(25.499894,0,0,25.162917,-7.3412383,0.18796699)" d="M 12.287109 0.15234375 C 11.425263 0.15234375 10.726562 0.86106609 10.726562 1.734375 L 10.726562 4.5097656 C 10.726562 5.383154 11.425223 6.0917969 12.287109 6.0917969 C 13.148956 6.0917969 13.847656 5.3831938 13.847656 4.5097656 L 13.847656 1.734375 C 13.847656 0.8609866 13.148995 0.15234375 12.287109 0.15234375 z M 5.609375 2.671875 C 5.2115302 2.6365899 4.8008222 2.7564186 4.4707031 3.0371094 C 3.8105827 3.598491 3.7253338 4.5947113 4.2792969 5.2636719 L 6.0390625 7.390625 C 6.3477305 7.7634752 6.7908753 7.9550781 7.2363281 7.9550781 C 7.5902512 7.9550781 7.9459663 7.8343984 8.2382812 7.5859375 C 8.8985193 7.0245559 8.9836506 6.0265017 8.4296875 5.3574219 L 6.6699219 3.2324219 C 6.3929403 2.8979416 6.0072198 2.7071601 5.609375 2.671875 z M 18.964844 2.671875 C 18.566984 2.7071153 18.183173 2.8959288 17.90625 3.2304688 L 16.144531 5.3574219 C 15.590647 6.0264619 15.677613 7.0244366 16.337891 7.5859375 C 16.630206 7.8345176 16.985921 7.9550781 17.339844 7.9550781 C 17.785179 7.9550781 18.226567 7.763356 18.535156 7.390625 L 20.296875 5.2636719 C 20.850838 4.5945921 20.765707 3.5986102 20.105469 3.0371094 C 19.77535 2.7565378 19.362703 2.6366347 18.964844 2.671875 z M 12.287109 7.7324219 C 9.7018437 7.7324219 7.6054687 9.8566755 7.6054688 12.476562 C 7.6054688 15.096887 9.7018437 17.220703 12.287109 17.220703 C 14.872375 17.220703 16.96875 15.096807 16.96875 12.476562 C 16.96875 9.8566755 14.872375 7.7324219 12.287109 7.7324219 z M 1.8046875 9.0292969 C 1.0790409 9.0488759 0.44340741 9.583337 0.3125 10.335938 C 0.16277388 11.195973 0.72933714 12.016277 1.578125 12.167969 L 4.2753906 12.650391 C 4.3671165 12.666843 4.4589062 12.675781 4.5488281 12.675781 C 5.2917724 12.675781 5.9484228 12.136341 6.0820312 11.369141 C 6.2317574 10.509105 5.6651941 9.6888008 4.8164062 9.5371094 L 2.1191406 9.0546875 C 2.0130225 9.0356019 1.9083513 9.0264999 1.8046875 9.0292969 z M 22.771484 9.03125 C 22.667837 9.0284091 22.563115 9.0356764 22.457031 9.0546875 L 19.757812 9.5371094 C 18.909142 9.6887214 18.342579 10.509026 18.492188 11.369141 C 18.625639 12.136341 19.284164 12.675781 20.027344 12.675781 C 20.117266 12.675781 20.209134 12.666843 20.300781 12.650391 L 22.998047 12.167969 C 23.846796 12.016396 24.413398 11.196092 24.263672 10.335938 C 24.132764 9.5834065 23.497015 9.051136 22.771484 9.03125 z M 5.5878906 14.882812 C 5.288061 14.861316 4.9791023 14.926046 4.6992188 15.089844 L 2.328125 16.478516 C 1.5816905 16.915031 1.3249948 17.882122 1.7558594 18.638672 C 2.0449194 19.146085 2.569961 19.429688 3.109375 19.429688 C 3.3740428 19.429688 3.643063 19.362493 3.8886719 19.21875 L 6.2597656 17.830078 C 7.0062001 17.393563 7.2628958 16.426352 6.8320312 15.669922 C 6.5627409 15.197053 6.0876066 14.91864 5.5878906 14.882812 z M 18.986328 14.882812 C 18.48663 14.91859 18.013504 15.197153 17.744141 15.669922 C 17.313276 16.426233 17.568136 17.393324 18.314453 17.830078 L 20.6875 19.216797 C 20.933227 19.36062 21.202129 19.429688 21.466797 19.429688 C 22.006093 19.429688 22.529417 19.146085 22.818359 18.638672 C 23.249498 17.882361 22.994521 16.91519 22.248047 16.478516 L 19.875 15.089844 C 19.595161 14.92615 19.286147 14.861346 18.986328 14.882812 z M 9.5195312 18.382812 C 8.9121997 18.414302 8.3539311 18.806356 8.1328125 19.421875 L 7.1953125 22.03125 C 6.9004877 22.851942 7.3189421 23.757987 8.1289062 24.056641 C 8.3051423 24.121577 8.4848929 24.152344 8.6621094 24.152344 C 9.2994454 24.152344 9.8983171 23.753543 10.128906 23.111328 L 11.064453 20.503906 C 11.359435 19.683294 10.942777 18.775216 10.132812 18.476562 C 9.9303509 18.401899 9.7219751 18.372316 9.5195312 18.382812 z M 15.054688 18.382812 C 14.852229 18.372327 14.64585 18.401839 14.443359 18.476562 C 13.633395 18.775335 13.215059 19.683095 13.509766 20.503906 L 14.447266 23.111328 C 14.677894 23.753543 15.276491 24.152344 15.914062 24.152344 C 16.0912 24.152344 16.271147 24.121577 16.447266 24.056641 C 17.25723 23.757987 17.673613 22.851942 17.378906 22.03125 L 16.443359 19.421875 C 16.222329 18.806356 15.662063 18.414269 15.054688 18.382812 z "/>
		</g>
	</svg>
	<svg viewBox="0 0 24 24">
		<g class="icon" id="rain"  transform="matrix(0.04687509,0,0,0.046875,17.356919,19.389873)">
			<path transform="matrix(21.333334,0,0,21.333375,-370.28023,-413.65062)" d="M 12.099609 0.21484375 C 9.024797 0.21484375 6.4823594 2.5392402 6.1386719 5.5234375 C 5.8787031 5.4842032 5.6155312 5.4648438 5.3496094 5.4648438 C 2.4547501 5.4648437 0.099609375 7.81999 0.099609375 10.714844 C 0.099609375 13.609697 2.4547501 15.964844 5.3496094 15.964844 L 18.849609 15.964844 C 21.744469 15.964844 24.099609 13.609697 24.099609 10.714844 C 24.099609 7.81999 21.744469 5.4648438 18.849609 5.4648438 C 18.583688 5.4648437 18.318562 5.4842032 18.058594 5.5234375 C 17.714906 2.5392402 15.174422 0.21484375 12.099609 0.21484375 z M 12.099609 1.7148438 C 14.580937 1.7148438 16.599609 3.7335205 16.599609 6.2148438 C 16.599609 6.2943436 16.597359 6.3649376 16.59375 6.4316406 C 16.580016 6.682187 16.691625 6.9219847 16.892578 7.0722656 C 17.093578 7.2225935 17.357313 7.2636873 17.59375 7.1796875 C 17.995375 7.0370003 18.418172 6.9648438 18.849609 6.9648438 C 20.917359 6.9648437 22.599609 8.6470978 22.599609 10.714844 C 22.599609 12.78259 20.917359 14.464844 18.849609 14.464844 L 5.3496094 14.464844 C 3.2818594 14.464844 1.5996094 12.78259 1.5996094 10.714844 C 1.5996094 8.6470978 3.2818594 6.9648438 5.3496094 6.9648438 C 5.7810469 6.9648438 6.2019844 7.0370003 6.6035156 7.1796875 C 6.8398594 7.2636405 7.1036875 7.2225935 7.3046875 7.0722656 C 7.5056875 6.9219847 7.61725 6.682187 7.6035156 6.4316406 C 7.5999063 6.3649376 7.5996094 6.2943436 7.5996094 6.2148438 C 7.5996094 3.7335205 9.6182813 1.7148438 12.099609 1.7148438 z M 6.0820312 17.285156 C 5.7949014 17.230576 5.488707 17.346965 5.3164062 17.605469 L 4.5664062 18.730469 C 4.336625 19.075093 4.4307188 19.541704 4.7753906 19.771484 C 4.9032187 19.856703 5.0464844 19.896484 5.1894531 19.896484 C 5.4317969 19.896484 5.6698906 19.779296 5.8144531 19.5625 L 6.5644531 18.4375 C 6.7942344 18.092876 6.7020937 17.628218 6.3574219 17.398438 C 6.2712773 17.341004 6.1777412 17.30335 6.0820312 17.285156 z M 12.457031 17.285156 C 12.169912 17.230576 11.863742 17.346965 11.691406 17.605469 L 10.941406 18.730469 C 10.711625 19.075093 10.805719 19.541704 11.150391 19.771484 C 11.278219 19.856703 11.421484 19.896484 11.564453 19.896484 C 11.806797 19.896484 12.044891 19.779296 12.189453 19.5625 L 12.939453 18.4375 C 13.169234 18.092876 13.077094 17.628218 12.732422 17.398438 C 12.646277 17.341004 12.552738 17.30335 12.457031 17.285156 z M 19.582031 17.285156 C 19.294906 17.230576 18.988742 17.346965 18.816406 17.605469 L 18.066406 18.730469 C 17.836625 19.075093 17.930719 19.541704 18.275391 19.771484 C 18.403219 19.856703 18.546484 19.896484 18.689453 19.896484 C 18.931797 19.896484 19.169891 19.779296 19.314453 19.5625 L 20.064453 18.4375 C 20.294234 18.092876 20.202094 17.628218 19.857422 17.398438 C 19.771266 17.341004 19.67774 17.30335 19.582031 17.285156 z M 9.0820312 18.785156 C 8.7948948 18.730583 8.488707 18.846965 8.3164062 19.105469 L 7.5664062 20.230469 C 7.336625 20.575093 7.4307188 21.041704 7.7753906 21.271484 C 7.9032187 21.356703 8.0464844 21.396484 8.1894531 21.396484 C 8.4317969 21.396484 8.6698906 21.279296 8.8144531 21.0625 L 9.5644531 19.9375 C 9.7942344 19.592876 9.7020937 19.128218 9.3574219 18.898438 C 9.2712656 18.841016 9.1777434 18.803347 9.0820312 18.785156 z M 15.832031 18.785156 C 15.544901 18.730583 15.238707 18.846965 15.066406 19.105469 L 14.316406 20.230469 C 14.086625 20.575093 14.180719 21.041704 14.525391 21.271484 C 14.653219 21.356703 14.796484 21.396484 14.939453 21.396484 C 15.181797 21.396484 15.419891 21.279296 15.564453 21.0625 L 16.314453 19.9375 C 16.544234 19.592876 16.452094 19.128218 16.107422 18.898438 C 16.021277 18.841016 15.927741 18.803347 15.832031 18.785156 z M 5.7070312 21.410156 C 5.4199014 21.355576 5.113707 21.471965 4.9414062 21.730469 L 4.1914062 22.855469 C 3.961625 23.200093 4.0557188 23.666704 4.4003906 23.896484 C 4.5282187 23.981703 4.6714844 24.021484 4.8144531 24.021484 C 5.0567969 24.021484 5.2948906 23.904296 5.4394531 23.6875 L 6.1894531 22.5625 C 6.4192344 22.217876 6.3270937 21.753218 5.9824219 21.523438 C 5.8962773 21.466004 5.8027412 21.42835 5.7070312 21.410156 z M 12.457031 21.410156 C 12.169912 21.355576 11.863742 21.471965 11.691406 21.730469 L 10.941406 22.855469 C 10.711625 23.200093 10.805719 23.666704 11.150391 23.896484 C 11.278219 23.981703 11.421484 24.021484 11.564453 24.021484 C 11.806797 24.021484 12.044891 23.904296 12.189453 23.6875 L 12.939453 22.5625 C 13.169234 22.217876 13.077094 21.753218 12.732422 21.523438 C 12.646277 21.466004 12.552738 21.42835 12.457031 21.410156 z M 19.207031 21.410156 C 18.919895 21.355576 18.613707 21.471965 18.441406 21.730469 L 17.691406 22.855469 C 17.461625 23.200093 17.555719 23.666704 17.900391 23.896484 C 18.028219 23.981703 18.171484 24.021484 18.314453 24.021484 C 18.556797 24.021484 18.794891 23.904296 18.939453 23.6875 L 19.689453 22.5625 C 19.919234 22.217876 19.827094 21.753218 19.482422 21.523438 C 19.396266 21.466004 19.302743 21.42835 19.207031 21.410156 z " />
		</g>
	</svg>
	<svg viewBox="0 0 24 24">
		<g class="icon" id="clear-night">
			<path  d="m 15.853059,23.976473 c -3.208172,0 -6.2243906,-1.24809 -8.4930476,-3.51436 -2.268843,-2.26655 -3.51839,-5.28009 -3.51839,-8.48559 0,-3.2002103 1.251984,-6.2127203 3.525422,-8.4826908 2.27175,-2.26833 5.2852966,-3.51735999 8.4860156,-3.51735999 h 0.0058 c 0.736875,3.3e-4 1.475203,0.0681 2.194453,0.20128 0.895453,0.16589 1.597828,0.8168 1.833,1.69869999 0.235172,0.88186 -0.04983,1.79602 -0.743672,2.38571 -2.270109,1.9290005 -3.572062,4.7407505 -3.572062,7.7143108 0,2.97361 1.301953,5.78536 3.572109,7.71441 0.693375,0.58921 0.978094,1.50131 0.742922,2.38031 -0.237328,0.88715 -0.946875,1.54148 -1.851703,1.70756 -0.714938,0.1312 -1.448625,0.19772 -2.180812,0.19772 z m 4.6e-5,-22.1250008 c -2.700609,0 -5.24339,1.05427 -7.1612336,2.96916 -1.918641,1.9157305 -2.97525,4.4570605 -2.97525,7.1558908 0,5.5829 4.5472026,10.12495 10.1364376,10.12495 0.618937,0 1.238812,-0.0562 1.842281,-0.16692 0.271265,-0.0498 0.355359,-0.25992 0.37889,-0.34796 0.02794,-0.10439 0.04612,-0.30384 -0.145734,-0.46687 -2.690109,-2.28595 -4.232953,-5.61853 -4.232953,-9.14325 0,-3.5246703 1.542797,-6.8572008 4.232812,-9.1431608 0.200485,-0.17039 0.168985,-0.38807 0.146157,-0.47376 -0.02287,-0.0857 -0.103969,-0.29021 -0.362813,-0.33816 -0.607172,-0.11245 -1.230844,-0.16964 -1.853765,-0.16992 -0.0015,0 -0.0034,0 -0.0048,0 z m -11.5427336,-0.5625 c 0.647203,0 1.171875,0.52467 1.171875,1.17187 0,0.64721 -0.524672,1.17188 -1.171875,1.17188 -0.6472034,0 -1.1718753,-0.52467 -1.1718753,-1.17188 0,-0.6472 0.5246719,-1.17187 1.1718753,-1.17187 z M 21.560371,15.867093 c 0,0.64721 0.524672,1.17188 1.171875,1.17188 0.647203,0 1.171875,-0.52467 1.171875,-1.17188 0,-0.6472 -0.524672,-1.17187 -1.171875,-1.17187 -0.647203,0 -1.171875,0.52467 -1.171875,1.17187 z m -2.71875,-6.3281203 c 0,0.6472003 0.524672,1.1718703 1.171875,1.1718703 0.647203,0 1.171875,-0.52467 1.171875,-1.1718703 0,-0.6472 -0.524672,-1.17188 -1.171875,-1.17188 -0.647203,0 -1.171875,0.52468 -1.171875,1.17188 z m -18.93749988,-0.98438 c 0,0.64721 0.5246719,1.17188 1.17187498,1.17188 0.6472031,0 1.171875,-0.52467 1.171875,-1.17188 0,-0.6472 -0.5246719,-1.17187 -1.171875,-1.17187 -0.64720318,0 -1.17187498,0.52467 -1.17187498,1.17187 z M 2.9978711,22.804593 c 0,0.64721 0.5246719,1.17188 1.1718753,1.17188 0.647203,0 1.171875,-0.52467 1.171875,-1.17188 0,-0.6472 -0.524672,-1.17187 -1.171875,-1.17187 -0.6472034,0 -1.1718753,0.52467 -1.1718753,1.17187 z" />
		</g>
	</svg>
	<svg viewBox="0 0 24 24">
		<g class="icon" id="snow" transform="matrix(0.052888,0,0,0.04687518,-1.5719565,0.04287494)">
			<path d="m 481.559,354.441 c -2.497,-9.318 -8.241,-17.208 -16.274,-22.422 4.814,-3.252 8.822,-7.547 11.785,-12.678 6.061,-10.504 6.84,-23.426 2.08,-34.567 -8.381,-19.625 -31.167,-28.773 -50.794,-20.392 l -46.049,19.668 -49.246,-28.432 49.246,-28.431 46.05,19.667 c 19.623,8.38 42.413,-0.767 50.793,-20.392 4.061,-9.508 4.176,-20.027 0.323,-29.621 -2.917,-7.265 -7.841,-13.338 -14.189,-17.623 8.033,-5.212 13.777,-13.103 16.275,-22.422 2.675,-9.987 1.303,-20.416 -3.867,-29.371 -10.326,-17.881 -32.867,-24.412 -51.057,-15.149 -0.409,-5.796 -2.125,-11.412 -5.087,-16.544 -6.065,-10.501 -16.867,-17.637 -28.896,-19.088 -21.187,-2.556 -40.503,12.606 -43.057,33.793 l -5.992,49.715 -49.245,28.431 v -56.094 l 40.056,-30.048 C 351.484,89.637 354.955,65.33 342.151,48.256 330.861,33.207 310.634,28.727 294.304,36.651 293.231,16.26 276.305,0 255.654,0 c -20.649,0 -37.573,16.255 -38.649,36.641 -6.884,-3.354 -14.606,-4.586 -22.357,-3.476 -10.234,1.461 -19.287,6.82 -25.49,15.09 -6.203,8.27 -8.816,18.461 -7.354,28.695 1.461,10.234 6.821,19.287 15.09,25.49 l 40.056,30.047 V 188.58 L 168.373,160.533 162.38,110.818 C 159.825,89.632 140.507,74.481 119.322,77.026 100.643,79.278 86.649,94.556 85.348,112.66 67.154,103.394 44.61,109.923 34.283,127.806 c -10.325,17.883 -4.71,40.667 12.408,51.792 -6.347,4.285 -11.273,10.358 -14.19,17.623 -3.852,9.594 -3.737,20.115 0.323,29.62 8.382,19.626 31.167,28.774 50.795,20.393 l 46.048,-19.667 48.578,28.046 -48.577,28.046 -46.05,-19.667 c -19.625,-8.382 -42.411,0.767 -50.794,20.393 -7.388,17.302 -1.153,37.06 13.874,47.24 -17.123,11.122 -22.741,33.909 -12.415,51.795 10.325,17.882 32.864,24.412 51.057,15.15 0.537,7.639 3.334,14.943 8.168,21.1 6.383,8.133 15.55,13.294 25.814,14.531 10.264,1.234 20.394,-1.598 28.527,-7.98 8.133,-6.383 13.293,-15.551 14.53,-25.815 l 5.993,-49.713 48.577,-28.046 v 56.864 l -40.056,30.047 c -8.269,6.203 -13.629,15.255 -15.09,25.49 -1.461,10.234 1.151,20.425 7.353,28.694 6.204,8.271 15.256,13.63 25.492,15.091 7.749,1.11 15.474,-0.123 22.357,-3.476 1.076,20.386 18,36.641 38.65,36.641 20.65,0 37.573,-16.255 38.651,-36.639 5.223,2.545 10.946,3.867 16.87,3.867 12.126,-0.002 23.708,-5.789 30.978,-15.482 12.803,-17.072 9.332,-41.379 -7.738,-54.184 l -40.057,-30.047 v -56.864 l 49.246,28.431 5.992,49.713 c 1.238,10.265 6.399,19.432 14.531,25.816 8.132,6.383 18.265,9.219 28.527,7.979 10.265,-1.238 19.432,-6.399 25.815,-14.531 4.832,-6.157 7.63,-13.461 8.168,-21.099 8.531,4.349 18.237,5.377 27.555,2.881 9.986,-2.676 18.332,-9.08 23.5,-18.032 5.168,-8.951 6.541,-19.38 3.866,-29.366 z m -30.023,14.263 c -1.136,1.967 -2.968,3.374 -5.161,3.961 -2.193,0.589 -4.484,0.287 -6.45,-0.849 l -23.579,-13.612 c -4.954,-2.86 -11.1,-2.676 -15.872,0.476 -4.773,3.151 -7.356,8.729 -6.672,14.409 l 2.66,22.056 c 0.273,2.254 -0.349,4.479 -1.752,6.265 -1.402,1.786 -3.416,2.92 -5.671,3.191 -2.257,0.276 -4.48,-0.349 -6.266,-1.752 -1.786,-1.402 -2.92,-3.417 -3.191,-5.671 l -6.896,-57.208 c -0.57,-4.719 -3.326,-8.895 -7.443,-11.27 l -78.436,-45.284 c -4.672,-2.698 -10.429,-2.697 -15.101,0 -4.672,2.697 -7.551,7.682 -7.551,13.077 v 90.569 c 0,4.753 2.238,9.229 6.039,12.08 l 46.096,34.577 c 3.749,2.813 4.511,8.152 1.699,11.902 -1.621,2.162 -4.108,3.402 -6.82,3.402 -1.284,0 -3.207,-0.295 -5.082,-1.701 l -17.771,-13.33 c -4.577,-3.433 -10.697,-3.984 -15.815,-1.428 -5.116,2.558 -8.348,7.787 -8.348,13.507 v 27.226 c 0,4.686 -3.813,8.5 -8.501,8.5 -4.687,0 -8.501,-3.813 -8.501,-8.5 v -27.226 c 0,-5.72 -3.232,-10.949 -8.348,-13.507 -2.137,-1.068 -4.449,-1.594 -6.751,-1.594 -3.209,0 -6.399,1.023 -9.067,3.029 l -17.77,13.329 c -1.817,1.362 -4.056,1.939 -6.303,1.615 -2.247,-0.32 -4.235,-1.497 -5.598,-3.314 -1.362,-1.817 -1.936,-4.055 -1.615,-6.303 0.32,-2.248 1.497,-4.236 3.314,-5.599 l 46.095,-34.577 c 3.801,-2.852 6.039,-7.327 6.039,-12.08 v -90.569 c 0,-5.395 -2.878,-10.379 -7.551,-13.078 -4.672,-2.698 -10.429,-2.698 -15.101,0 l -77.767,44.899 c -4.115,2.376 -6.873,6.551 -7.442,11.27 l -6.897,57.208 c -0.272,2.254 -1.405,4.269 -3.191,5.671 -1.787,1.401 -4.013,2.027 -6.266,1.752 -2.254,-0.272 -4.268,-1.405 -5.67,-3.191 -1.401,-1.787 -2.024,-4.011 -1.752,-6.266 l 2.659,-22.056 c 0.685,-5.679 -1.899,-11.257 -6.672,-14.409 -4.774,-3.152 -10.917,-3.337 -15.871,-0.476 l -23.578,13.612 c -4.059,2.343 -9.269,0.948 -11.613,-3.112 -2.344,-4.059 -0.947,-9.268 3.112,-11.612 l 23.578,-13.612 c 4.953,-2.86 7.866,-8.273 7.523,-13.984 -0.343,-5.709 -3.883,-10.737 -9.143,-12.983 l -20.43,-8.725 c -4.312,-1.84 -6.321,-6.847 -4.48,-11.157 1.842,-4.312 6.846,-6.322 11.158,-4.479 l 52.994,22.631 c 4.37,1.865 9.365,1.565 13.481,-0.81 l 77.767,-44.899 c 4.672,-2.697 7.551,-7.682 7.551,-13.078 0,-5.395 -2.878,-10.379 -7.551,-13.078 L 138.227,197.64 c -4.118,-2.379 -9.113,-2.677 -13.482,-0.81 l -52.991,22.631 c -4.312,1.843 -9.316,-0.167 -11.158,-4.479 -0.892,-2.088 -0.917,-4.398 -0.071,-6.506 0.847,-2.108 2.462,-3.758 4.551,-4.65 l 20.43,-8.725 c 5.261,-2.248 8.8,-7.274 9.143,-12.983 0.342,-5.71 -2.57,-11.123 -7.523,-13.984 L 63.548,154.522 c -4.059,-2.344 -5.456,-7.554 -3.112,-11.613 2.344,-4.059 7.553,-5.455 11.612,-3.112 l 23.578,13.613 c 4.954,2.859 11.098,2.676 15.872,-0.476 4.774,-3.152 7.356,-8.73 6.672,-14.409 l -2.659,-22.056 c -0.561,-4.655 2.769,-8.898 7.422,-9.458 4.65,-0.559 8.898,2.769 9.459,7.422 l 6.896,57.21 c 0.569,4.719 3.326,8.895 7.442,11.27 l 77.767,44.899 c 4.672,2.698 10.429,2.698 15.101,0 4.672,-2.697 7.551,-7.682 7.551,-13.078 v -89.799 c 0,-4.753 -2.238,-9.228 -6.039,-12.08 L 195.015,78.278 c -1.816,-1.363 -2.993,-3.352 -3.314,-5.599 -0.321,-2.249 0.253,-4.486 1.616,-6.304 1.362,-1.816 3.35,-2.993 5.599,-3.314 2.25,-0.32 4.486,0.253 6.302,1.615 l 17.771,13.33 c 4.575,3.433 10.699,3.984 15.814,1.428 5.116,-2.558 8.348,-7.787 8.348,-13.507 V 38.702 c 0,-4.686 3.813,-8.5 8.501,-8.5 4.687,0 8.501,3.814 8.501,8.5 v 27.222 c 0,5.72 3.232,10.949 8.348,13.507 5.118,2.556 11.24,2.003 15.815,-1.428 l 17.771,-13.329 c 3.748,-2.813 9.088,-2.051 11.901,1.698 2.812,3.75 2.051,9.09 -1.699,11.903 l -46.096,34.577 c -3.801,2.851 -6.039,7.327 -6.039,12.08 v 89.799 c 0,5.395 2.878,10.379 7.551,13.078 4.672,2.698 10.429,2.698 15.101,0 l 78.436,-45.284 c 4.117,-2.376 6.874,-6.551 7.443,-11.27 l 6.896,-57.209 c 0.561,-4.654 4.799,-7.999 9.457,-7.423 2.684,0.324 4.999,1.856 6.355,4.204 0.642,1.112 1.349,2.926 1.068,5.253 l -2.66,22.056 c -0.685,5.679 1.899,11.257 6.672,14.409 4.773,3.152 10.918,3.336 15.872,0.476 l 23.579,-13.613 c 4.056,-2.342 9.268,-0.947 11.613,3.112 1.136,1.966 1.437,4.256 0.849,6.45 -0.587,2.194 -1.994,4.027 -3.961,5.163 l -23.578,13.612 c -4.954,2.86 -7.867,8.273 -7.523,13.984 0.342,5.709 3.882,10.736 9.142,12.983 l 20.431,8.725 c 2.089,0.892 3.704,2.543 4.549,4.65 0.847,2.107 0.823,4.418 -0.07,6.507 -1.841,4.309 -6.847,6.319 -11.157,4.478 l -52.993,-22.631 c -4.372,-1.866 -9.366,-1.565 -13.482,0.81 l -78.436,45.284 c -4.672,2.697 -7.551,7.682 -7.551,13.078 0,5.395 2.878,10.379 7.551,13.078 l 78.436,45.285 c 4.116,2.378 9.109,2.677 13.482,0.81 l 52.992,-22.632 c 4.306,-1.841 9.316,0.168 11.158,4.479 1.062,2.485 0.892,5.258 -0.463,7.606 -0.641,1.111 -1.859,2.631 -4.016,3.551 l -20.43,8.725 c -5.26,2.248 -8.8,7.274 -9.142,12.983 -0.342,5.71 2.569,11.123 7.523,13.984 l 23.578,13.612 c 1.967,1.136 3.374,2.969 3.962,5.162 0.588,2.193 0.283,4.481 -0.852,6.448 z"/>
		</g>
	</svg>
	<svg viewBox="0 0 24 24">
		<g class="icon" id="sleet" transform="translate(0.17977291,0.17977291)">
			<path d="m 7.1474851,-0.06014665 c -0.833177,-0.01761 -1.678978,0.224 -2.408887,0.74621 -1.04945,0.75083005 -1.672259,1.96181005 -1.672559,3.25225045 v 0.0292 c -0.13245,-0.0196 -0.26615,-0.0293 -0.4,-0.0292 -1.5463998,0 -2.7999998,1.25364 -2.7999998,2.80009 0,1.54645 1.2536,2.80009 2.7999998,2.80009 H 17.466039 c 1.7665,-0.002 3.198,-1.43354 3.2,-3.2001 10e-5,-1.76736 -1.432504,-3.2001504 -3.199804,-3.2002004 -0.455301,0 -0.905416,0.0971 -1.320216,0.28497 -0.50455,-1.92136 -2.471032,-3.06993005 -4.392382,-2.56541005 -0.5293,0.139 -1.019825,0.39696005 -1.434375,0.75422005 C 9.5560851,0.54512335 8.3652041,-0.03441665 7.1474851,-0.06014665 Z m -0.08145,0.79836 c 1.184,-7.5e-4 2.271386,0.65333005 2.825586,1.69967005 0.1037,0.19505 0.3458679,0.26923 0.5409179,0.16553 0.0437,-0.0233 0.08279,-0.0544 0.115137,-0.0919 1.00705,-1.17094 2.772655,-1.30377 3.943555,-0.29669 0.55255,0.47527 0.897711,1.14748 0.962011,1.8735004 0.0194,0.22006 0.213544,0.38279 0.433594,0.36339 0.0704,-0.006 0.137905,-0.031 0.195605,-0.0718 1.0816,-0.76623 2.579554,-0.51052 3.345704,0.57111 0.7662,1.08164 0.510506,2.57959 -0.571095,3.34581 -0.406599,0.28806 -0.892715,0.44237 -1.391015,0.44162 H 2.6660351 c -1.1039998,-10e-4 -1.9986998,-0.89603 -1.9999998,-2.00007 -0.00265,-1.10193 0.8884797,-1.99731 1.9904298,-1.99996 0.2444,-6e-4 0.486787,0.0438 0.715137,0.13076 0.20665,0.0781 0.437525,-0.0262 0.515625,-0.23282 0.02435,-0.0644 0.03164,-0.134 0.02119,-0.20205 -0.2859,-1.7320104 0.886409,-3.3678304 2.618359,-3.65373045 0.17825,-0.02944 0.358608,-0.04362 0.539259,-0.04237 z M 16.663984,10.343504 c -0.10235,0.002 -0.204011,0.0426 -0.280761,0.12207 -0.149701,0.15501 -0.149701,0.40073 0,0.55578 l 1.599999,1.60005 c 0.1589,0.15351 0.412125,0.14914 0.565625,-0.01 0.149751,-0.15501 0.149751,-0.40073 0,-0.55578 l -1.6,-1.60005 c -0.07945,-0.0768 -0.182513,-0.11409 -0.284863,-0.11231 z m -12.3999999,10e-5 c -0.102356,0.002 -0.204036,0.0425 -0.280761,0.12197 -0.1497,0.15501 -0.1497,0.40078 0,0.55578 l 2,2.00007 c 0.1589,0.15345 0.412175,0.14914 0.565625,-0.01 0.1497,-0.155 0.1497,-0.40072 0,-0.55578 l -2,-2.00006 c -0.07945,-0.0767 -0.182507,-0.11399 -0.284864,-0.11221 z m 6.4020509,1.19505 c -0.10235,0 -0.204712,0.0391 -0.282812,0.11719 -0.15615,0.15621 -0.15615,0.40934 0,0.56555 l 2.8,2.80009 c 0.1589,0.1535 0.412125,0.14914 0.565625,-0.01 0.14975,-0.155 0.14975,-0.40072 0,-0.55578 l -2.8,-2.80009 c -0.0781,-0.0781 -0.180463,-0.11719 -0.282813,-0.11719 z m 9.6,1.19994 c -0.88365,0 -1.6,0.71638 -1.6,1.60005 0,0.88368 0.71635,1.60006 1.6,1.60006 0.88365,0 1.6,-0.71638 1.6,-1.60006 0,-0.88367 -0.71635,-1.60005 -1.6,-1.60005 z m -11.9999999,0.40002 c -0.88365,0 -1.6,0.71637 -1.6,1.60005 0,0.88368 0.71635,1.60005 1.6,1.60005 0.88365,0 1.6,-0.71637 1.6,-1.60005 0,-0.88368 -0.71635,-1.60005 -1.6,-1.60005 z m 11.9999999,0.40001 c 0.44185,0 0.8,0.35816 0.8,0.80002 0,0.44187 -0.35815,0.80003 -0.8,0.80003 -0.44185,0 -0.8,-0.35816 -0.8,-0.80003 0,-0.44186 0.35815,-0.80002 0.8,-0.80002 z m -11.9999999,0.40001 c 0.44185,0 0.8,0.35816 0.8,0.80003 0,0.44186 -0.35815,0.80002 -0.8,0.80002 -0.44185,0 -0.8,-0.35816 -0.8,-0.80002 0,-0.44187 0.35815,-0.80003 0.8,-0.80003 z m 7.1999999,1.20004 c -0.88365,0 -1.6,0.71637 -1.6,1.60005 0,0.88368 0.71635,1.60005 1.6,1.60005 0.88365,0 1.6,-0.71637 1.6,-1.60005 0,-0.88368 -0.71635,-1.60005 -1.6,-1.60005 z m 0,0.80003 c 0.44185,0 0.8,0.35816 0.8,0.80002 0,0.44186 -0.35815,0.80003 -0.8,0.80003 -0.44185,0 -0.8,-0.35817 -0.8,-0.80003 0,-0.44186 0.35815,-0.80002 0.8,-0.80002 z m -6.4020509,2.00504 c -0.10235,0.002 -0.204011,0.0426 -0.280761,0.12207 -0.1497,0.15501 -0.1497,0.40073 0,0.55578 l 1.9999999,2.00007 c 0.1589,0.15345 0.412175,0.14914 0.565625,-0.01 0.1497,-0.155 0.1497,-0.40072 0,-0.55578 l -1.9999999,-2.00006 c -0.07945,-0.0768 -0.182514,-0.11409 -0.284864,-0.11231 z m 9.1999999,0 c -0.10235,0.002 -0.204012,0.0426 -0.280762,0.12207 -0.14975,0.15501 -0.14975,0.40078 0,0.55578 l 2,2.00007 c 0.158901,0.1535 0.412126,0.14914 0.565625,-0.01 0.149751,-0.155 0.149751,-0.40072 0,-0.55578 l -2,-2.00006 c -0.07945,-0.0768 -0.182513,-0.11409 -0.284863,-0.11231 z m -5.197949,2.79511 c -0.88365,0 -1.6,0.71637 -1.6,1.60005 0,0.88368 0.71635,1.60005 1.6,1.60005 0.88365,0 1.6,-0.71637 1.6,-1.60005 0,-0.88368 -0.71635,-1.60005 -1.6,-1.60005 z m 9.2,0 c -0.88365,0 -1.6,0.71637 -1.6,1.60005 0,0.88368 0.71635,1.60005 1.6,1.60005 0.88365,0 1.6,-0.71637 1.6,-1.60005 0,-0.88368 -0.71635,-1.60005 -1.6,-1.60005 z m -9.2,0.80002 c 0.44185,0 0.8,0.35817 0.8,0.80003 0,0.44186 -0.35815,0.80002 -0.8,0.80002 -0.44185,0 -0.8,-0.35816 -0.8,-0.80002 0,-0.44186 0.35815,-0.80003 0.8,-0.80003 z m 9.2,0 c 0.44185,0 0.8,0.35817 0.8,0.80003 0,0.44186 -0.35815,0.80002 -0.8,0.80002 -0.44185,0 -0.8,-0.35816 -0.8,-0.80002 0,-0.44186 0.35815,-0.80003 0.8,-0.80003 z" /> 
		</g>
	</svg>
	<svg viewBox="0 0 24 24">
		<g class="icon" id="wind" transform="matrix(0.046875,0,0,0.05615204,0,-2.3648053)">
			<path transform="matrix(21.333333,0,0,17.808792,0,42.114326)" d="M 18.986328 0.009765625 C 17.849187 0.009765625 16.734344 0.47925022 15.847656 1.3320312 C 15.544844 1.6232919 15.497187 2.1548359 15.740234 2.5175781 C 15.983375 2.8802642 16.425703 2.937745 16.728516 2.6464844 C 17.366484 2.032911 18.168172 1.6953125 18.986328 1.6953125 C 20.975234 1.6953125 22.59375 3.6330939 22.59375 6.015625 C 22.59375 8.3981561 20.975187 10.335938 18.986328 10.335938 L 5.765625 10.335938 C 5.3773125 10.335938 5.0625 10.712571 5.0625 11.177734 C 5.0625 11.642898 5.3773125 12.021484 5.765625 12.021484 L 18.986328 12.021484 C 21.750641 12.021484 24 9.3270231 24 6.015625 C 24 2.7042269 21.750594 0.009765625 18.986328 0.009765625 z M 0.703125 6.9726562 C 0.3148125 6.9726562 0 7.3492896 0 7.8144531 C 0 8.2796166 0.3148125 8.6582031 0.703125 8.6582031 L 1.6523438 8.6582031 C 2.0406562 8.6582031 2.3554688 8.2796166 2.3554688 7.8144531 C 2.3554688 7.3492896 2.0406562 6.9726562 1.6523438 6.9726562 L 0.703125 6.9726562 z M 4.4179688 6.9726562 C 4.0296562 6.9726562 3.7148438 7.3492896 3.7148438 7.8144531 C 3.7148438 8.2796166 4.0296562 8.6582031 4.4179688 8.6582031 L 11.929688 8.6582031 C 12.318047 8.6582031 12.632813 8.2796166 12.632812 7.8144531 C 12.632812 7.3492896 12.318047 6.9726562 11.929688 6.9726562 L 4.4179688 6.9726562 z M 0.703125 13.710938 C 0.3148125 13.710938 0 14.087571 0 14.552734 C 0 15.017898 0.3148125 15.396484 0.703125 15.396484 L 11.732422 15.396484 C 13.327344 15.396484 14.625 16.950755 14.625 18.861328 C 14.625 20.771901 13.327344 22.326172 11.732422 22.326172 C 11.076313 22.326172 10.433516 22.054504 9.921875 21.5625 C 9.6191094 21.271296 9.1767344 21.328664 8.9335938 21.691406 C 8.6904531 22.054148 8.7382031 22.585749 9.0410156 22.876953 C 9.801375 23.608165 10.757375 24.009766 11.732422 24.009766 C 14.10275 24.009766 16.03125 21.700768 16.03125 18.861328 C 16.03125 16.021888 14.10275 13.710938 11.732422 13.710938 L 0.703125 13.710938 z M 4.265625 17.064453 C 3.8773125 17.064453 3.5625 17.441087 3.5625 17.90625 C 3.5625 18.371413 3.8773125 18.748047 4.265625 18.748047 L 8.484375 18.748047 C 8.8727344 18.748047 9.1875 18.371413 9.1875 17.90625 C 9.1875 17.441087 8.8726875 17.064453 8.484375 17.064453 L 4.265625 17.064453 z " />
		</g>
	</svg>
	<svg viewBox="0 0 24 24">
		<g class="icon" id="fog" transform="matrix(0.046875,0,0,0.05333333,-2.0010155e-8,-1.6024884)" >
			<path transform="matrix(21.333333,0,0,18.750001,4.2688331e-7,30.046659)" d="M 9.1875 0.05078125 C 6.0859219 0.05078125 3.5625 2.9222654 3.5625 6.4511719 C 3.5625 6.4730385 3.5617969 6.4957115 3.5625 6.5175781 C 1.5691406 6.8996048 -5.9211895e-16 8.8757601 0 11.25 C 0 13.89688 1.9392656 16.050781 4.265625 16.050781 L 19.734375 16.050781 C 22.060734 16.050781 24 13.89688 24 11.25 C 24 8.8554935 22.404078 6.8664258 20.386719 6.5078125 C 20.071531 4.212506 18.323297 2.4511719 16.21875 2.4511719 C 15.427031 2.4511719 14.665719 2.6992092 14.005859 3.1640625 C 13.001984 1.2444893 11.19525 0.05078125 9.1875 0.05078125 z M 16.21875 17.650391 C 14.020781 17.650391 11.86725 18.458588 11.777344 18.492188 C 11.756719 18.499974 9.7457344 19.25 7.78125 19.25 C 5.8167656 19.25 3.8057813 18.499974 3.7851562 18.492188 L 3.1171875 18.240234 L 2.6738281 19.757812 L 3.3398438 20.009766 C 3.4305469 20.044166 5.5832812 20.851563 7.78125 20.851562 C 9.9792187 20.851562 12.13275 20.043366 12.222656 20.009766 C 12.243281 20.001979 14.254266 19.25 16.21875 19.25 C 18.183234 19.25 20.194219 20.001979 20.214844 20.009766 L 20.882812 20.261719 L 21.326172 18.744141 L 20.660156 18.492188 C 20.569547 18.457841 18.416719 17.650391 16.21875 17.650391 z M 16.21875 20.851562 C 14.020781 20.851562 11.86725 21.657806 11.777344 21.691406 C 11.756719 21.699193 9.7457344 22.451172 7.78125 22.451172 C 5.8167656 22.451172 3.8057813 21.699193 3.7851562 21.691406 L 3.1171875 21.439453 L 2.6738281 22.957031 L 3.3398438 23.208984 C 3.4305469 23.243384 5.5832812 24.050781 7.78125 24.050781 C 9.9792187 24.050781 12.13275 23.244537 12.222656 23.210938 C 12.243281 23.203151 14.254266 22.451172 16.21875 22.451172 C 18.183234 22.451172 20.194219 23.203151 20.214844 23.210938 L 20.882812 23.460938 L 21.326172 21.945312 L 20.660156 21.691406 C 20.5695 21.657006 18.416719 20.851563 16.21875 20.851562 z " />
		</g>
	</svg>
	<svg viewBox="0 0 24 24">
		<g class="icon" id="cloudy">
			<path d="m 6.3900381,-0.00341729 c -0.20714,0 -0.375,0.27546 -0.375,0.61538 V 3.0990427 c -0.936609,0.126 -1.814405,0.72286 -2.530608,1.72056 l -1.329254,-2.18119 c -0.146438,-0.24031 -0.383836,-0.24031 -0.530274,0 -0.146484,0.2403 -0.146484,0.62988 0,0.87019 l 1.329163,2.18134 c -0.608016,1.17538 -0.971681,2.61587 -1.048462,4.15279 H 0.39003913 c -0.2070938,0 -0.3750001,0.2754703 -0.3750001,0.6153903 0,0.33992 0.1679063,0.61538 0.3750001,0.61538 H 1.9056031 c 0.07678,1.53708 0.440446,2.97757 1.048462,4.1528 l -1.329163,2.18134 c -0.146484,0.24031 -0.146484,0.62988 0,0.87019 0.146438,0.24031 0.383836,0.24031 0.530274,0 l 1.32962,-2.18194 c 0.367781,0.51061 0.783551,0.92235 1.229004,1.21619 -0.751594,3.20831 0.697863,6.6845 2.801238,6.6845 h 4.1249999 c 0.207141,0 0.375,-0.27554 0.375,-0.61538 0,-0.33985 -0.167859,-0.61539 -0.375,-0.61539 H 7.5150381 c

The only issue with dark sky is if you aren’t currently signed up for their API they aren’t accepting new requests and the API is being discontinued the end of 2021.

Oh I didn’t know that… sorry :frowning:

When you find a good new service let us know! lol

They got bought by Apple earlier this year. After that they dropped android support and set an end date for their API.

thanks for your response, however, it seems that the darksky has been sold to apple and not offering the services anymore. Also, I should used the script you provided to create a gateway script timer to be updating every 5 secs and then use the tags written to for display

That’s how I did it yes.

Apparently, i’ll have to find a new service soon.

Glad i found out here before it just quit working one day.

do you have any other option now?

I haven’t had a chance to try it out but weather.gov does have an API. I’m not sure how real time it is or how well it works though. I want to play with it at some point. With it being free from the government, I don’t see it being shut down anytime soon.

1 Like

Has anyone tried this out? Any tips?

Thanks

I have not used that one, but I did have to switch after Yahoo stopped reporting weather. I use Open Weather Map which works well but it has to be done at the gateway level unless you want to pay for a lot of requests to the API. I have this code on a gateway timer script, you’ll have to change the latitude and longitude numbers in the URL and also sign up for a free API key.

import system
import urllib2
import datetime
	
url = "https://api.openweathermap.org/data/2.5/onecall?lat=30.0040&lon=-68.5655&exclude=hourly,minutely&units=imperial&appid=%Your API Key Here%"
	
try:
	response = urllib2.urlopen(url).read()
		
	obj = system.util.jsonDecode(response)
		
	# Get current conditions
	system.tag.write("[default]Weather/Current/Temp", int(obj['current']['temp'])) # Current temperature
	system.tag.write("[default]Weather/Current/Humidity", str(obj['current']['humidity']) + "%") # Current Humidity
		
	windDeg = obj['current']['wind_deg']
	Sector = ["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW","N"]
	Index = windDeg%360
	Index = int(round(Index/ 22.5,0))
	CompassDir = Sector[Index]
		
	windSpeed = obj['current']['wind_speed']
		
	wind = CompassDir + " at " + str(windSpeed) + " MPH"
	system.tag.write("[default]Weather/Current/Wind", wind)
		
	date = datetime.datetime.fromtimestamp(int(obj['current']['dt'])).strftime('%Y-%m-%d') # get current date
	system.tag.write("[default]Weather/Current/Date", date)
	system.tag.write("[default]Weather/Current/Icon", obj['current']['weather'][0]['icon']) # get Icon
	system.tag.write("[default]Weather/Current/Condition", obj['current']['weather'][0]['description']) # Get current weather condition
		
	# Get forcast for next 4 days
	for day in range (5):
		
		if day > 0:
			date = datetime.datetime.fromtimestamp(int(obj['daily'][day]['dt'])).strftime('%Y-%m-%d')
			system.tag.write("[default]Weather/Day %d/Day" % (day), 	date) # Get forcasted day
				
			system.tag.write("[default]Weather/Day %d/Low" % (day), int(obj['daily'][day]['temp']['min'])) # Get low temperature for the day.
			system.tag.write("[default]Weather/Day %d/High" % (day), int(obj['daily'][day]['temp']['max'])) # Get high temperature for the day.
			system.tag.write("[default]Weather/Day %d/Icon" % day, obj['daily'][day]['weather'][0]['icon']) # Get icon for the day.
			system.tag.write("[default]Weather/Day %d/Condition" % day, obj['daily'][day]['weather'][0]['description']) # Get weather description for the day.
				
	system.tag.write("[default]Weather/Live", 1)
	del response
	del obj
	print "Weather Update Successful!"
		
except:
	system.tag.write("[default]Weather/Live", 0)
	print "Weather Update Failed!"
2 Likes

@Rusty I’d look at the manual under system.net.httpGet(). It was used as an example for using that function.