Skip to content

Fixed empty timestamp in Home-Assistant JSON - #1105

Merged
gskjold merged 2 commits into
mainfrom
fix/ha_empty_ts
Dec 30, 2025
Merged

gskjold merged 2 commits into
mainfrom
fix/ha_empty_ts

Conversation

@gskjold

@gskjold gskjold commented Dec 29, 2025 •

Copy link
Copy Markdown
Member

This is a two part issue:

  1. Package timestamp was not set for meters with proprietary formats
  2. Timestamp field on HA JSON ended up as empty string if not set

The first issue was resolved by removed code from the meter parsing code.

The second issue was resolved by making a common code to convert a time_t to a quoted ISO8601 string which will return null if the timestamp is empty.

Also added the same fix for regular MQTT JSON format.

Fixes: #1102

@gskjold
gskjold merged commit ca4cef5 into main Dec 30, 2025
@gskjold
gskjold deleted the fix/ha_empty_ts branch December 30, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Home assistant & MQTT: Invalid state message '' from 'slimmelezer/energy' and 'slimmelezer/power'

1 participant