<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[json aus Tankerkönig Adapter parsen]]></title><description><![CDATA[<p dir="auto">Hallo,</p>
<p dir="auto">ich versuche grad die json aus dem Tankerkönig Adapter zu parsen aber irgendwir komme ich das nicht wirklich weiter.</p>
<p dir="auto">json:</p>
<pre><code>{"ok":true,"license":"CC BY 4.0 -  https:\/\/creativecommons.tankerkoenig.de","data":"MTS-K","prices":
	{"005056ba-7cb6-1ed5-8cbd-4897fe54e42b":{"status":"open","e5":1.269,"e10":1.219,"diesel":1.039},
	 "aa1c6fb6-439a-4915-8ad8-0f67697a65e2":{"status":"open","e5":1.279,"e10":1.229,"diesel":1.049},
	 "5a5ed93f-84aa-4517-dc7c-c888f278b5c7":{"status":"open","e5":1.289,"e10":false,"diesel":1.049},
	 "6649f1c1-5154-4641-945c-96419ea88f01":{"status":"open","e5":1.299,"e10":1.249,"diesel":1.059},
	 "533abf42-a618-4d18-802e-fabdf0429269":{"status":"open","e5":1.289,"e10":1.239,"diesel":1.049},
	 "528da962-bd28-4f5d-8bd0-cc01ba9b538c":{"status":"open","e5":1.279,"e10":1.229,"diesel":1.049},
	 "51d4b47c-a095-1aa0-e100-80009459e03a":{"status":"open","e5":1.269,"e10":1.219,"diesel":1.039}
	}
}
</code></pre>
<p dir="auto">mein bisheriger Versuch:</p>
<pre><code>on({id:'tankerkoenig.0.json'}, function (obj) {    

  let data = JSON.parse(obj.state.val); 
  if(data){
      for (let i = 0; i &lt; (data.prices).length; i++) {   

          let name = data.price[i]
            log(name)
  }        
})
</code></pre>
<p dir="auto">(data.prices).length ist aber seinbar nicht definiert.<br />
Aber wie komme ich an die Werte aus der JSON?</p>
]]></description><link>https://forum.iobroker.net/topic/37561/json-aus-tankerkönig-adapter-parsen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 12:41:40 GMT</lastBuildDate><atom:link href="https://forum.iobroker.net/topic/37561.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Oct 2020 11:10:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Wed, 14 Oct 2020 14:20:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/liv-in-sky" aria-label="Profile: liv-in-sky">@<bdi>liv-in-sky</bdi></a><br />
bei mir füttert es das "MaterialDesign Table"...<br />
das klappt super...</p>
]]></description><link>https://forum.iobroker.net/post/503383</link><guid isPermaLink="true">https://forum.iobroker.net/post/503383</guid><dc:creator><![CDATA[sveni_lee]]></dc:creator><pubDate>Wed, 14 Oct 2020 14:20:28 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Wed, 14 Oct 2020 14:06:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sveni_lee" aria-label="Profile: sveni_lee">@<bdi>sveni_lee</bdi></a></p>
<p dir="auto">für welches widget hast du dein script gemacht ?</p>
]]></description><link>https://forum.iobroker.net/post/503369</link><guid isPermaLink="true">https://forum.iobroker.net/post/503369</guid><dc:creator><![CDATA[liv-in-sky]]></dc:creator><pubDate>Wed, 14 Oct 2020 14:06:10 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Wed, 14 Oct 2020 13:56:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sveni_lee" aria-label="Profile: sveni_lee">@<bdi>sveni_lee</bdi></a></p>
<p dir="auto">danke dir</p>
<p dir="auto">getObject war mir nicht neu - nur der pfad system.adapter.tank.... - wußte nicht, das da daten sind</p>
<p dir="auto">also auch dank an @fastfood</p>
<p dir="auto">tabelle:</p>
<p dir="auto"><a href="https://forum.iobroker.net/topic/37609/html-tabelle-f%C3%BCr-tankerk%C3%B6nig">https://forum.iobroker.net/topic/37609/html-tabelle-für-tankerkönig</a></p>
]]></description><link>https://forum.iobroker.net/post/503365</link><guid isPermaLink="true">https://forum.iobroker.net/post/503365</guid><dc:creator><![CDATA[liv-in-sky]]></dc:creator><pubDate>Wed, 14 Oct 2020 13:56:33 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Wed, 14 Oct 2020 13:53:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/liv-in-sky" aria-label="Profile: liv-in-sky">@<bdi>liv-in-sky</bdi></a></p>
<p dir="auto">natürlich das okay... dafür ist doch so eine Community da. :-)</p>
<p dir="auto">dieser spezielle teil kommt aber tatsächlich von <a class="plugin-mentions-user plugin-mentions-a" href="/user/fastfoot" aria-label="Profile: fastfoot">@<bdi>fastfoot</bdi></a></p>
<pre><code>let myStations = getObject('system.adapter.tankerkoenig.0').native.stationsarray; 
</code></pre>
<p dir="auto">ich kannte getObject() bisher auch nicht aber das eröffnet mir gerade wieder noch mehr Mögichkeiten.</p>
]]></description><link>https://forum.iobroker.net/post/503360</link><guid isPermaLink="true">https://forum.iobroker.net/post/503360</guid><dc:creator><![CDATA[sveni_lee]]></dc:creator><pubDate>Wed, 14 Oct 2020 13:53:03 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Wed, 14 Oct 2020 13:32:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sveni_lee" aria-label="Profile: sveni_lee">@<bdi>sveni_lee</bdi></a>  cooles script - vorallem wie hast du das gefunden :</p>
<pre><code>let myStations = getObject('system.adapter.tankerkoenig.0').native.stationsarray;
</code></pre>
<p dir="auto">ist das ok, wenn ich das script klaue und für ein html tabellen script nutze?</p>
<p dir="auto"><img src="/assets/uploads/files/1602675240999-image-10.png" alt="Image 10.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.iobroker.net/post/503342</link><guid isPermaLink="true">https://forum.iobroker.net/post/503342</guid><dc:creator><![CDATA[liv-in-sky]]></dc:creator><pubDate>Wed, 14 Oct 2020 13:32:37 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Wed, 14 Oct 2020 13:33:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fastfoot" aria-label="Profile: fastfoot">@<bdi>fastfoot</bdi></a>  gelöscht</p>
]]></description><link>https://forum.iobroker.net/post/503280</link><guid isPermaLink="true">https://forum.iobroker.net/post/503280</guid><dc:creator><![CDATA[liv-in-sky]]></dc:creator><pubDate>Wed, 14 Oct 2020 13:33:15 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Tue, 13 Oct 2020 12:38:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fastfoot" aria-label="Profile: fastfoot">@<bdi>fastfoot</bdi></a></p>
<p dir="auto">ja, danke! habe ich umgesetzt. Ich hab auch noch eine sortierfunktion eingebaut. So ist jetzt immer die günstigste Tankstelle oben...</p>
<pre><code>var station_png = {"005056ba-7cb6-1ed5-8cbd-4897fe54e42b" : "/vis.0/Star.png",
                    "aa1c6fb6-439a-4915-8ad8-0f67697a65e2" : "/vis.0/ESSO.png",
                    "5a5ed93f-84aa-4517-dc7c-c888f278b5c7" : "/vis.0/Test/img/Tanken/Gulf-Tankstelle.png",
                    "6649f1c1-5154-4641-945c-96419ea88f01" : "/vis.0/Test/img/Tanken/total.png",
                    "533abf42-a618-4d18-802e-fabdf0429269" : "/vis.0/Test/img/Tanken/Shell_logo.svg.png",
                    "528da962-bd28-4f5d-8bd0-cc01ba9b538c" : "/vis.0/Test/img/Tanken/Shell_logo.svg.png",
                    "51d4b47c-a095-1aa0-e100-80009459e03a" : "/vis.0/Jet.png"
                    };


on({id:'tankerkoenig.0.json'}, function (obj) {    

    let json_tank = '';
    json_tank = [];

let myStations = getObject('system.adapter.tankerkoenig.0').native.stationsarray;

let json = JSON.parse(getState('tankerkoenig.0.json').val);

let stations = Object.keys(json.prices);

stations.forEach((station,i) =&gt; {

    myStations.forEach((arr, j) =&gt; {

        if(arr[0] == station) {
            
                json_tank.push(
                {
                    "img": station_png[station],
                    "name": arr[1],
                    "preis": json.prices[station].diesel,
                    "status": json.prices[station].status
                })

        }
    });
    
})

    json_tank.sort(function (a, b) {

        return a.preis == b.preis ? 0 : +(a.preis &gt; b.preis) || -1;

    });

 setState('0_userdata.0.materialdesignwidgets.tankerkoeningTabelle', JSON.stringify(json_tank), true);
})
</code></pre>
]]></description><link>https://forum.iobroker.net/post/502852</link><guid isPermaLink="true">https://forum.iobroker.net/post/502852</guid><dc:creator><![CDATA[sveni_lee]]></dc:creator><pubDate>Tue, 13 Oct 2020 12:38:39 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Tue, 13 Oct 2020 12:30:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sveni_lee" aria-label="Profile: sveni_lee">@<bdi>sveni_lee</bdi></a> sagte in <a href="/post/502776">json aus Tankerkönig Adapter parsen</a>:</p>
<blockquote>
<p dir="auto">so, ich hab's hnbekommen.<br />
das skript schreibt jetzt ein JSON Array aus Objekten in einen Datenpunkt.<br />
und den kann man dann im Materialdesignwidget Table verwenden.</p>
<pre><code>var station_png = {"005056ba-7cb6-1ed5-8cbd-4897fe54e42b" : "/vis.0/Star.png",
                    "aa1c6fb6-439a-4915-8ad8-0f67697a65e2" : "/vis.0/ESSO.png",
                    "5a5ed93f-84aa-4517-dc7c-c888f278b5c7" : "/vis.0/Test/img/Tanken/Gulf-Tankstelle.png",
                    "6649f1c1-5154-4641-945c-96419ea88f01" : "/vis.0/Test/img/Tanken/total.png",
                    "533abf42-a618-4d18-802e-fabdf0429269" : "/vis.0/Test/img/Tanken/Shell_logo.svg.png",
                    "528da962-bd28-4f5d-8bd0-cc01ba9b538c" : "/vis.0/Test/img/Tanken/Shell_logo.svg.png",
                    "51d4b47c-a095-1aa0-e100-80009459e03a" : "/vis.0/Jet.png"
                    };


on({id:'tankerkoenig.0.json'}, function (obj) {    

    let json_tank = '';
    json_tank = [];

let myStations = getObject('system.adapter.tankerkoenig.0').native.stationsarray;

let json = JSON.parse(getState('tankerkoenig.0.json').val);

let stations = Object.keys(json.prices);

stations.forEach((station,i) =&gt; {

    myStations.forEach((arr, j) =&gt; {

        if(arr[0] == station) {
            
                json_tank.push(
                {
                    "img": station_png[station],
                    "name": arr[1],
                    "preis": json.prices[station].diesel,
                    "status": json.prices[station].status
                })

            setState('0_userdata.0.materialdesignwidgets.tankerkoeningTabelle', JSON.stringify(json_tank), true);

        }
    });
    
})
})
</code></pre>
</blockquote>
<p dir="auto">Gratuliere! Auch wenn es funktioniert, das setState() sollte zwischen die Zeilen 41 und 42, sonst wird der State bei jeder Station der Tankerkoenig-json geschrieben</p>
]]></description><link>https://forum.iobroker.net/post/502846</link><guid isPermaLink="true">https://forum.iobroker.net/post/502846</guid><dc:creator><![CDATA[fastfoot]]></dc:creator><pubDate>Tue, 13 Oct 2020 12:30:19 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Tue, 13 Oct 2020 08:53:09 GMT]]></title><description><![CDATA[<p dir="auto">so, ich hab's hnbekommen.<br />
das skript schreibt jetzt ein JSON Array aus Objekten in einen Datenpunkt.<br />
und den kann man dann im Materialdesignwidget Table verwenden.</p>
<pre><code>var station_png = {"005056ba-7cb6-1ed5-8cbd-4897fe54e42b" : "/vis.0/Star.png",
                    "aa1c6fb6-439a-4915-8ad8-0f67697a65e2" : "/vis.0/ESSO.png",
                    "5a5ed93f-84aa-4517-dc7c-c888f278b5c7" : "/vis.0/Test/img/Tanken/Gulf-Tankstelle.png",
                    "6649f1c1-5154-4641-945c-96419ea88f01" : "/vis.0/Test/img/Tanken/total.png",
                    "533abf42-a618-4d18-802e-fabdf0429269" : "/vis.0/Test/img/Tanken/Shell_logo.svg.png",
                    "528da962-bd28-4f5d-8bd0-cc01ba9b538c" : "/vis.0/Test/img/Tanken/Shell_logo.svg.png",
                    "51d4b47c-a095-1aa0-e100-80009459e03a" : "/vis.0/Jet.png"
                    };


on({id:'tankerkoenig.0.json'}, function (obj) {    

    let json_tank = '';
    json_tank = [];

let myStations = getObject('system.adapter.tankerkoenig.0').native.stationsarray;

let json = JSON.parse(getState('tankerkoenig.0.json').val);

let stations = Object.keys(json.prices);

stations.forEach((station,i) =&gt; {

    myStations.forEach((arr, j) =&gt; {

        if(arr[0] == station) {
            
                json_tank.push(
                {
                    "img": station_png[station],
                    "name": arr[1],
                    "preis": json.prices[station].diesel,
                    "status": json.prices[station].status
                })

            setState('0_userdata.0.materialdesignwidgets.tankerkoeningTabelle', JSON.stringify(json_tank), true);

        }
    });
    
})
})
</code></pre>
]]></description><link>https://forum.iobroker.net/post/502776</link><guid isPermaLink="true">https://forum.iobroker.net/post/502776</guid><dc:creator><![CDATA[sveni_lee]]></dc:creator><pubDate>Tue, 13 Oct 2020 08:53:09 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Mon, 12 Oct 2020 14:47:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/homoran" aria-label="Profile: Homoran">@<bdi>Homoran</bdi></a> sagte in <a href="/post/502423">json aus Tankerkönig Adapter parsen</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sveni_lee" aria-label="Profile: sveni_lee">@<bdi>sveni_lee</bdi></a> sagte in <a href="/post/502419">json aus Tankerkönig Adapter parsen</a>:</p>
<blockquote>
<p dir="auto">das es in das Materialdesign Table widget passt.</p>
</blockquote>
<p dir="auto">also fehlt da ein bestimmtes format der Ausgabe????</p>
</blockquote>
<p dir="auto">ja... lt. GitHub  muß e ein Json array aus Objecten sein.</p>
<pre><code>[
	{
		"img": "/vis.0/myImages/erlebnis_50.png",
		"name": "Empire",
		"betriebszeit": "4h 06m",
		"funk": "5G",
		"ip": "10.0.0.1"
	},
	{
		"img": "/vis.0/myImages/erlebnis_100.png",
		"name": "Handy",
		"betriebszeit": "13m",
		"funk": "5G",
		"ip": "10.0.0.2"
	},
	{
		"img": "/vis.0/myImages/erlebnis_100.png",
		"name": "Harmony Hub - Wohnzimmer",
		"betriebszeit": "18T 07h 21m",
		"funk": "2G",
		"ip": "10.0.0.3"
	}
]
</code></pre>
<p dir="auto">da ich aber nicht weiß ob dies für die Allgemeinheit von interesse ist versuche ich es über ein script zu lösen. Ich versuche es zu vermeiden Adapter durch meine speziellen wünsche "aufzublasen".</p>
<p dir="auto">bisher ist mein versuch aber och nicht von erfolg gekröhnt... :-)</p>
<pre><code>var station_png = {"005056ba-7cb6-1ed5-8cbd-4897fe54e42b" : "/vis.0/Star.png",
                    "aa1c6fb6-439a-4915-8ad8-0f67697a65e2" : "/vis.0/ESSO.png",
                    "5a5ed93f-84aa-4517-dc7c-c888f278b5c7" : "/vis.0/Test/img/Tanken/Gulf-Tankstelle.png",
                    "6649f1c1-5154-4641-945c-96419ea88f01" : "/vis.0/Test/img/Tanken/total.png",
                    "533abf42-a618-4d18-802e-fabdf0429269" : "/vis.0/Test/img/Tanken/Shell_logo.svg.png",
                    "528da962-bd28-4f5d-8bd0-cc01ba9b538c" : "/vis.0/Test/img/Tanken/Shell_logo.svg.png",
                    "51d4b47c-a095-1aa0-e100-80009459e03a" : "/vis.0/Jet.png"
                    };

var materialDesignWidgets = {};
on({id:'tankerkoenig.0.json'}, function (obj) {    

    let json_tank = getState('0_userdata.0.materialdesignwidgets.tankerkoeningTabelle').val;
 
    if (json_tank) {
        try {

            json_tank = JSON.parse(json_tank);

        } catch (e) {
            json_tank = [];
            console.warn('Wert ist kein JSON string! Wert wird ersetzt!');
        }
    } else {
        json_tank = [];
    }

let myStations = getObject('system.adapter.tankerkoenig.0').native.stationsarray;

let json = JSON.parse(getState('tankerkoenig.0.json').val);

let stations = Object.keys(json.prices);

stations.forEach((station,i) =&gt; {

    myStations.forEach((arr, j) =&gt; {

        if(arr[0] == station) {
  
            log(arr[1] + ': ' + json.prices[station].diesel + " - " + json.prices[station].status);

            materialDesignWidgets.sendTo = function (img ='', name = '', preis = '', status ='' ) {
            
                json_tank.push(
                {
                    "img": station_png[station],
                    "name": arr[1],
                    "preis": json.prices[station].diesel,
                    "status": json.prices[station].status
                })
        
            setState('0_userdata.0.materialdesignwidgets.tankerkoeningTabelle', JSON.stringify(json_tank), true);

        }}
    });
    
})
})
</code></pre>
]]></description><link>https://forum.iobroker.net/post/502438</link><guid isPermaLink="true">https://forum.iobroker.net/post/502438</guid><dc:creator><![CDATA[sveni_lee]]></dc:creator><pubDate>Mon, 12 Oct 2020 14:47:35 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Mon, 12 Oct 2020 14:28:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/homoran" aria-label="Profile: Homoran">@<bdi>Homoran</bdi></a> sagte in <a href="/post/502423">json aus Tankerkönig Adapter parsen</a>:</p>
<blockquote>
<p dir="auto">weil er sie auch braucht zum auswerten</p>
</blockquote>
<p dir="auto">Das wäre ja noch kein Grund, sie nach aussen weiterzugeben, tut der Covid19 Adapter ja auch nicht</p>
<blockquote>
<p dir="auto">Wenn deine Wünsch nicht mit dem Adapter gehen, wäre das doch ggf. ein feature request das in den Adapter einzubauen.</p>
</blockquote>
<p dir="auto">mir reicht das json, um meine Wünsche alleine umzusetzen :-) Der Adapter dient in meinem Fall tatsächlich nur dazu, eine bequeme Konfiguration zu haben. Da ich jetzt so langsam mit VIS anfange, steht als nächstes eine json Tabelle an, die leicht in die VIS eingebunden werden kann</p>
]]></description><link>https://forum.iobroker.net/post/502428</link><guid isPermaLink="true">https://forum.iobroker.net/post/502428</guid><dc:creator><![CDATA[fastfoot]]></dc:creator><pubDate>Mon, 12 Oct 2020 14:28:48 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Mon, 12 Oct 2020 14:20:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fastfoot" aria-label="Profile: fastfoot">@<bdi>fastfoot</bdi></a> sagte in <a href="/post/502421">json aus Tankerkönig Adapter parsen</a>:</p>
<blockquote>
<p dir="auto">Warum bietet der Adapter die json an</p>
</blockquote>
<p dir="auto">weil er sie auch braucht zum auswerten ;-)</p>
<p dir="auto">Wenn deine Wünsch nicht mit dem Adapter gehen, wäre das doch ggf. ein feature request das in den Adapter einzubauen.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sveni_lee" aria-label="Profile: sveni_lee">@<bdi>sveni_lee</bdi></a> sagte in <a href="/post/502419">json aus Tankerkönig Adapter parsen</a>:</p>
<blockquote>
<p dir="auto">das es in das Materialdesign Table widget passt.</p>
</blockquote>
<p dir="auto">also fehlt da ein bestimmtes format der Ausgabe????</p>
]]></description><link>https://forum.iobroker.net/post/502423</link><guid isPermaLink="true">https://forum.iobroker.net/post/502423</guid><dc:creator><![CDATA[Homoran]]></dc:creator><pubDate>Mon, 12 Oct 2020 14:20:58 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Mon, 12 Oct 2020 14:13:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/homoran" aria-label="Profile: Homoran">@<bdi>Homoran</bdi></a> sagte in <a href="/post/502410">json aus Tankerkönig Adapter parsen</a>:</p>
<blockquote>
<p dir="auto">Warum benötigst du den Adapter, wenn du die json selber parsen willst?</p>
</blockquote>
<p dir="auto">Anders gefragt: Warum bietet der Adapter die json an, wenn sie doch 'unnötig' ist :-)</p>
]]></description><link>https://forum.iobroker.net/post/502421</link><guid isPermaLink="true">https://forum.iobroker.net/post/502421</guid><dc:creator><![CDATA[fastfoot]]></dc:creator><pubDate>Mon, 12 Oct 2020 14:13:10 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Mon, 12 Oct 2020 14:08:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/homoran" aria-label="Profile: Homoran">@<bdi>Homoran</bdi></a></p>
<p dir="auto">klar darf man das Fragen.<br />
Ich möchte einfach das ergebnis so umwandeln, das es in das Materialdesign Table widget passt.<br />
Ich würde gern das ergebnis sortiert nach Preis anzeigen lassen mit Icon (img)...</p>
]]></description><link>https://forum.iobroker.net/post/502419</link><guid isPermaLink="true">https://forum.iobroker.net/post/502419</guid><dc:creator><![CDATA[sveni_lee]]></dc:creator><pubDate>Mon, 12 Oct 2020 14:08:00 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Mon, 12 Oct 2020 13:53:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sveni_lee" aria-label="Profile: sveni_lee">@<bdi>sveni_lee</bdi></a> Darf man fragen warum du die json aus dem Adapter parsen willst?<br />
Was möchtest du machen was der Adapter nicht kann?</p>
<p dir="auto">Oder:<br />
Warum benötigst du den Adapter, wenn du die json selber parsen willst?<br />
Da kannst du sie dir ja selber direkt vom Tankerkönig runterladen - ohne Adapter.</p>
<p dir="auto"><img src="https://forum.iobroker.net/assets/plugins/nodebb-plugin-emoji/emoji/android/1f914.png?v=ba16ebd4856" class="not-responsive emoji emoji-android emoji--thinking_face" style="height:23px;width:auto;vertical-align:middle" title=":thinking_face:" alt="🤔" /> <img src="https://forum.iobroker.net/assets/plugins/nodebb-plugin-emoji/emoji/android/1f615.png?v=ba16ebd4856" class="not-responsive emoji emoji-android emoji--confused" style="height:23px;width:auto;vertical-align:middle" title=":confused:" alt="😕" /> <img src="https://forum.iobroker.net/assets/plugins/nodebb-plugin-emoji/emoji/android/1f914.png?v=ba16ebd4856" class="not-responsive emoji emoji-android emoji--thinking_face" style="height:23px;width:auto;vertical-align:middle" title=":thinking_face:" alt="🤔" /></p>
]]></description><link>https://forum.iobroker.net/post/502410</link><guid isPermaLink="true">https://forum.iobroker.net/post/502410</guid><dc:creator><![CDATA[Homoran]]></dc:creator><pubDate>Mon, 12 Oct 2020 13:53:52 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Mon, 12 Oct 2020 13:48:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fastfoot" aria-label="Profile: fastfoot">@<bdi>fastfoot</bdi></a></p>
<p dir="auto">danke... das hat funktioniert :-)</p>
]]></description><link>https://forum.iobroker.net/post/502407</link><guid isPermaLink="true">https://forum.iobroker.net/post/502407</guid><dc:creator><![CDATA[sveni_lee]]></dc:creator><pubDate>Mon, 12 Oct 2020 13:48:51 GMT</pubDate></item><item><title><![CDATA[Reply to json aus Tankerkönig Adapter parsen on Mon, 12 Oct 2020 12:13:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sveni_lee" aria-label="Profile: sveni_lee">@<bdi>sveni_lee</bdi></a> sagte in <a href="/post/502365">json aus Tankerkönig Adapter parsen</a>:</p>
<blockquote>
<p dir="auto">Aber wie komme ich an die Werte aus der JSON?</p>
</blockquote>
<pre><code>let myStations = getObject('system.adapter.tankerkoenig.0').native.stationsarray;
let json = JSON.parse(getState('tankerkoenig.0.json').val);
let stations = Object.keys(json.prices);
stations.forEach((station,i) =&gt; {
    myStations.forEach((arr, j) =&gt; {
        if(arr[0] == station) log(arr[1] + ': ' + json.prices[station].e5);
    });
})
</code></pre>
]]></description><link>https://forum.iobroker.net/post/502376</link><guid isPermaLink="true">https://forum.iobroker.net/post/502376</guid><dc:creator><![CDATA[fastfoot]]></dc:creator><pubDate>Mon, 12 Oct 2020 12:13:10 GMT</pubDate></item></channel></rss>