#Habitica integration doesn't handle old timestamps

1 messages · Page 1 of 1 (latest)

mighty sequoia
#

The Habitica integration doesn't seem to be able to handle the timestamps for to-dos on a super old Habitica account. More below.

~~I'm tearing my hair out trying to figure out why only one of my family's four Habitica accounts can't be set up in the Habitica integration.

One of the accounts gets a JSON response with "True/False" and "None" values instead of "true/false" and "null" values - in other words one of the accounts gets an API response with bad JSON. This account is also very old and the other three were created in the last week.

I cannot for the life of me figure out if this is a problem on the integration's end or on Habitica's end.

The error message isn't very helpful. See attached.

Anyone got any ideas on how to track this down?~~

mighty sequoia
#

Here's the debug log.

I'm wondering if it's not a problem with invalid JSON after all, but busted timestamps from really old to-dos.

`2025-08-21 14:15:41.792 ERROR (MainThread) [homeassistant.components.habitica.coordinator] Unexpected error fetching habitica data
Traceback (most recent call last):
File "<string>", line 8, in mashumaro_from_dict_json
File "<string>", line 7, in mashumaro_from_dict_json
mashumaro.exceptions.MissingField: Field "date" of type Optional[datetime] is missing in EntryHistory instance

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<string>", line 75, in mashumaro_from_dict_json
File "<string>", line 10, in mashumaro_from_dict_json
mashumaro.exceptions.InvalidFieldValue: Field "todos" of type list[EntryHistory] in HistoryUser has invalid value [{'date': 1360674245838, 'value': 197.22189430843898}, {'date': 1388566144844, 'value': 199935.79991301743}, {'date': 1451654131114, 'value': 20414.23476875508}, {'date': 1483275982707, 'value': -1782.6106033641145}, {'date': 1514817416841, 'value': -2380.833507868589}, {'date': 1546613938764, 'value': -208.5681005213227}, {'date': 1580263207101, 'value': -80.85501384870811}, {'date': 1674158697885, 'value': -47.4394007610636}, {'date': 1706977265084, 'value': -87.57083976041686}, {'value': 214.32973783908594, '_id': '5220d7cda13c47cd1b000019'}, {'value': 214.32973783908594, '_id': '522356e75cfbc1ae44000009'}, {'value': 214.32973783908594, '_id': '52248b2d6607bd4004000029'}, {'value': 214.32973783908594, '_id': `

Later time stamps look more like:
{'date': '2025-06-26T16:36:11.747Z', 'value': -90.92875271627123}, {'date': '2025-08-18T15:51:32.662Z', 'value': -94.28666567212561}, {'date': '2025-08-20T01:44:13.847Z', 'value': -97.64457862797998}, {'date': '2025-08-20T23:34:53.436Z', 'value': 0}, {'date': '2025-08-21T16:27:55.788Z', 'value': -6}]

mighty sequoia
#

Habitica integration doesn't handle old timestamps

rocky gazelle
#

Hmm, I thought I had fixed this error. The problem is history entries where the date field is missing. What version of Home Assistant are you running?

mighty sequoia
#

2025.8.3

#

If it helps I can share the JSON object that the API returns, just tell me which endpoint you need it from. 🙂

rocky gazelle
#

no need, already know how to fix it

rocky gazelle