<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.apple-tab-span
{mso-style-name:apple-tab-span;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:70.85pt 70.85pt 56.7pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap: break-word;-webkit-nbsp-mode: space;line-break:after-white-space'><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>#!/usr/bin/python<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>An den Anfang einfügen… oder mit python /path/to/script ausführen. Du lädst da bei der Gelegenheit auch noch ein paar andere Werte mit runter, mit denen Du den VZ füttern kannst, z.B. den Luftdruck.<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Mein Skript sieht z.B. so aus…<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:11.0pt;font-family:"Courier New"'>#!/usr/bin/python<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:11.0pt;font-family:"Courier New"'>import urllib, json<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>import requests<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>url = "http://api.openweathermap.org/data/2.5/weather?id=2944368&APPID=75477d698e973afda975d1958d0d6721&units=metric"<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>response = urllib.urlopen(url)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>data = json.loads(response.read())<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>temp = str(data["main"]["temp"])<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>#pres = (int(data["main"]["pressure"]) - 1000)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>pres = str(data["main"]["pressure"])<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>humi = str(data["main"]["humidity"])<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>#http-POST to volkszaehler<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>r1 = requests.post("http://localhost/middleware/data/d20241e0-fae4-11e9-a735-15c4fbf373b2.json", data={"value" : temp })<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>r2 = requests.post("http://localhost/middleware/data/adedfa70-4842-11ea-8990-632804bd2dfe.json", data={"value" : pres })<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>r3 = requests.post("http://localhost/middleware/data/b66790c0-484d-11ea-9ca1-ef6677a932f8.json", data={"value" : humi })<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Gruss,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Alex<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> volkszaehler-users [mailto:volkszaehler-users-bounces@demo.volkszaehler.org] <b>On Behalf Of </b>Prof. Nikolaus Zieske<br><b>Sent:</b> Monday, February 17, 2020 6:38 PM<br><b>To:</b> volkszaehler-users<br><b>Subject:</b> Re: [vz-users] vzlooger Konfiguration für Easymeter Q3A<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Danke und noch eine Frage:<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>#http-POST to volkszaehler</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'><span style='font-size:10.0pt;font-family:"Courier New"'>r = requests.post("<a href="http://localhost/middleware.php/data/a52a3330-50d6-11ea-b585-cf3ec87f99ce.json">http://localhost/middleware.php/data/a52a3330-50d6-11ea-b585-cf3ec87f99ce.json</a>", data={"value" : temp })</span><o:p></o:p></p></div><div><div><p class=MsoNormal><span class=apple-tab-span><span style='color:#FF2600'> </span></span><span style='color:#FF2600'>-bash: syntax error near unexpected token `(‚</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><o:p> </o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Wie kann ich diese Fehlermeldung bei oben genanntem Befehl loswerden?<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Liebe Dank<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>NZ<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Am 16.02.2020 um 19:15 schrieb Daniel Lauckner <<a href="mailto:vz@jahp.de">vz@jahp.de</a>>:<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Hallo,<br><br><br>das ist wohl ein Paketmanager. Das Debianpaket in dem der drin steckt<br>heißt python-pip.<br><a href="https://packages.debian.org/de/buster/python-pip">https://packages.debian.org/de/buster/python-pip</a><br><br><br>mfg Daniel<o:p></o:p></p></div></div></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>