burnacid / homey-com.burnacid.ztatz

Homey app for P1 Monitor ztatz (https://www.ztatz.nl/)
GNU General Public License v3.0
0 stars 3 forks source link

P1 phases doesn’t work after updating ZTATZ #66

Closed gerhil closed 3 months ago

gerhil commented 3 months ago

After updating ZTATZ to version 2.4.1 the P1 Phases plugin for Homey Pro doesn’t work any more. The message is “Cannot read properties of undefined (reading ‘STATUS’). Is there a solution?

burnacid commented 3 months ago

I guess there has been a change of the API. I'll might have to make a change. As I've switched away from ZTATZ myself I need some input.

Fase-historie.php werd niet automatische aangepast (verschoof niet op het scherm).
Fase status gaf in de tekst voor L3 L2 weer voor stroom en spanning (status id’s 102 en 105).

@gerhil can you supply me with the output of http://yourztatzurl/api/v1/status?json=object

gerhil commented 3 months ago

This is the output. To what did you switch?

[{"LABEL": "Max dagwaarde Kw verbruik", "SECURITY": 0, "STATUS": "3.435", "STATUS_ID": 1}, {"LABEL": "Max dagwaarde Kw verbruik (timestamp)", "SECURITY": 0, "STATUS": "2024-05-21 07:36:50", "STATUS_ID": 2}, {"LABEL": "Max dagwaarde Kw geleverd", "SECURITY": 0, "STATUS": "2.873", "STATUS_ID": 3}, {"LABEL": "Max dagwaarde Kw geleverd (timestamp)", "SECURITY": 0, "STATUS": "2024-05-21 10:22:00", "STATUS_ID": 4}, {"LABEL": "Tijdstip start van P1 interface(elektrisch):", "SECURITY": 0, "STATUS": "2024-05-18 14:49:27", "STATUS_ID": 5}, {"LABEL": "Tijdstip start database:", "SECURITY": 0, "STATUS": "2024-05-18 14:49:52", "STATUS_ID": 6}, {"LABEL": "Tijdstip laatste verwerkte minuten gegevens:", "SECURITY": 0, "STATUS": "2024-05-21 10:28:04", "STATUS_ID": 7}, {"LABEL": "Huidige dag KWh verbruik dal/nacht dag (1.8.1)", "SECURITY": 0, "STATUS": "3.4719999999979336", "STATUS_ID": 8}, {"LABEL": "Huidige dag KWh verbruik piek/dag (1.8.2)", "SECURITY": 0, "STATUS": "3.3320000000021537", "STATUS_ID": 9}, {"LABEL": "Huidige dag KWh geleverd dal/nacht dag (2.8.1)", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 10}, {"LABEL": "Huidige dag KWh geleverd piek/dag (2.8.2)", "SECURITY": 0, "STATUS": "1.9960000000000004", "STATUS_ID": 11}, {"LABEL": "Tijdstip laatste verwerkte uren gegevens:", "SECURITY": 0, "STATUS": "2024-05-21 10:28:04", "STATUS_ID": 12}, {"LABEL": "Tijdstip laatste verwerkte dagen gegevens:", "SECURITY": 0, "STATUS": "2024-05-21 10:28:04", "STATUS_ID": 13}, {"LABEL": "Tijdstip laatste verwerkte maand gegevens:", "SECURITY": 0, "STATUS": "2024-05-21 10:28:04", "STATUS_ID": 14}, {"LABEL": "Tijdstip laatste verwerkte jaar gegevens:", "SECURITY": 0, "STATUS": "2024-05-21 10:28:04", "STATUS_ID": 15}, {"LABEL": "Tijdstip laatste verwerkte bericht uit de slimme meter:", "SECURITY": 0, "STATUS": "2024-05-21 10:28:01", "STATUS_ID": 16}, {"LABEL": "Tijdstip start watchdog:", "SECURITY": 0, "STATUS": "2024-05-18 14:50:02", "STATUS_ID": 17}, {"LABEL": "Processor belasting", "SECURITY": 0, "STATUS": "5.8", "STATUS_ID": 18}, {"LABEL": "Tijd verstreken sinds de laatste herstart:", "SECURITY": 0, "STATUS": "2 dagen 19:38:52", "STATUS_ID": 19}, {"LABEL": "Netwerk LAN IP adres:", "SECURITY": 10, "STATUS": "192.168.0.108", "STATUS_ID": 20}, {"LABEL": "Ramdisk gebruik.", "SECURITY": 0, "STATUS": "3.6", "STATUS_ID": 21}, {"LABEL": "Besturingssysteem versie:", "SECURITY": 10, "STATUS": "Linux-6.1.21-v7+-armv7l-with-glibc2.31", "STATUS_ID": 22}, {"LABEL": "Internet bereikbaar op:", "SECURITY": 10, "STATUS": "2024-05-21 10:17:44", "STATUS_ID": 23}, {"LABEL": "Internet bereikbaar:", "SECURITY": 10, "STATUS": "ja", "STATUS_ID": 24}, {"LABEL": "Python versie:", "SECURITY": 10, "STATUS": "3.9.2", "STATUS_ID": 25}, {"LABEL": "Internet IP adres:", "SECURITY": 0, "STATUS": "83.84.67.250", "STATUS_ID": 26}, {"LABEL": "Internet hostnaam:", "SECURITY": 0, "STATUS": "83-84-67-250.cable.dynamic.v4.ziggo.nl", "STATUS_ID": 27}, {"LABEL": "Netwerk hostnaam:", "SECURITY": 10, "STATUS": "p1monitor", "STATUS_ID": 28}, {"LABEL": "Tijdstip laatste ram naar disk back-up:", "SECURITY": 0, "STATUS": "2024-05-21 10:16:15", "STATUS_ID": 29}, {"LABEL": "", "SECURITY": 0, "STATUS": "0", "STATUS_ID": 30}, {"LABEL": "RAM geheugen belasting:", "SECURITY": 0, "STATUS": "23.3", "STATUS_ID": 31}, {"LABEL": "Kw waarde 1.4.0 P1 telegram:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 32}, {"LABEL": "Tijdstip laatste update 1.4.0 P1 telegram:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 33}, {"LABEL": "Kw waarde 1.6.0 P1 telegram:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 34}, {"LABEL": "Tijdstip laatste update 1.6.0 P1 telegram:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 35}, {"LABEL": "", "SECURITY": 0, "STATUS": "", "STATUS_ID": 36}, {"LABEL": "", "SECURITY": 0, "STATUS": "", "STATUS_ID": 37}, {"LABEL": "", "SECURITY": 0, "STATUS": "", "STATUS_ID": 38}, {"LABEL": "", "SECURITY": 0, "STATUS": "", "STATUS_ID": 39}, {"LABEL": "", "SECURITY": 0, "STATUS": "", "STATUS_ID": 40}, {"LABEL": "Tijdstip laatste ram naar disk back-up(serial):", "SECURITY": 0, "STATUS": "2024-05-21 10:15:15", "STATUS_ID": 41}, {"LABEL": "Netwerk WifI IP adres:", "SECURITY": 10, "STATUS": "onbekend", "STATUS_ID": 42}, {"LABEL": "M3 GAS verbruikt:", "SECURITY": 0, "STATUS": "24183.883", "STATUS_ID": 43}, {"LABEL": "M3 GAS huidige dag verbruikt:", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 44}, {"LABEL": "Tijdstip laatste verwerkte weer gegevens:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 45}, {"LABEL": "P1 data is ok:", "SECURITY": 0, "STATUS": "1", "STATUS_ID": 46}, {"LABEL": "Tijdstip laatste FTP back-up:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 47}, {"LABEL": "FTP back-up start:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 48}, {"LABEL": "Tijdstip laatste succesvol FTP back-up:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 49}, {"LABEL": "Gas verbruik per uur:", "SECURITY": 0, "STATUS": "0", "STATUS_ID": 50}, {"LABEL": "CPU model:", "SECURITY": 0, "STATUS": "ARMv7 Processor rev 5 (v7l)", "STATUS_ID": 51}, {"LABEL": "CPU hardware:", "SECURITY": 0, "STATUS": "BCM2835", "STATUS_ID": 52}, {"LABEL": "CPU revision:", "SECURITY": 0, "STATUS": "a01041", "STATUS_ID": 53}, {"LABEL": "", "SECURITY": 0, "STATUS": "", "STATUS_ID": 54}, {"LABEL": "Raspberry Pi model:", "SECURITY": 0, "STATUS": "Raspberry Pi 2 Model B Rev 1.1", "STATUS_ID": 55}, {"LABEL": "Tijdstip start UDP daemon:", "SECURITY": 0, "STATUS": "2024-05-18 14:50:04", "STATUS_ID": 56}, {"LABEL": "Tijdstip laatste ram naar disk back-up(verwarming):", "SECURITY": 0, "STATUS": "2024-05-18 14:48:24", "STATUS_ID": 57}, {"LABEL": "Tijdstip laatste verwerkte verwarming gegevens:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 58}, {"LABEL": "Tijdstip laatste dropbox successvolle authenticatie:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 59}, {"LABEL": "Tijdstip laatste Dropbox back-up:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 60}, {"LABEL": "Dropbox back-up start:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 61}, {"LABEL": "Dropbox backup status:", "SECURITY": 0, "STATUS": "authenticatie gefaald", "STATUS_ID": 62}, {"LABEL": "Tijdstip laatste Dropbox data:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 63}, {"LABEL": "Dropbox data status:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 64}, {"LABEL": "Tijdstip start Dropbox daemon:", "SECURITY": 0, "STATUS": "2024-05-18 14:50:04", "STATUS_ID": 65}, {"LABEL": "Laatste P1 monitor versie:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 66}, {"LABEL": "Laatste P1 monitor versie datum:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 67}, {"LABEL": "Laatste P1 monitor versie tekst:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 68}, {"LABEL": "CPU temperatuur:", "SECURITY": 0, "STATUS": "42.236", "STATUS_ID": 69}, {"LABEL": "Tijdstip start UDP broadcast daemon:", "SECURITY": 0, "STATUS": "2024-05-18 14:50:04", "STATUS_ID": 70}, {"LABEL": "Tijdstip laatste UDP broadcast:", "SECURITY": 0, "STATUS": "2024-05-21 10:27:55", "STATUS_ID": 71}, {"LABEL": "Netwerk LAN MAC adres:", "SECURITY": 10, "STATUS": "B8:27:EB:10:61:35", "STATUS_ID": 72}, {"LABEL": "Netwerk Wifi MAC adres:", "SECURITY": 10, "STATUS": "onbekend", "STATUS_ID": 73}, {"LABEL": "Huidige KW verbruik L1 (21.7.0)", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 74}, {"LABEL": "Huidige KW verbruik L2 (41.7.0)", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 75}, {"LABEL": "Huidige KW verbruik L3 (61.7.0)", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 76}, {"LABEL": "Huidige KW levering L1 (22.7.0)", "SECURITY": 0, "STATUS": "1.076", "STATUS_ID": 77}, {"LABEL": "Huidige KW levering L2 (42.7.0)", "SECURITY": 0, "STATUS": "0.808", "STATUS_ID": 78}, {"LABEL": "Huidige KW levering L3 (62.7.0)", "SECURITY": 0, "STATUS": "0.917", "STATUS_ID": 79}, {"LABEL": "weer API status", "SECURITY": 0, "STATUS": "401 fout: API key is niet correct.", "STATUS_ID": 80}, {"LABEL": "weer API status timestamp", "SECURITY": 0, "STATUS": "2024-05-18 14:49:59", "STATUS_ID": 81}, {"LABEL": "Tijdstip laatste succesvolle email:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 82}, {"LABEL": "gemiddele watt waarde voor terug levering schakeling, 0 betekent niet actief.", "SECURITY": 0, "STATUS": "0", "STATUS_ID": 83}, {"LABEL": "Tijdstip terug levering, laatste schakeling:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 84}, {"LABEL": "Dal of Piek tarief:", "SECURITY": 0, "STATUS": "P", "STATUS_ID": 85}, {"LABEL": "Laatste P1 monitor versie URL:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 86}, {"LABEL": "Tijdstip laatste verwerkte bericht uit de slimme meter (UTC):", "SECURITY": 0, "STATUS": "1716280081", "STATUS_ID": 87}, {"LABEL": "Tijdstip tarief schakeling, laatste schakeling:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 88}, {"LABEL": "tarief schakeling is actief, 0 betekent niet actief.", "SECURITY": 0, "STATUS": "0", "STATUS_ID": 89}, {"LABEL": "Tijdstip laatste verwerkte watermeter puls:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 90}, {"LABEL": "Tijdstip laatste verwerkte watermeterstand reset:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 91}, {"LABEL": "Serial device dat gebruikt wordt:", "SECURITY": 0, "STATUS": "/dev/ttyUSB0", "STATUS_ID": 92}, {"LABEL": "", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 93}, {"LABEL": "", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 94}, {"LABEL": "Tijdstip start MQTT client:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 95}, {"LABEL": "Tijdstip laatste MQTT client bericht:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 96}, {"LABEL": "MQTT client status:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 97}, {"LABEL": "Tijdstip start watermeter:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 98}, {"LABEL": "Tijdstip start GPIO daemon:", "SECURITY": 0, "STATUS": "2024-05-18 14:50:02", "STATUS_ID": 99}, {"LABEL": "Huidige Amperage L1 (31.7.0)", "SECURITY": 0, "STATUS": "5.0", "STATUS_ID": 100}, {"LABEL": "Huidige Amperage L2 (51.7.0)", "SECURITY": 0, "STATUS": "4.0", "STATUS_ID": 101}, {"LABEL": "Huidige Amperage L3 (71.7.0)", "SECURITY": 0, "STATUS": "4.0", "STATUS_ID": 102}, {"LABEL": "Huidige Voltage L1 (32.7.0)", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 103}, {"LABEL": "Huidige Voltage L2 (52.7.0)", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 104}, {"LABEL": "Huidige Voltage L3 (72.7.0)", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 105}, {"LABEL": "Tijdstip laatste fase waarde wijziging:", "SECURITY": 0, "STATUS": "2024-05-21 10:28:01", "STATUS_ID": 106}, {"LABEL": "Status van watermeter totaal stand:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 107}, {"LABEL": "Tijdstip start KWh meter productie(S0):", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 108}, {"LABEL": "Tijdstip laatste verwerkte KWh meter productie(S0) puls:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 109}, {"LABEL": "Laatste P1 monitor versie nummer:", "SECURITY": 0, "STATUS": "", "STATUS_ID": 110}, {"LABEL": "Tijdstip laatste verwerkte bericht Solar Edge API:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 111}, {"LABEL": "Tijdstip laatste gefaalde Solar Edge API aanvraag:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 112}, {"LABEL": "Min dagwaarde Kw verbruik", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 113}, {"LABEL": "Min dagwaarde Kw verbruik (timestamp)", "SECURITY": 0, "STATUS": "2024-05-21 09:07:41", "STATUS_ID": 114}, {"LABEL": "Min dagwaarde Kw geleverd", "SECURITY": 0, "STATUS": "0.0", "STATUS_ID": 115}, {"LABEL": "Min dagwaarde Kw geleverd (timestamp)", "SECURITY": 0, "STATUS": "2024-05-21 00:00:05", "STATUS_ID": 116}, {"LABEL": "HTTPS certificaat", "SECURITY": 0, "STATUS": "2", "STATUS_ID": 117}, {"LABEL": "HTTPS certificaat vernieuwen certificaat", "SECURITY": 0, "STATUS": "2", "STATUS_ID": 118}, {"LABEL": "Webserver configuratie", "SECURITY": 0, "STATUS": "2", "STATUS_ID": 119}, {"LABEL": "Tijdstip laatste succesvolle certificaat vernieuwing:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 120}, {"LABEL": "Certificaat geldig tot:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 121}, {"LABEL": "Default gateway/router:", "SECURITY": 0, "STATUS": "192.168.0.1", "STATUS_ID": 122}, {"LABEL": "P1 data is actief(timeout)", "SECURITY": 0, "STATUS": "1", "STATUS_ID": 123}, {"LABEL": "JSON status van NTP netwerktijd", "SECURITY": 0, "STATUS": "{\"timezone\": \"Europe/Amsterdam\", \"ntp_synchronized\": true, \"ntp\": true, \"ntp_server_name\": \"2.debian.pool.ntp.org\", \"ntp_server_ip\": \"195.123.221.21\", \"ntp_last_timestamp\": \"2024-05-21 10:14:53\"}", "STATUS_ID": 124}, {"LABEL": "P1 telegram tijd delta", "SECURITY": 0, "STATUS": "55", "STATUS_ID": 125}, {"LABEL": "Tijdstip start notificatie:", "SECURITY": 0, "STATUS": "2024-05-18 14:50:03", "STATUS_ID": 126}, {"LABEL": "Tijdstip laatste verwerkte financiële dag gegevens:", "SECURITY": 0, "STATUS": "2024-05-21 10:27:04", "STATUS_ID": 127}, {"LABEL": "Tijdstip SOCAT start:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 128}, {"LABEL": "Tijdstip laaste update dynamische tarieven:", "SECURITY": 0, "STATUS": "onbekend", "STATUS_ID": 129}]
burnacid commented 3 months ago

I use home wizard hardware these days. Found this issue, as expected there has been a fix to the API that renamed a label. Fixed the code but need to publish it. Will do that when I'm at home

burnacid commented 3 months ago

@gerhil can you test installing this test version please:

https://homey.app/a/com.burnacid.ztatz/test/

gerhil commented 3 months ago

IMG_2588

This is the result.

burnacid commented 3 months ago

Please switch the device to debug mode (settings of the device) Wait for 5 minutes. Then send a app diagnostics report (in the ZTATZ app settings)

gerhil commented 3 months ago

a40a64c2-7580-4473-a41a-ecbeb03e97e9

gerhil commented 3 months ago

I have just turned the 3 phases on. It seems to work 😁👍

0ec0cf32-7762-4172-9c08-a6b5150d61f4 IMG_2589

burnacid commented 3 months ago

Not sure why the long refresh error stays on screen. But looking at your debug log, it works. I've quickly written up a change so it is backwards compatible with old versions. You can install this one again

https://homey.app/a/com.burnacid.ztatz/test/

If the error remains you might wat to restart ztatz app in homey

gerhil commented 3 months ago

Thank you Stefan. Great work! 👍