Skip to content

Log state card: don't fabricate brightness on ON/OFF transitions #90

@tashda

Description

@tashda

Description

When viewing a log entry for a light state change (e.g. OFF → ON or ON → OFF), the state card always shows brightness: 100%, regardless of what brightness was actually in the MQTT payload.

The state card should only show fields that are actually present in the log payload — if a value isn't in the log, it shouldn't appear (and definitely shouldn't be filled with a fabricated default).

Repro

Toggling `bathroom_ff_ceiling_lamp` on/off produced these MQTT publishes (brightness 176, ~69%):

```
[5/4/2026, 9:06:06 AM] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bathroom_ff_ceiling_lamp', payload '{"brightness":176,...,"state":"OFF",...}'
[5/4/2026, 9:06:06 AM] z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bathroom_ff_ceiling_lamp', payload '{"brightness":176,...,"state":"ON",...}'
```

The log's state card displayed brightness 100% for both entries.

Expected behavior

  • State card reflects payload values exactly. Brightness 176 → ~69%, not 100%.
  • If a field is absent from the payload, the card omits it rather than substituting a default.

Actual behavior

Brightness on ON/OFF transition log entries is hard-coded / defaulted to 100%, masking the real value from the payload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions