I've added comprehensive debugging to help identify the issue with your custom panel not retrieving data from Home Assistant.
Add ?debug=true to the URL when accessing the panel:
http://your-ha-instance:8123/cafe-hass/#/cafe?debug=true
Open the browser's developer tools and run:
cafeLogger.setEnabled(true);Set the debug flag in browser's local storage:
localStorage.setItem('cafe_debug', 'true');The debug system now tracks:
- When the cafe-panel element is constructed, connected, disconnected
- When the
hassproperty is set on the custom element - What data is in the hass object (states count, services count, etc.)
- Whether external hass is provided vs hook hass
- Mode detection (standalone, remote, external)
- Global hass instance setting
- Configuration loading
- Home Assistant environment detection
- Mode determination logic
- WebSocket connection attempts (if applicable)
- Global hass instance setting/getting
- States and services availability
- Connection status and errors
When working correctly, you should see:
[C.A.F.E.] CafePanel custom element registered successfully
[C.A.F.E.] Setting hass object in custom element { hasHass: true, statesCount: 378, ... }
[C.A.F.E.] App component rendering { hasExternalHass: true, ... }
[C.A.F.E.] Setting global hass instance { source: 'external', statesCount: 378, ... }
[C.A.F.E.] Global hass instance set successfully
Check the browser console for these patterns:
[C.A.F.E.] Setting hass object in custom element { hasHass: false, ... }
→ Issue is with Home Assistant not passing the hass object to the custom element
[C.A.F.E.] Setting hass object in custom element { hasHass: true, statesCount: 0, ... }
→ Home Assistant is passing an empty or invalid hass object
[C.A.F.E.] No effective hass available to set globally
→ Issue with hass object propagation from custom element to React app
To turn off debugging:
cafeLogger.setEnabled(false);or remove the debug=true parameter from the URL.
Please enable debugging and share the console output so we can identify exactly where the data flow is breaking!