A HACS-compatible Home Assistant integration that provides access to the Tibber Data API for monitoring IoT devices connected through the Tibber platform.
- Electric Vehicles (EV) - Battery level, charging status, charging power
- EV Chargers - Charging current, power output, connectivity status
- Thermostats - Temperature readings, heating status, target temperature
- Solar Inverters - Solar production, power output
- Battery Storage - Battery level, charging/discharging status
- Heat Pumps - Temperature control, power consumption
- Automatic Device Discovery - Discovers all devices connected to your Tibber account
- Real-time Monitoring - Updates device states every 60 seconds
- High Performance - Optimized data caching ensures fast sensor updates even with many devices
- OAuth2 Authentication - Secure authentication using Home Assistant's application credentials
- Device Organization - Groups devices by Tibber homes for easy management
- Home Assistant Integration - Full integration with automations, scripts, and dashboards
- HACS Compatible - Easy installation and updates through HACS
- Tibber Account: You need an active Tibber account
- Connected Devices: You must have IoT devices connected through the Tibber platform (EVs, EV chargers, thermostats, solar inverters, etc.)
- Tibber Data API Access: Your account must have access to the Tibber Data API (contact Tibber support if unsure)
- Home Assistant: Running Home Assistant 2023.1 or later with HACS installed
The Tibber Data API is different from the regular Tibber GraphQL API. It requires:
- Special API Access: Not all Tibber customers automatically have Data API access
- Connected Devices: You must have devices connected through Tibber's IoT platform
- Device Categories: Supported devices include:
- Electric Vehicles (EVs) with Tibber integration
- EV Chargers connected to Tibber
- Smart Thermostats
- Solar Inverters
- Battery Storage Systems
- Heat Pumps
If you only have a regular Tibber electricity subscription without connected IoT devices, this integration will not work.
- Open HACS in Home Assistant
- Go to "Integrations"
- Click the "+" button and search for "Tibber Data"
- Click "Download"
- Restart Home Assistant
Before configuring the integration, you need to register an OAuth2 application with Tibber:
- Go to Tibber Data API Client Management
- Log in with your Tibber account credentials
- Create a new OAuth2 client application:
- Application name: "Home Assistant Integration" (or similar)
- Redirect URI:
https://your-home-assistant-url/auth/external/callback - Required scopes:
openid(OpenID Connect)profile(Basic profile information)email(Email address)offline_access(Refresh token support)data-api-user-read(User data access)data-api-homes-read(Homes data access)data-api-vehicles-read(Electric vehicle data access)data-api-chargers-read(EV charger data access)data-api-thermostats-read(Thermostat data access)data-api-energy-systems-read(Battery storage and energy system data access)data-api-inverters-read(Solar inverter data access)
- Save your Client ID - you'll need this for Home Assistant
- In Home Assistant, go to Settings → Devices & Services
- Click Add Integration and search for "Application Credentials"
- Select "Application Credentials"
- Choose "Tibber Data" from the list
- Enter the Client ID provided by Tibber support
- Leave Client Secret empty (not required for Tibber Data API)
- Click "Create"
- Go to Settings → Devices & Services → Add Integration
- Search for "Tibber Data" and select it
- Click "Continue" to start the OAuth2 authentication flow
- You'll be redirected to Tibber's authorization page
- Log in with your Tibber account and grant permissions
- You'll be redirected back to Home Assistant
- The integration will discover your devices automatically
You can configure the following options after setup:
- Update Interval: How often to poll the API (30-900 seconds, default: 60)
- Include Offline Devices: Whether to include devices that are currently offline
If you have multiple Tibber homes, all devices will be discovered automatically. Devices will be organized by home in the Home Assistant device registry.
The integration creates the following types of entities:
Capability Sensors (from device capabilities):
- Battery Level (%) - For EVs and battery storage systems (device class:
battery) - Charging Power (kW, W) - Current charging/discharging power (device class:
power) - Power Flow (kW, W) - Real-time power flow (solar, battery, grid, load) (device class:
power) - Power Flow Percentages (%) - Power distribution ratios (no device class, for display only)
- Temperature (°C, °F) - For thermostats and heat pumps (device class:
temperature) - Energy Consumption (kWh, Wh) - Total energy consumed (device class:
energy) - Solar Production (kWh, Wh) - Total solar energy produced (device class:
energy) - Charging Current (A) - Current draw during charging (device class:
current) - Voltage (V) - Electrical voltage (device class:
voltage) - Signal Strength (dBm) - Device connectivity strength (device class:
signal_strength) - Charging Status (ENUM) - Vehicle charging status (Idle/Charging/Complete/Error/Unknown) (device class:
enum) - Connector Status (ENUM) - Vehicle plug status (Connected/Disconnected/Unknown) (device class:
enum) - Cellular Connectivity (ENUM) - Cellular connection status (device class:
enum) - WiFi Connectivity (ENUM) - WiFi connection status (device class:
enum) - Estimated Range (km) - Remaining driving range (converted from meters)
- Energy Flow Sensors - Automatically formatted for clarity (device class:
energy):- Grid Import Energy (Hour/Day/etc.) - Energy imported from grid
- Grid Export Energy from Battery (Hour/Day/etc.) - Battery energy exported to grid
- Load Energy from Battery (Hour/Day/etc.) - Battery energy used by load
The integration automatically assigns appropriate Home Assistant device classes based on sensor units:
| Unit | Device Class | Example Sensors |
|---|---|---|
| W, kW | power |
Charging Power, Solar Power, Load Power |
| Wh, kWh | energy |
Energy Flow, Battery Energy, Solar Production |
| % | battery |
Battery Level, State of Charge (only for battery/storage sensors) |
| % | none | Power Flow Percentages (distribution ratios) |
| °C, °F | temperature |
Temperature sensors |
| A | current |
Charging Current |
| V | voltage |
Voltage sensors |
| dBm | signal_strength |
WiFi/Cellular Signal Strength |
| string | enum |
Charging Status, Connector Status, Connectivity Status |
Energy sensors use different state classes based on their type:
- Periodic energy sensors (
.hour.,.day.,.week.,.month.,.year.) have no state class - allows resets to 0 at period boundaries - Storage/lifetime energy sensors use
TOTALstate class - allows fluctuations without becoming unavailable
Attribute Sensors (from device attributes):
- VIN Number - Vehicle identification number (diagnostic)
- Serial Number - Device serial number (diagnostic)
- Firmware Version - Current firmware version (diagnostic)
- Other string/numeric device attributes as applicable
- Online - Whether the device is connected
- Update Available - Firmware update availability
- Charging - Whether EV/battery is currently charging
- Error Status - Any device errors or problems
automation:
- alias: "EV Charging Started"
trigger:
- platform: state
entity_id: binary_sensor.tesla_charging
to: "on"
action:
- service: notify.mobile_app
data:
message: "Tesla has started charging"automation:
- alias: "Adjust Temperature Based on Solar Production"
trigger:
- platform: numeric_state
entity_id: sensor.solar_inverter_power
above: 2000
action:
- service: climate.set_temperature
target:
entity_id: climate.living_room_thermostat
data:
temperature: 22Force an immediate refresh of Tibber Data API data for all devices, bypassing the normal update interval.
Service Data:
config_entry_id(optional): The config entry ID to refresh. If not specified, all Tibber Data config entries will be refreshed.
Examples:
Refresh all Tibber Data integrations:
service: tibber_data.refreshRefresh a specific config entry:
service: tibber_data.refresh
data:
config_entry_id: "01234567890abcdef1234567890abcde"Use in automation to refresh before checking values:
automation:
- alias: "Check EV Battery Before Leaving"
trigger:
- platform: time
at: "07:00:00"
action:
- service: tibber_data.refresh
- delay:
seconds: 5
- service: notify.mobile_app
data:
message: "EV battery is at {{ states('sensor.tesla_battery_level') }}%"If you see entities showing "This entity is no longer being provided by the tibber_data integration", this is due to a Tibber API change.
Tibber changed how energy flow capabilities are named in their API. The integration works correctly with the new format, but you need to manually clean up old entities.
Old naming (destination from source):
- ❌
energyFlow.hour.load.source.battery→ "Load from Battery (Hour)" - ❌
energyFlow.hour.battery.selfCharged→ "Battery Self-Charge (Hour)"
New naming (source to destination):
- ✅
energyFlow.hour.battery.source.load→ "Battery from Load (Hour)" - ✅
energyFlow.hour.battery.charged→ "Battery Charged (Hour)"
-
Find old entities: Go to Settings → Devices & Services → Entities and search for entities showing:
"This entity is no longer being provided by the tibber_data integration"
-
Delete old entities: For each broken entity:
- Click on the entity
- Click the trash icon (🗑️) to delete it
- Confirm deletion
-
Update dashboards and automations: Replace references to old entity names with new ones.
The Tibber API changed the perspective of energy flow reporting. The integration automatically adapts to the new format, but Home Assistant keeps old entities in its registry until you manually delete them.
- Make sure you've set up Application Credentials as described above
- Verify the Client ID is correct
- Ensure you selected "Tibber Data" when creating the application credential
- PKCE Implementation: This integration automatically includes PKCE (Proof Key for Code Exchange) support required by Tibber
- No manual configuration needed - PKCE parameters are added automatically
- If you still see "invalid request" errors, the issue is likely with client registration
- Check Redirect URI: Ensure your OAuth2 client is configured with the exact redirect URI:
- For Home Assistant Cloud:
https://my.home-assistant.io/redirect/oauth - For Local Installation:
https://YOUR-HA-URL/auth/external/callback - URI must match exactly (case-sensitive)
- For Home Assistant Cloud:
- Verify Client Registration: At Tibber Client Management:
- Application Type: Public Client (no client secret)
- Required Scopes:
openid,profile,email,offline_access,data-api-user-read,data-api-homes-read - Redirect URI: Must match your Home Assistant setup exactly
- Troubleshooting Steps:
- Delete and recreate your Home Assistant application credential
- Verify the Client ID matches your Tibber registration exactly
- Ensure you're using Home Assistant 2023.1 or later
- Try the OAuth flow again
- Automatic Token Refresh: The integration automatically refreshes expired tokens
- Reauth Flow: If token refresh fails (e.g., due to network issues), you'll receive a notification to re-authenticate
- Go to Settings → Devices & Services → Tibber Data
- Click "Configure" or the notification banner
- Complete the authentication flow again
- If reauth doesn't trigger automatically:
- Try reloading the integration
- If issues persist, remove and re-add the integration
- Network Issues: The integration gracefully handles DNS timeouts and network failures during token refresh
- Check your internet connection
- Verify your Tibber account has access to the Data API
- Contact Tibber support if the issue persists
- Most Common Issue: You may not have Tibber Data API access or connected devices
- Check Your Account:
- Log in to Tibber Data API Client Management
- If you can't access this page, you don't have Data API access
- Contact Tibber support to request Data API access
- Verify Connected Devices:
- Open the regular Tibber mobile app
- Check if you have any connected IoT devices (EVs, chargers, thermostats, etc.)
- If not, you need to connect devices first before using this integration
- API Endpoint Test: The integration tries to access
/v1/homes- this only returns homes with connected IoT devices
- Make sure your devices are connected to Tibber and showing in the Tibber app
- Check that your OAuth2 client has the required scopes:
openid,profile,email,offline_accessdata-api-user-read,data-api-homes-readdata-api-vehicles-read,data-api-chargers-read,data-api-thermostats-readdata-api-energy-systems-read,data-api-inverters-read
- Try reloading the integration
If your device's battery level is showing an incorrect percentage (e.g., 0.9% instead of 95.5%):
- Cause: Home Assistant device cards automatically select a battery sensor based on device class
- Recent Fix (v1.0.26+): The integration now only assigns battery device class to percentage sensors with battery/storage-related keywords
- ✅
storage.stateOfCharge,battery.level,storage.capacity→ Battery device class - ❌
powerFlow.fromSolar,powerFlow.toGrid→ No device class (not battery sensors)
- ✅
- Solution: Restart Home Assistant after updating to ensure the fix takes effect
- Note: Power flow percentage sensors represent power distribution ratios, not battery levels
If sensors intermittently become unavailable during brief network issues:
- Cause: Temporary network issues or API timeouts can cause coordinator update failures
- Recent Fix (v1.0.27+): Entities now remain available with cached data during temporary failures
- Entities only become unavailable when device is actually offline according to API
- Cached data from last successful update is used during transient network problems
- Prevents sensor flickering during brief connectivity issues
- Note: This is normal coordinator behavior - entities use last known good data until next successful update
If hourly, daily, weekly, or monthly energy flow sensors become unavailable at the top of the hour/day/week/month:
- Cause: Sensors with state_class cannot properly handle resets to 0 at period boundaries
- Recent Fix (latest version): Periodic energy sensors now have NO state_class
- Periodic sensors (
.hour.,.day.,.week.,.month.,.year.) have no state_class - allows resets to 0 - Storage/lifetime sensors keep
TOTALstate_class - allows fluctuations - Examples affected: Battery Charged (Hour), Grid Imported (Day), Solar Produced (Week)
- Examples unaffected: Available Energy, Storage Level (these use
TOTALstate_class)
- Periodic sensors (
- Solution for existing installations:
- Update to latest version via HACS
- Remove the integration: Settings → Devices & Services → Tibber Data → ⋮ → Delete
- Re-add the integration: Settings → Devices & Services → Add Integration → Tibber Data
- Re-authenticate with your Tibber account
- All entities will be recreated with correct state_class configuration
- Why removal is needed: Home Assistant caches the state class in the entity registry. Simply restarting won't update existing entities.
- Note: Your statistics history will be preserved - Home Assistant maintains historical data separately from entities
To enable debug logging for troubleshooting:
logger:
default: warning
logs:
custom_components.tibber_data: debugThe Tibber Data API has the following limits:
- 100 requests per 5 minutes per IP address
- The integration respects these limits automatically
- Default update interval (60 seconds) stays well within limits
- Issues: GitHub Issues
- Documentation: Tibber Data API Docs
- Tibber Support: Contact via the Tibber app or website
Contributions are welcome! Please see the contributing guidelines for details.
This project is licensed under the MIT License - see the LICENSE file for details.