NsPanelPro 4.4.6 MQTT > HA log spam from missing JSON keys / empty event_type

After enabling NSPanel Pro MQTT integration with Home Assistant, I get many repeated warnings (nearly 2000 in two days ) in HA logs because some published payloads are partial.

Typical warnings:

  • Template variable warning: 'dict object' has no attribute 'proximity_detect'

  • same for screen_brightness, screen_state, illuminance, security_mode

  • Invalid event type ... for event.* when payload includes "event_type":""

Example payload seen on audio state topic:

{

“play_status”:“Stopped”,

“play_mode”:“Play once”,

“audio_address”:“http:///local/media/file.mp3”,

“event_type”:“”

}

Expected

  • No template warnings when optional keys are absent.

  • No invalid event warnings due to empty event_type.

Suggestion

  • In MQTT discovery templates, use safe defaults for optional keys (e.g. | default(...)).

  • Don’t publish empty event_type (omit it or send a valid value only when a real event exists).

This would greatly reduce HA log noise while keeping current functionality. Thank you