This is the first custom component I make for Home Assistant. So I appreciate any feedback, assistance, or imrpovements.
A custom integration for Home Assistant to read and monitor data from Kaco 3.7NX inverters. This integration allows you to seamlessly integrate your Kaco inverter into your smart home setup, providing real-time insights and control.
This integration was inspired by Kolja Windeler's Kaco integeration.
My inverters models are 3.7NX but I think this will work with other models, at least partially, i.e. 'NH3'
- Kaco Inverter Integration for Home Assistant
- Local network: Doesn't require internet connection, all readings are made in the local network.
- Combined Device: Uses the MAC address (if provided) for the device id, which enable Home Assistant to combine the device with other devices provided by other integrations using MAC address i.e. Router, in my case UDMPRO gateway.
- Real-Time Monitoring: Track the performance and status of your Kaco 3.7NX inverter.
- Multiple Inverters Support: Easily integrate and monitor multiple inverters.
- Network Integration: Combine with other networked devices like Unifi Network for enhanced functionality.
- User-Friendly Setup: Simple installation and configuration process.
- Home Assistant Core: Version 2023.9 or higher.
- Kaco Inverter: Connected to the same network as Home Assistant.
- Download the Repository:
- Clone or download the repository from GitHub.
- Copy to Custom Components:
- Place the
kacofolder into thecustom_componentsdirectory of your Home Assistant configuration.
- Place the
- Restart Home Assistant:
- Restart Home Assistant to recognize the new integration.
- Add the integration:
- Add the integration and follow the setup wizard.
- Delete all the content of the kaco folder inside the custom_components folder (make sure to delete the 'pycache' folder too).
- Copy the content of the custom_components/kaco/ folder in place of the deleted files.
- Restart Home Assistant
- Reload the integration for existing devices.
Important:
- Inverter Availability: Ensure at least one Kaco inverter is functioning and connected to the network, preferably during daylight hours.
- MAC Address Requirement: To have the inverter's page in Home Assistant show the inverter's data and sensors from other integrations in addition to this in the same device page (e.g., Unifi Network), you must enter the inverter's MAC address during setup.
-
Access Integrations:
- Go to Settings > Devices & Services in Home Assistant.
-
Add Integration:
- Click on Add Integration.
- Search for "Kaco 3.7NX" and select it.
-
Configure the Inverter:
-
Finalize Setup:
After successful installation and configuration, the integration will create various sensors and entities that reflect the inverter's performance metrics. You can:
- Add to Dashboards: Display inverter data on your Home Assistant dashboards.
- Create Automations: Use inverter data to trigger automations, such as adjusting energy consumption based on solar production.
- Monitor Performance: Keep track of energy generation, consumption, and other vital statistics in real-time.
- Kaco Inverters Page: BluePlanet 30 NX1-M2 50 NX1-M2
- Inverter Image: View Image
- Inverter Not Detected:
- Ensure the inverter is powered on and connected to the network.
- Verify that the MAC address entered is correct.
- Integration Fails to Install via HACS:
- Check your HACS configuration and ensure it's up to date.
- Restart Home Assistant and try installing again.
- No Data Displayed:
- Confirm that the inverter is operational and generating data.
- Check Home Assistant logs for any error messages related to the integration.
Contributions are welcome! Whether it's reporting issues, suggesting features, or submitting pull requests, your input helps improve the integration.
- Fork the Repository: Click the Fork button at the top right of this repository.
- Create a Feature Branch:
git checkout -b feature/YourFeature
-
Added a connection status sensor to the SENSORS list that will show "Online" or "Offline"
-
Added persistence storage by adding self._last_known_state = None in the constructor
-
Modified the available property to:
- Always return True for the connection status sensor (so it can show offline status)
- Always return True for all other sensors (so they stay available with last known values)
-
Enhanced the state property to:
- Handle the connection status sensor specially (returns "Online"/"Offline") Store successful readings as _last_known_state
- Return the last known state when current data is unavailable
- Simple implementation: Minimal code changes with clear logic Clear status indication: The "Connection Status" sensor will show "Online" or "Offline"
- Data persistence: All other sensors will keep their last known values when the inverter goes offline
- No breaking changes: Existing functionality is preserved, just enhanced Diagnostic category: The connection status sensor is placed in the diagnostic category alongside other status information
- Users will now be able to see both the connection status and maintain access to their energy data for dashboards and automations even when the inverter is offline (typically at night).
- Added state_class to entities.
- Added some stat entities.
- Add reconfigure option for existing devices
- Added model field to be entered manually and shows on the device page.


