Corrupted Datalog

I have been using the hacs version for some time.

A few weeks ago my total Wh started showing negative. It’s accumulating up but from -3,000,000

Is this a bug or is my iota data corrupted?

I can’t speak to what may be happening in Home Assistant. You can easily see if the data in the IoTaWatt is good with Graph+:

  • In Units select Wh
  • In Source select Phase_1
  • Select a period like “Last 6 months”
  • At the bottom in the options tab select “accrue”

You should see an increasing plot, unless you have solar, in which case it may undulate but generally increase.

Thanks. I guess I got some weird data.

2021-08-29 00:00:00, 123.55, 193.43, 316.97
2021-08-29 00:10:00, 269.60, 386.92, 656.51
2021-08-29 00:20:00, 403.30, 580.27, 983.57
2021-08-29 00:30:00, 543.00, 773.56, 1316.56
2021-08-29 00:40:00, 683.77, 967.06, 1650.83
2021-08-29 00:50:00, 807.22, 1164.18, 1971.40
2021-08-29 01:00:00, 923.04, 1357.72, 2280.76
2021-08-29 01:10:00, 1036.55, 1551.58, 2588.13
2021-08-29 01:20:00, 1160.04, 1745.09, 2905.12
2021-08-29 01:30:00, 1306.82, 1903.50, 3210.31
2021-08-29 01:40:00, 1431.70, 1988.70, 3420.39
2021-08-29 01:50:00, 1556.18, 2157.18, 3713.35
2021-08-29 02:00:00, 1655.34, 2332.03, 3987.37
2021-08-29 02:10:00, -10681532.36, -11553573.67, -22235106.03
2021-08-29 02:20:00, null, null, null
2021-08-29 02:30:00, null, null, null
2021-08-29 02:40:00, null, null, null
2021-08-29 02:50:00, -10681424.17, -11553385.35, -22234809.51
2021-08-29 03:00:00, -10681297.93, -11553194.62, -22234492.54
2021-08-29 03:10:00, -10681200.88, -11553003.48, -22234204.35
2021-08-29 03:20:00, -10681115.22, -11552812.16, -22233927.37
2021-08-29 03:30:00, -10681031.80, -11552620.86, -22233652.64
2021-08-29 03:40:00, -10680934.12, -11552429.47, -22233363.58
2021-08-29 03:50:00, -10680814.40, -11552235.34, -22233049.73
2021-08-29 04:00:00, -10680696.24, -11552044.56, -22232740.79
2021-08-29 04:10:00, -10680574.21, -11551854.00, -22232428.20
2021-08-29 04:20:00, -10680472.27, -11551664.38, -22232136.64
2021-08-29 04:30:00, -10680351.89, -11551473.90, -22231825.78
2021-08-29 04:40:00, -10680180.50, -11551284.70, -22231465.19
2021-08-29 04:50:00, -10680026.06, -11551096.06, -22231122.11
2021-08-29 05:00:00, -10679926.15, -11550903.84, -22230829.98
2021-08-29 05:10:00, -10679810.15, -11550715.41, -22230525.55

Yes, unfortunately it appears that your datalog was corrupted on 221-08-29 02:10:00. I’d be interested in your message log covering that period.

You can just leave it and the unit will continue to give accurate differential data that does not span that date/time.

If you would like to clear the history and reset it, you can enter the following command via browser URL.

http://iotawatt.local/command?deletelog=both

This will delete all history and restart your IoTaWatt creating new logs from that time forward. I don’t know what it will do to your Home Assistant Energy, but I suspect it will not clear up the accumulated history there but be accurate going forward.

Thanks.

Glad you split my issue out of the other thread.

8/18/21 19:20:39 HTTP server started
8/18/21 19:20:39 emoncms: Starting, interval:10, url:http://192.168.1.15:8080
8/18/21 19:20:39 influxDB_v1: Starting, interval:5, url:http://192.168.20.11:8086
8/18/21 19:20:39 timeSync: service started.
8/18/21 19:20:39 statService: started.
8/18/21 19:20:39 dataLog: service started.
8/18/21 19:20:42 dataLog: Last log entry 08/18/21 19:20:35
8/18/21 19:20:44 historyLog: service started.
8/18/21 19:20:44 historyLog: Last log entry 08/18/21 19:20:00
8/18/21 19:20:44 WiFi connected. SSID=iotprel, IP=192.168.20.20, channel=11, RSSI -63db
8/18/21 19:20:44 MDNS responder started for hostname IotaWatt
8/18/21 19:20:44 LLMNR responder started for hostname IotaWatt
8/18/21 19:20:44 Updater: service started. Auto-update class is MINOR
8/18/21 19:20:45 emoncms: Start posting at 08/18/21 19:20:30
8/18/21 19:20:45 influxDB_v1: Start posting at 08/18/21 19:20:25
8/18/21 19:20:47 Updater: Auto-update is current for class MINOR.

** Restart **

SD initialized.
8/29/21 00:15:11z Real Time Clock is running. Unix time 1630196111
8/29/21 00:15:11z Power failure detected.
8/29/21 00:15:11z Reset reason: External System
8/29/21 00:15:11z ESP8266 ChipID: 6910655
8/29/21 00:15:11z IoTaWatt 4.x, Firmware version 02_06_05
8/29/21 00:15:11z SPIFFS mounted.
8/28/21 20:15:11 Local time zone: -5:00
8/28/21 20:15:11 Using Daylight Saving Time (BST) when in effect.
8/28/21 20:15:11 device name: IotaWatt
8/28/21 20:15:14 HTTP server started
8/28/21 20:15:14 emoncms: Starting, interval:5, url:http://192.168.1.15:8080
8/28/21 20:15:14 influxDB_v1: Starting, interval:5, url:http://192.168.20.11:8086
8/28/21 20:15:14 WiFi connected. SSID=iotprel, IP=192.168.20.20, channel=11, RSSI -61db
8/28/21 20:15:14 MDNS responder started for hostname IotaWatt
8/28/21 20:15:14 LLMNR responder started for hostname IotaWatt
8/28/21 20:15:14 timeSync: service started.
8/28/21 20:15:14 statService: started.
8/28/21 20:15:15 Updater: service started. Auto-update class is MINOR
8/28/21 20:15:15 dataLog: service started.
8/28/21 20:15:17 dataLog: Last log entry 08/28/21 20:15:00
8/28/21 20:15:17 historyLog: service started.
8/28/21 20:15:18 historyLog: Last log entry 08/28/21 20:15:00
8/28/21 20:15:19 emoncms: Start posting at 08/28/21 20:15:00
8/28/21 20:15:19 influxDB_v1: Start posting at 08/28/21 20:14:35
8/28/21 20:15:22 Updater: Auto-update is current for class MINOR.

** Restart **

SD initialized.
8/29/21 06:17:41z Real Time Clock is running. Unix time 1630217861
8/29/21 06:17:41z Reset reason: Software Watchdog
8/29/21 06:17:41z Trace: 25:14, 25:17, 25:13, 25:13, 25:14, 25:17, 25:13, 25:13, 25:14, 25:17, 25:13, 25:13, 25:14, 25:16, 25:17, 25:13, 25:13, 25:14, 25:16, 25:17, 25:13, 25:13, 25:14, 25:16, 25:17, 25:13, 25:13, 25:14, 25:16, 25:17, 25:18, 25:19
8/29/21 06:17:41z ESP8266 ChipID: 6910655
8/29/21 06:17:41z IoTaWatt 4.x, Firmware version 02_06_05
8/29/21 06:17:41z SPIFFS mounted.
8/29/21 02:17:41 Local time zone: -5:00
8/29/21 02:17:41 Using Daylight Saving Time (BST) when in effect.
8/29/21 02:17:41 device name: IotaWatt
8/29/21 02:17:41 HTTP server started
8/29/21 02:17:41 emoncms: Starting, interval:5, url:http://192.168.1.15:8080
8/29/21 02:17:41 influxDB_v1: Starting, interval:5, url:http://192.168.20.11:8086
8/29/21 02:17:41 timeSync: service started.
8/29/21 02:17:41 statService: started.
8/29/21 02:17:41 dataLog: service started.
8/29/21 02:17:44 IotaLog: file damaged /iotawatt/iotalog.log

8/29/21 02:17:44 IotaLog: Creating diagnostic file.
8/29/21 02:50:13 IotaLog: Deleting /iotawatt/iotalog.log and restarting.

** Restart **

SD initialized.
8/29/21 06:50:17z Real Time Clock is running. Unix time 1630219817
8/29/21 06:50:17z Reset reason: Software/System restart
8/29/21 06:50:17z Trace: 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:3, 1:1[9], 1:2, 9:0, 9:0, 8:4, 8:6, 8:8, 8:9, 1:2, 1:3, 1:3, 1:6[1], 1:6[3], 1:5[19], 1:6[4]
8/29/21 06:50:17z ESP8266 ChipID: 6910655
8/29/21 06:50:17z IoTaWatt 4.x, Firmware version 02_06_05
8/29/21 06:50:17z SPIFFS mounted.
8/29/21 02:50:17 Local time zone: -5:00
8/29/21 02:50:17 Using Daylight Saving Time (BST) when in effect.
8/29/21 02:50:17 device name: IotaWatt
8/29/21 02:50:17 HTTP server started
8/29/21 02:50:17 emoncms: Starting, interval:5, url:http://192.168.1.15:8080
8/29/21 02:50:17 influxDB_v1: Starting, interval:5, url:http://192.168.20.11:8086
8/29/21 02:50:17 timeSync: service started.
8/29/21 02:50:17 statService: started.
8/29/21 02:50:17 dataLog: service started.
8/29/21 02:50:17 dataLog: New current log created.
8/29/21 02:50:18 dataLog: Last history entry: 08/29/21 02:17:00
8/29/21 02:50:21 WiFi connected. SSID=iotprel, IP=192.168.20.20, channel=11, RSSI -60db
8/29/21 02:50:21 MDNS responder started for hostname IotaWatt
8/29/21 02:50:21 LLMNR responder started for hostname IotaWatt
8/29/21 02:50:21 Updater: service started. Auto-update class is MINOR
8/29/21 02:50:21 emoncms: Start posting at 08/29/21 02:50:25
8/29/21 02:50:21 influxDB_v1: Start posting at 08/29/21 02:50:25
8/29/21 02:50:23 Updater: Auto-update is current for class MINOR.
8/29/21 02:51:22 historyLog: service started.
8/29/21 02:51:22 historyLog: Last log entry 08/29/21 02:17:00

** Restart **

SD initialized.
9/04/21 03:22:01z Real Time Clock is running. Unix time 1630725721
9/04/21 03:22:01z Power failure detected.
9/04/21 03:22:01z Reset reason: External System
9/04/21 03:22:01z ESP8266 ChipID: 6910655
9/04/21 03:22:01z IoTaWatt 4.x, Firmware version 02_06_05
9/04/21 03:22:01z SPIFFS mounted.
9/03/21 23:22:01 Local time zone: -5:00
9/03/21 23:22:01 Using Daylight Saving Time (BST) when in effect.
9/03/21 23:22:01 device name: IotaWatt
9/03/21 23:22:04 Connecting with WiFiManager.
9/03/21 23:22:07 HTTP server started
9/03/21 23:22:07 emoncms: Starting, interval:5, url:http://192.168.1.15:8080
9/03/21 23:22:07 influxDB_v1: Starting, interval:5, url:http://192.168.20.11:8086
9/03/21 23:22:07 WiFi connected. SSID=iotprel, IP=192.168.20.20, channel=11, RSSI -61db
9/03/21 23:22:07 MDNS responder started for hostname IotaWatt
9/03/21 23:22:07 LLMNR responder started for hostname IotaWatt
9/03/21 23:22:07 timeSync: service started.
9/03/21 23:22:07 statService: started.
9/03/21 23:22:07 Updater: service started. Auto-update class is MINOR
9/03/21 23:22:08 dataLog: service started.
9/03/21 23:22:08 dataLog: Last log entry 09/03/21 23:21:55
9/03/21 23:22:08 emoncms: Start posting at 09/03/21 23:21:55
9/03/21 23:22:08 influxDB_v1: Start posting at 09/03/21 23:21:25
9/03/21 23:22:10 Updater: Auto-update is current for class MINOR.
9/03/21 23:22:12 historyLog: service started.
9/03/21 23:22:12 historyLog: Last log entry 09/03/21 23:21:00

** Restart **

SD initialized.
9/13/21 12:06:23z Real Time Clock is running. Unix time 1631534783
9/13/21 12:06:23z Power failure detected.
9/13/21 12:06:23z Reset reason: External System
9/13/21 12:06:23z ESP8266 ChipID: 6910655
9/13/21 12:06:23z IoTaWatt 4.x, Firmware version 02_06_05
9/13/21 12:06:23z SPIFFS mounted.
9/13/21 08:06:23 Local time zone: -5:00
9/13/21 08:06:23 Using Daylight Saving Time (BST) when in effect.
9/13/21 08:06:23 device name: IotaWatt
9/13/21 08:06:26 Connecting with WiFiManager.
9/13/21 08:06:29 HTTP server started
9/13/21 08:06:29 emoncms: Starting, interval:5, url:http://192.168.1.15:8080
9/13/21 08:06:29 influxDB_v1: Starting, interval:5, url:http://192.168.20.11:8086
9/13/21 08:06:29 WiFi connected. SSID=iotprel, IP=192.168.20.20, channel=11, RSSI -58db
9/13/21 08:06:29 MDNS responder started for hostname IotaWatt
9/13/21 08:06:29 LLMNR responder started for hostname IotaWatt
9/13/21 08:06:29 timeSync: service started.
9/13/21 08:06:29 statService: started.
9/13/21 08:06:29 Updater: service started. Auto-update class is MINOR
9/13/21 08:06:30 dataLog: service started.
9/13/21 08:06:30 dataLog: Last log entry 09/13/21 07:01:25
9/13/21 08:06:30 emoncms: Start posting at 09/13/21 07:01:20
9/13/21 08:06:30 influxDB_v1: Start posting at 09/13/21 07:01:25
9/13/21 08:06:32 Updater: Auto-update is current for class MINOR.
9/13/21 08:06:35 historyLog: service started.
9/13/21 08:06:35 historyLog: Last log entry 09/13/21 07:01:00

** Restart **

SD initialized.
9/15/21 08:08:11z Real Time Clock is running. Unix time 1631693291
9/15/21 08:08:11z Power failure detected.
9/15/21 08:08:11z Reset reason: External System
9/15/21 08:08:11z ESP8266 ChipID: 6910655
9/15/21 08:08:11z IoTaWatt 4.x, Firmware version 02_06_05
9/15/21 08:08:11z SPIFFS mounted.
9/15/21 04:08:11 Local time zone: -5:00
9/15/21 04:08:11 Using Daylight Saving Time (BST) when in effect.
9/15/21 04:08:11 device name: IotaWatt
9/15/21 04:08:14 Connecting with WiFiManager.
9/15/21 04:08:18 HTTP server started
9/15/21 04:08:18 emoncms: Starting, interval:5, url:http://192.168.1.15:8080
9/15/21 04:08:18 influxDB_v1: Starting, interval:5, url:http://192.168.20.11:8086
9/15/21 04:08:18 WiFi connected. SSID=iotprel, IP=192.168.20.20, channel=11, RSSI -61db
9/15/21 04:08:18 MDNS responder started for hostname IotaWatt
9/15/21 04:08:18 LLMNR responder started for hostname IotaWatt
9/15/21 04:08:18 timeSync: service started.
9/15/21 04:08:18 statService: started.
9/15/21 04:08:18 Updater: service started. Auto-update class is MINOR
9/15/21 04:08:19 dataLog: service started.
9/15/21 04:08:19 dataLog: Last log entry 09/15/21 04:08:05
9/15/21 04:08:19 emoncms: Start posting at 09/15/21 04:08:05
9/15/21 04:08:20 influxDB_v1: Start posting at 09/15/21 04:07:45
9/15/21 04:08:22 Updater: Auto-update is current for class MINOR.
9/15/21 04:08:24 historyLog: service started.
9/15/21 04:08:24 historyLog: Last log entry 09/15/21 04:08:00
9/15/21 16:09:35 Updater: update tables from 0.0.2 to 0.0.3
9/15/21 17:09:41 Updater: update tables from 0.0.2 to 0.0.3

Very interesting. Your unit appears to have been doing a long query and the watchdog timer went off. I’ll be looking at this further to try and bulletproof it better, but the solution for you remains the same.

Thank you for digging out the log.