Scripter charts → TinyCScripter-Diagramme → TinyC

Take your bar charts from an old Scripter script over to a TinyC programDeine Balkendiagramme vom alten Scripter-Script in ein TinyC-Programm mitnehmen

Start

You used one of my Scripter scripts with charts and want to change to a TinyC program? With this tool you take your bar charts (days, weeks, months) with you, so you do not start from zero.

▶ Open the online converter, or download script_charts_to_tinyc_pvs.html and open it on your PC. It is a single file. Nothing is installed and nothing is uploaded anywhere, everything happens in your browser.

If the download links to your device do not work, use the downloaded copy. Some browsers block downloads from your device (http) on this page (https). With the file opened from your PC this does not happen.

Already using TinyC and only want to look at or change your charts? Then use the chart editor.

Du hast eines meiner Scripter-Scripte mit Diagrammen benutzt und willst auf ein TinyC-Programm umsteigen? Mit diesem Werkzeug nimmst du deine Balkendiagramme (Tage, Wochen, Monate) mit, damit du nicht bei null anfängst.

▶ Online-Konverter öffnen, oder script_charts_to_tinyc_pvs.html herunterladen und auf deinem PC öffnen. Es ist eine einzelne Datei. Es wird nichts installiert und nichts irgendwohin hochgeladen, alles passiert in deinem Browser.

Klappen die Download-Links zu deinem Gerät nicht, nimm die heruntergeladene Kopie. Manche Browser blockieren auf dieser Seite (https) Downloads von deinem Gerät (http). Mit der Datei vom PC passiert das nicht.

Du nutzt schon TinyC und willst deine Diagramme nur ansehen oder ändern? Dafür gibt es den Diagramm-Editor.

The four stepsDie vier Schritte

1 · Fetch the chart data1 · Diagrammdaten holen

Enter the IP of your old device at the top. A link to its data.csv appears. Download the file and select it in the tool. (You also find the file in the file manager of the old device: http://<device>/ufsd.)

The tool recognises by itself which script wrote the file.

No data.csv on the old device? An ESP8266 with 1 MB flash has no space for files, so the script never saved one. Then use way a) in the tool: click the link, copy the answer into the field and press Balken übernehmen (take over bars).

http://<ip>/cm?cmnd=script%3Fdcon%3Bdprod%3Bmcon

With 2_SML_Chart_PV3 also fetch the weeks with this second link and paste that answer too. The order does not matter:

http://<ip>/cm?cmnd=script%3Fwcon%3Bwprod

Do not restart the old device before this. Without a file system the bars are lost after a restart. The 24 h curve can not be taken over this way, it starts empty.

Oben die IP deines alten Geräts eintragen. Es erscheint ein Link auf seine data.csv. Datei herunterladen und im Werkzeug auswählen. (Die Datei findest du auch im Dateimanager des alten Geräts: http://<geraet>/ufsd.)

Welches Script die Datei geschrieben hat, erkennt das Werkzeug selbst.

Keine data.csv auf dem alten Gerät? Ein ESP8266 mit 1 MB Flash hat keinen Platz für Dateien, das Script hat also nie eine gespeichert. Dann nimm im Werkzeug den Weg a): Link anklicken, die Antwort ins Feld kopieren und Balken übernehmen drücken.

http://<ip>/cm?cmnd=script%3Fdcon%3Bdprod%3Bmcon

Bei 2_SML_Chart_PV3 zusätzlich mit diesem zweiten Link die Wochen holen und diese Antwort auch einfügen. Die Reihenfolge ist egal:

http://<ip>/cm?cmnd=script%3Fwcon%3Bwprod

Das alte Gerät vorher nicht neu starten. Ohne Dateisystem sind die Balken nach einem Neustart weg. Der 24-h-Verlauf lässt sich so nicht übernehmen, er beginnt leer.

2 · Enter the start readings2 · Anfangsstände eintragen

For the daily, monthly and yearly values the program needs to know the meter reading at the start of the day, month and year. The old script keeps these values separately, they are not in the data.csv. Without them, today's bar would suddenly show the whole meter reading (e.g. 45,000 kWh), and all other bars would look like zero.

So: click both links in the tool (the IP is taken from step 1) and copy each answer into its field.

http://<ip>/cm?cmnd=script%3Fdval%3Bmval%3Byval%3Bda%3Bwval
http://<ip>/cm?cmnd=script%3Fdval2%3Bmval2%3Byval2%3Bwval2%3Bsml3

Some values only exist in certain scripts. For the others the device answers "???", which is fine:

  • wval / wval2: the week start readings, only in 2_SML_Chart_PV3. If empty, the week counts from today.
  • sml3: the calculated feed-in reading of 3_SML_Chart_PV_Bezugszaehler. It is taken over, and the Import meter option is switched on, so the new device continues counting from the same reading.

If you type the links yourself, keep %3F and %3B exactly like this. With a normal ; the device only answers the first value.

You can also leave the fields empty. Then press 🔢 Reset once on the new device afterwards: the bars stay, only today and this month start at 0.

Für die Tages-, Monats- und Jahreswerte muss das Programm den Zählerstand am Anfang von Tag, Monat und Jahr kennen. Das alte Script speichert diese Werte getrennt, sie stehen nicht in der data.csv. Ohne sie würde der heutige Balken plötzlich den ganzen Zählerstand zeigen (z.B. 45.000 kWh), und alle anderen Balken sähen aus wie null.

Also: Im Werkzeug beide Links anklicken (die IP kommt aus Schritt 1) und jede Antwort in ihr Feld kopieren.

http://<ip>/cm?cmnd=script%3Fdval%3Bmval%3Byval%3Bda%3Bwval
http://<ip>/cm?cmnd=script%3Fdval2%3Bmval2%3Byval2%3Bwval2%3Bsml3

Manche Werte gibt es nur in bestimmten Scripten. Für die anderen antwortet das Gerät mit "???", das ist in Ordnung:

  • wval / wval2: die Wochen-Anfangsstände, nur in 2_SML_Chart_PV3. Bleiben sie leer, zählt die Woche ab heute.
  • sml3: der berechnete Einspeise-Zählerstand aus 3_SML_Chart_PV_Bezugszaehler. Er wird übernommen, und die Option Bezugszähler wird eingeschaltet, damit das neue Gerät beim selben Stand weiterzählt.

Tippst du die Links selbst ein, lass %3F und %3B genau so stehen. Mit einem normalen ; antwortet das Gerät nur mit dem ersten Wert.

Du kannst die Felder auch leer lassen. Dann drücke danach auf dem neuen Gerät einmal 🔢 Reset: Die Balken bleiben, nur heute und dieser Monat fangen bei 0 an.

3 · Download3 · Herunterladen

First load the tc_options.cfg of your new device into the tool (enter its IP, the download link appears). This file holds the settings of all TinyC programs, and the tool only replaces the start readings in it. If the new device has none yet (File Not Found), just continue without.

Then download the files:

sml_chart.binCharts and bars for the energy you bought.
sml_chart_pv.binBars for feed-in. Only for scripts with feed-in.
tc_options.cfgThe start readings. Always needed: without this file the program would use the old values from the device and the daily values would be wrong.

Lade zuerst die tc_options.cfg deines neuen Geräts ins Werkzeug (IP eintragen, der Download-Link erscheint). Diese Datei enthält die Einstellungen aller TinyC-Programme, und das Werkzeug ersetzt darin nur die Anfangsstände. Hat das neue Gerät noch keine (File Not Found), mach einfach ohne weiter.

Dann die Dateien herunterladen:

sml_chart.binDiagramme und Balken für den Bezug.
sml_chart_pv.binBalken für die Einspeisung. Nur bei Scripten mit Einspeisung.
tc_options.cfgDie Anfangsstände. Immer nötig: Ohne diese Datei würde das Programm die alten Werte vom Gerät nehmen, und die Tageswerte wären falsch.

4 · Preview4 · Vorschau

Optional. Shows the charts, so you can check that everything looks right.Optional. Zeigt die Diagramme, damit du prüfen kannst, ob alles richtig aussieht.

Which scripts are recognisedWelche Scripte erkannt werden

Script
1_SML_Chart.taswithout feed-inohne Einspeisung
2_SML_Chart_PV.tas, _PV_Modbus, 3_…_Bezugszaehlerwith feed-inmit Einspeisung
2_SML_Chart_PV2.taswith feed-inmit Einspeisung
2_SML_Chart_PV3.taswith feed-in, weekly bars are taken over toomit Einspeisung, die Wochenbalken kommen auch mit
4_SML_Chart_PV_no_4h24h.tasbars onlynur Balken
5_SteckdoseLeistungsmesser_1 / _2, 6_SML_Wasseruhrcan be read, but there is no matching TinyC programwird gelesen, aber es gibt kein passendes TinyC-Programm

0_SML_Simple.tas has no charts, so there is nothing to convert.0_SML_Simple.tas hat keine Diagramme, da gibt es nichts umzuwandeln.

Installing: keep the orderEinbauen: Reihenfolge einhalten

  1. Stop the program: Tools › TinyC Console › the red ■
  2. Upload the files: Tools › Manage File system › Upload. Always tc_options.cfg, plus the .bin file(s). The existing tc_options.cfg is replaced.
  3. Start the program again: Tools › TinyC Console › the green ▶

If the program is still running while you upload, it overwrites your data again. That is why you stop it first.

At the start the program reads the .bin files once, takes the data over and then deletes them. In the log you then see (the second line only with feed-in):

chart: .bin imported
pv: .bin imported
  1. Programm stoppen: Tools › TinyC Console › das rote ■
  2. Dateien hochladen: Tools › Manage File system › Upload. Immer tc_options.cfg, dazu die .bin-Datei(en). Die vorhandene tc_options.cfg wird ersetzt.
  3. Programm wieder starten: Tools › TinyC Console › das grüne ▶

Läuft das Programm beim Hochladen noch, überschreibt es deine Daten wieder. Deshalb vorher stoppen.

Beim Start liest das Programm die .bin-Dateien einmal, übernimmt die Daten und löscht sie dann. Im Log steht danach (die zweite Zeile nur mit Einspeisung):

chart: .bin imported
pv: .bin imported

What is taken overWas übernommen wird

Day and month barsYes, exactly. Bought and fed in.
Week barsYes, from 2_SML_Chart_PV3. The other scripts have no weeks, there the week chart starts empty.
24 h curveYes, exactly (not via way a) without data.csv).
4 h curveNo, it starts empty. In TinyC this chart works differently (adjustable time span), the old values would land at the wrong time. It fills up again by itself.
Start readingsYes, if you upload the tc_options.cfg as well (step 3).
Feed-in reading sml3Yes, from 3_SML_Chart_PV_Bezugszaehler, if you entered it in step 2.

Check afterwards: today's consumption on the main page of the new device should match the old device.

Tages- und MonatsbalkenJa, genau. Bezug und Einspeisung.
WochenbalkenJa, aus 2_SML_Chart_PV3. Die anderen Scripte haben keine Wochen, dort beginnt das Wochendiagramm leer.
24-h-VerlaufJa, genau (nicht über Weg a) ohne data.csv).
4-h-VerlaufNein, er beginnt leer. In TinyC funktioniert dieses Diagramm anders (einstellbare Zeitspanne), die alten Werte würden zur falschen Zeit landen. Er füllt sich von selbst wieder.
AnfangsständeJa, wenn du die tc_options.cfg mit hochlädst (Schritt 3).
Einspeise-Zählerstand sml3Ja, aus 3_SML_Chart_PV_Bezugszaehler, wenn du ihn in Schritt 2 eingetragen hast.

Prüfe danach: Der Tagesverbrauch auf der Hauptseite des neuen Geräts sollte zum alten Gerät passen.