### GraphQL API Response Example Source: https://developer.tibber.com/docs/guides/calling-api An example of a successful JSON response from the GraphQL API. ```json { "data": { "viewer": { "homes": [ { "currentSubscription": { "priceInfo": { "current": { "total": 0.3626, "energy": 0.29, "tax": 0.0726, "startsAt": "2017-10-11T19:00:00+02:00" } } } } ] } } } ``` -------------------------------- ### Performing a GraphQL Query Source: https://developer.tibber.com/docs/guides/calling-api Example of how to structure a POST request to the GraphQL endpoint with a query and authentication. ```APIDOC ## Performing Queries GraphQL queries are always sent as HTTP POST requests. The query itself is provided as a string within a JSON object. ### Request Body Example ```json { "query": "{ viewer { name }}" } ``` ### cURL Example ```bash curl \ -H "Authorization: Bearer 3A77EECF61BD445F47241A5A36202185C35AF3AF58609E19B53F3A8872AD7BE1-1" \ -H "Content-Type: application/json" \ -X POST \ -d '{ "query": "{viewer {homes {currentSubscription {priceInfo {current {total energy tax startsAt }}}}}} ``` -------------------------------- ### Subscribing to Live Measurements Source: https://developer.tibber.com/docs/guides/calling-api Example of how to subscribe to live measurement data using a GraphQL subscription over WebSockets. ```APIDOC ## WebSocket Subscription for Live Measurements ### Description Establishes a WebSocket connection to receive real-time measurement data, such as power consumption. ### Protocol WebSocket (graphql-transport-ws sub-protocol) ### Endpoint (Dynamically queried WebSocket server URL) ### Headers - **Authorization**: Bearer [YOUR_ACCESS_TOKEN] - **User-Agent**: [Platform]/[PlatformVersion] [AppID]/[AppVersion] (e.g., Homey/10.0.0 com.tibber/1.8.3) ### Subscription Query ```graphql subscription { liveMeasurement(homeId: "96a14971-525a-4420-aae9-e5aedaa129ff") { timestamp power maxPower } } ``` ### Response Payload Example ```json { "type": "data", "payload": { "data": { "liveMeasurement": { "timestamp": "2023-10-27T10:05:00Z", "power": 1500, "maxPower": 3000 } } } } ``` ### Notes - Maximum of two open WebSockets are allowed per client. - Implement jitter and exponential backoff for retries and reconnections. - Ensure `viewer.home.features.realTimeConsumptionEnabled` is true before subscribing. ``` -------------------------------- ### Execute GraphQL Query with cURL Source: https://developer.tibber.com/docs/guides/calling-api Example of using cURL to send a POST request with authentication and a complex query to the Tibber API. ```bash curl \ -H "Authorization: Bearer 3A77EECF61BD445F47241A5A36202185C35AF3AF58609E19B53F3A8872AD7BE1-1" \ -H "Content-Type: application/json" \ -X POST \ -d '{ "query": "{viewer {homes {currentSubscription {priceInfo {current {total energy tax startsAt }}}}}} ``` -------------------------------- ### Sending a Meter Reading Mutation Source: https://developer.tibber.com/docs/guides/calling-api Example of how to send a meter reading to the Tibber API using a GraphQL mutation. ```APIDOC ## POST /v1-beta/gql ### Description Allows clients to alter data on the server by invoking mutations. This example demonstrates sending a meter reading. ### Method POST ### Endpoint https://api.tibber.com/v1-beta/gql ### Parameters #### Request Body - **mutation** (string) - Required - The GraphQL mutation to send. ### Request Example ```json mutation{ sendMeterReading(input:{homeId:"some home id", reading: 123}){time reading }} ``` ### Headers - **Authorization**: Bearer [YOUR_ACCESS_TOKEN] - **Content-Type**: application/json ### Response #### Success Response (200) - **data** (object) - Contains the result of the mutation. - **sendMeterReading** (object) - **time** (string) - The timestamp of the reading. - **reading** (number) - The meter reading value. ### Response Example ```json { "data": { "sendMeterReading": { "time": "2023-10-27T10:00:00Z", "reading": 123 } } } ``` ``` -------------------------------- ### GraphQL Mutation to Update Home Source: https://developer.tibber.com/docs/guides/graphql-concepts An example of a GraphQL mutation used to modify data on the server. This mutation updates the 'appAvatar' for a specific home. ```graphql mutation { updateHome(input: { homeId: "c70dcbe5-4485-4821-933d-a8a86452737b",appAvatar: APARTMENT }) { appAvatar } } ``` -------------------------------- ### GraphQL Query for Home with Nested Owner Name Source: https://developer.tibber.com/docs/guides/graphql-concepts An example of a GraphQL query that fetches the 'id' of homes and the 'name' field from the nested 'owner' object type. ```graphql { homes { id owner { name } } } ``` -------------------------------- ### Get WebSocket Subscription URL Source: https://developer.tibber.com/docs This GraphQL query retrieves the URL for establishing WebSocket subscriptions. It was introduced as a change in December 2022 to support the graphql-transport-ws sub-protocol. ```APIDOC ## Get WebSocket Subscription URL ### Description This GraphQL query retrieves the URL for establishing WebSocket subscriptions. It was introduced as a change in December 2022 to support the graphql-transport-ws sub-protocol. ### Method POST ### Endpoint /v1-beta/gql/subscriptions ### Request Body ```json { "query": "query { viewer { websocketSubscriptionUrl } }" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the result of the query. - **viewer** (object) - **websocketSubscriptionUrl** (string) - The URL for WebSocket subscriptions. ### Response Example ```json { "data": { "viewer": { "websocketSubscriptionUrl": "wss://websocket-api.tibber.com/v1-beta/gql/subscriptions" } } } ``` ``` -------------------------------- ### Get WebSocket Subscription URL Source: https://developer.tibber.com/docs/overview This GraphQL query retrieves the URL for establishing WebSocket subscriptions. It was introduced as a change in December 2022 to replace the old subscription protocol. ```APIDOC ## Get WebSocket Subscription URL ### Description Retrieves the URL for WebSocket subscriptions. ### Method POST ### Endpoint /v1-beta/gql ### Request Body ```json { "query": "query { viewer { websocketSubscriptionUrl } }" } ``` ### Response #### Success Response (200) - **websocketSubscriptionUrl** (string) - The URL for WebSocket subscriptions. ### Response Example ```json { "data": { "viewer": { "websocketSubscriptionUrl": "wss://websocket-api.tibber.com/v1-beta/gql/subscriptions" } } } ``` ``` -------------------------------- ### Get WebSocket Subscription URL via GraphQL Source: https://developer.tibber.com/docs/overview Use this GraphQL query to retrieve the current URL for WebSocket subscriptions. This is necessary due to a change in the subscription protocol and server URL. ```graphql { viewer { websocketSubscriptionUrl } } ``` -------------------------------- ### GraphQL Subscription for Live Measurements Source: https://developer.tibber.com/docs/guides/graphql-concepts A GraphQL subscription query to receive real-time data streams for live measurements of a specific home, including power, consumption, and cost. ```graphql subscription { liveMeasurement(homeId:"c70dcbe5-4485-4821-933d-a8a86452737b") { timestamp power accumulatedConsumption accumulatedCost currency minPower averagePower maxPower } } ``` -------------------------------- ### GraphQL Query with Argument for Specific Home Source: https://developer.tibber.com/docs/guides/graphql-concepts Demonstrates querying a specific 'home' by providing its 'id' as an argument to the 'home' field. The 'id' argument is required and must be a String. ```graphql { viewer { home(id: "ee7ce98a-a97b-4edc-9f2e-0a9c67a96f27") { timeZone } } } ``` -------------------------------- ### Authorization Header Format Source: https://developer.tibber.com/docs/guides/calling-api How to format the Authorization header with your access token. ```http Authorization: Bearer ``` -------------------------------- ### Basic GraphQL Query Source: https://developer.tibber.com/docs/guides/calling-api A simple GraphQL query to fetch the viewer's name. ```graphql { viewer { name } } ``` -------------------------------- ### Check Real-Time Consumption Feature Source: https://developer.tibber.com/docs/guides/calling-api Before subscribing to live data, verify if the home supports real-time consumption by querying the `realTimeConsumptionEnabled` field. This helps prevent unnecessary connection attempts. ```graphql { viewer { home(id: "96a14971-525a-4420-aae9-e5aedaa129ff") { id features { realTimeConsumptionEnabled } } } } ``` -------------------------------- ### HomeProductionPageInfo Source: https://developer.tibber.com/docs/reference Contains information about the pagination of production data. ```APIDOC ## HomeProductionPageInfo ### Description Contains information about the pagination of production data. ### Fields - **endCursor** (String): The global ID of the last element in the page. - **hasNextPage** (Boolean): True if further pages are available. - **hasPreviousPage** (Boolean): True if previous pages are available. - **startCursor** (String): The global ID of the first element in the page. - **count** (Int): The number of elements in the page. - **currency** (String): The currency of the page. - **totalProfit** (Float): Page total profit. - **totalProduction** (Float): Page total production. - **filtered** (Int!): Number of entries that have been filtered from result set due to empty nodes. ``` -------------------------------- ### Query Price Info (Quarter-Hourly Resolution) Source: https://developer.tibber.com/docs/changelog This GraphQL query demonstrates how to request quarter-hourly price data by specifying the `resolution: QUARTER_HOURLY` argument. This change allows access to 96 price items per day instead of 24. ```graphql { viewer { home(id: "my-home-id") { currentSubscription { priceInfo(resolution: QUARTER_HOURLY) { # <<<< change this line today { startsAt total # ... } tomorrow { startsAt total # ... } } } } } } ``` -------------------------------- ### Mutation UpdateHome Source: https://developer.tibber.com/docs/reference Updates home information. ```APIDOC ## Mutation updateHome ### Description Updates home information. ### Method Mutation ### Input - **updateHomeInput** (UpdateHomeInput!) - Required ### Response - **updateHome** (Home!) ``` -------------------------------- ### HomeConsumptionConnection Source: https://developer.tibber.com/docs/reference Details about the connection for home consumption data, including pagination and nodes. ```APIDOC ## HomeConsumptionConnection ### Description Represents a paginated connection of home consumption data. ### Fields - **pageInfo** (HomeConsumptionPageInfo!): Information about the pagination of the consumption data. - **nodes** ([Consumption]): A list of consumption nodes. - **edges** ([HomeConsumptionEdge]): A list of consumption edges, providing cursor and node information. ``` -------------------------------- ### HomeProductionConnection Source: https://developer.tibber.com/docs/reference Represents a connection to production data, providing nodes, edges, and pagination information. ```APIDOC ## HomeProductionConnection ### Description Represents a connection to production data, providing nodes, edges, and pagination information. ### Fields - **pageInfo** (HomeProductionPageInfo!): Information about the pagination of the results. - **nodes** ([Production]): A list of production data nodes. - **edges** ([HomeProductionEdge]): A list of edges, each containing a node and a cursor. ``` -------------------------------- ### HomeConsumptionPageInfo Source: https://developer.tibber.com/docs/reference Provides pagination information for the home consumption data. ```APIDOC ## HomeConsumptionPageInfo ### Description Information about the pagination of consumption data. ### Fields - **endCursor** (String): The global ID of the last element in the page. - **hasNextPage** (Boolean): True if further pages are available. - **hasPreviousPage** (Boolean): True if previous pages are available. - **startCursor** (String): The global ID of the first element in the page. - **count** (Int): The number of elements in the page. - **currency** (String): The currency of the page. - **totalCost** (Float): Page total cost. - **energyCost** ⚠️ (Float): Page energy cost ⚠️ **DEPRECATED** - redundant. - **totalConsumption** (Float): Total consumption for page. - **filtered** (Int!): Number of entries that have been filtered from result set due to empty nodes. ``` -------------------------------- ### SubscriptionPriceConnection Source: https://developer.tibber.com/docs/reference A connection object for subscription prices, enabling pagination. ```APIDOC ## SubscriptionPriceConnection ### Fields - **pageInfo** (SubscriptionPriceConnectionPageInfo!) - Information about the pagination state. - **edges** ([SubscriptionPriceEdge]!) - A list of edges, each containing a node and its cursor. - **nodes** ([Price]!) - A list of price nodes. ``` -------------------------------- ### HomeFeatures Source: https://developer.tibber.com/docs/reference Details about the features enabled for a home, such as real-time consumption. ```APIDOC ## HomeFeatures ### Description Represents features available for a home. ### Fields - **realTimeConsumptionEnabled** (Boolean): 'true' if Tibber Pulse or Watty device is paired at home. ``` -------------------------------- ### UpdateHomeInput Source: https://developer.tibber.com/docs/reference Input for updating home information. ```APIDOC ## UpdateHomeInput ### Fields - **homeId** (ID!) - The ID of the home to update. - **appNickname** (String) - The nickname for the home in the app. - **appAvatar** (HomeAvatar) - The chosen avatar for the home. - **size** (Int) - The size of the home in square meters. - **type** (HomeType) - The type of home. - **numberOfResidents** (Int) - The number of people living in the household. - **primaryHeatingSource** (HeatingSource) - The primary form of heating in the home. - **hasVentilationSystem** (Boolean) - Whether the home has a ventilation system. - **mainFuseSize** (Int) - The main fuse size in amperes. ``` -------------------------------- ### GraphQL Client Requirements Source: https://developer.tibber.com/docs/guides/calling-api Essential requirements for clients interacting with the GraphQL API, including User-Agent header and retry logic. ```APIDOC ## GraphQL client requirements * Clients must set the `User-Agent` HTTP header when calling the GraphQL API. Both platform and driver version must be indicated. E.g. `Homey/10.0.0 com.tibber/1.8.3`. * Clients must implement jitter and exponential backoff when retrying queries. ``` -------------------------------- ### Subscribe to Live Measurements Source: https://developer.tibber.com/docs/guides/calling-api This GraphQL subscription allows you to receive real-time measurement data over a WebSocket connection. Specify the home ID to subscribe to live data for a particular home. ```graphql subscription{ liveMeasurement(homeId:"96a14971-525a-4420-aae9-e5aedaa129ff") { timestamp power maxPower } } ``` -------------------------------- ### GraphQL Home Object Type Definition Source: https://developer.tibber.com/docs/guides/graphql-concepts Defines the structure of the 'Home' object type in the GraphQL schema, including its fields and their types. ```graphql type Home { id: String! timeZone: String address: Address owner: LegalEntity ... } ``` -------------------------------- ### Query Price Info (Default Hourly) Source: https://developer.tibber.com/docs/changelog This GraphQL query fetches today's and tomorrow's price information using the default hourly resolution. It is compatible with existing integrations. ```graphql { viewer { home(id: "my-home-id") { currentSubscription { priceInfo { today { startsAt total # ... } tomorrow { startsAt total # ... } } } } } } ``` -------------------------------- ### PriceInfo Source: https://developer.tibber.com/docs/reference Provides current, today's, and tomorrow's price information, along with historical price ranges. ```APIDOC ## PriceInfo ### Fields * **current** (Price) - The energy price right now. * **today** ([Price]!) - The hourly prices of the current day. * **tomorrow** ([Price]!) - The hourly prices of the upcoming day. * **range** ⚠️ (SubscriptionPriceConnection) - Range of prices, optionally relative to `before`/`after` arguments. Capped at 744 items (31 days) for resolution HOURLY, and 31 items for resolution DAILY. If you need to fetch a longer interval, perform multiple requests and take advantage of the `pageInfo` data. Do note that prices never change, so store already fetched historical prices locally; if you can use `today`/`tomorrow` instead, use that since the API can serve this data faster and in a more reliable way. ⚠️ **DEPRECATED** > use `Subscription.priceInfoRange` instead. * **resolution** (PriceResolution!) - Temporal resolution. * **first** (Int) - Take the `n` first results from cursor. Cannot be used in conjunction with `last`. Limit count: 744 (HOURLY), 31 (DAILY). * **last** (Int) - Take the `n` last results from cursor. Cannot be used in conjunction with `first`. Limit count: 744 (HOURLY), 31 (DAILY). * **before** (String) - Base64-encoded ISO8601 date/time cursor position. Cannot be used in conjunction with `after.` Has no influence when `first` is used. * **after** (String) - Base64-encoded ISO8601 date/time cursor position. Cannot be used in conjunction with `before`. Has no influence when `last` is used. ``` -------------------------------- ### HomeProductionEdge Source: https://developer.tibber.com/docs/reference Represents an edge in the production data connection, linking a node to its cursor. ```APIDOC ## HomeProductionEdge ### Description Represents an edge in the production data connection, linking a node to its cursor. ### Fields - **cursor** (String!): The cursor for this edge. - **node** (Production!): The production data node associated with this edge. ``` -------------------------------- ### Send a Meter Reading Mutation Source: https://developer.tibber.com/docs/guides/calling-api Use this mutation to send meter readings to the Tibber API. Ensure you include a valid authorization token and specify the home ID and reading value. ```bash curl \ -H "Authorization: Bearer 3A77EECF61BD445F47241A5A36202185C35AF3AF58609E19B53F3A8872AD7BE1-1 \ -H "Content-Type: application/json" \ -X POST \ -d 'mutation{ sendMeterReading(input:{homeId:"some home id", reading: 123}){time reading }}' https://api.tibber.com/v1-beta/gql ``` -------------------------------- ### Home Object Fields Source: https://developer.tibber.com/docs/reference This section details the fields available for a Home object, representing a user's residence. ```APIDOC ## Home ### Description Represents a user's home, containing various attributes related to its structure, subscription, and data connections. ### Fields - **id** (ID!): The unique identifier for the home. - **timeZone** (String!): The time zone the home resides in. - **appNickname** (String): The nickname given to the home by the user. - **appAvatar** (HomeAvatar!): The chosen avatar for the home. - **size** (Int): The size of the home in square meters. - **type** (HomeType!): The type of home. - **numberOfResidents** (Int): The number of people living in the home. - **primaryHeatingSource** (HeatingSource): The primary form of heating in the household. - **hasVentilationSystem** (Boolean): Whether the home has a ventilation system. - **mainFuseSize** (Int): The main fuse size. - **address** (Address): The address of the home. - **owner** (LegalEntity): The registered owner of the house. - **meteringPointData** (MeteringPointData): Metering point data for the home. - **currentSubscription** (Subscription): The current/latest subscription related to the home. - **subscriptions** ([Subscription]!): All historic subscriptions related to the home. - **consumption** (HomeConsumptionConnection): Consumption connection. Capped at 744 items (31 days) for resolution HOURLY, 31 items for DAILY, 52 items for WEEKLY, 12 items for MONTHLY and 1 for ANNUAL. If you need to fetch a longer interval, perform multiple requests and take advantage of the `pageInfo` data. Do note that this data is not updated in real-time, so try not to fetch this continually if there is no need to; and try to cache/store historical data locally. - resolution (EnergyResolution!): The resolution for consumption data. - first (Int): Take the `n` first results from cursor. Cannot be used in conjunction with `last`. Limit count: 744 (HOURLY), 31 (DAILY), 52 (WEEKLY), 12 (MONTHLY), 1 (ANNUAL). - last (Int): Take the `n` last results from cursor. Cannot be used in conjunction with `first`. Limit count: 744 (HOURLY), 31 (DAILY), 52 (WEEKLY), 12 (MONTHLY), 1 (ANNUAL). - before (String): Base64-encoded ISO8601 date/time cursor start. Cannot be used in conjunction with `after`. Has no influence when `first` is used. - after (String): Base64-encoded ISO8601 date/time cursor start. Cannot be used in conjunction with `before`. Has no influence when `last` is used. - filterEmptyNodes (Boolean): Whether to include empty nodes. Default value: false. - **production** (HomeProductionConnection): Production connection. Capped at 744 items (31 days) for resolution HOURLY, 31 items for DAILY, 52 items for WEEKLY, 12 items for MONTHLY and 1 for ANNUAL. If you need to fetch a longer interval, perform multiple requests and take advantage of the `pageInfo` data. Do note that this data is not updated in real-time, so try not to fetch this continually if there is no need to; and try to cache/store historical data locally. - resolution (EnergyResolution!): The resolution for production data. - first (Int): Take the `n` first results from cursor. Cannot be used in conjunction with `last`. Limit count: 744 (HOURLY), 31 (DAILY), 52 (WEEKLY), 12 (MONTHLY), 1 (ANNUAL). - last (Int): Take the `n` last results from cursor. Cannot be used in conjunction with `first`. Limit count: 744 (HOURLY), 31 (DAILY), 52 (WEEKLY), 12 (MONTHLY), 1 (ANNUAL). - before (String): Base64-encoded ISO8601 date/time cursor start. Cannot be used in conjunction with `after`. Has no influence when `first` is used. - after (String): Base64-encoded ISO8601 date/time cursor start. Cannot be used in conjunction with `before`. Has no influence when `last` is used. - filterEmptyNodes (Boolean): Whether to include empty nodes. Default value: false. - **features** (HomeFeatures): Home features. ``` -------------------------------- ### Viewer Source: https://developer.tibber.com/docs/reference Represents the logged-in user and their associated data. ```APIDOC ## Viewer ### Fields - **login** (String) - The login name of the user. - **userId** (String!) - Unique user identifier. - **name** (String) - The name of the user. - **accountType** (String!) - The type of account for the logged-in user. - **homes** (Home!) - All homes visible to the logged-in user. - **home** (Home!) - Single home by its ID. - **id** (ID!) - The ID of the home. - **websocketSubscriptionUrl** (String) - URL for websocket subscriptions. ``` -------------------------------- ### SubscriptionPriceConnectionPageInfo Source: https://developer.tibber.com/docs/reference Pagination information for SubscriptionPriceConnection. ```APIDOC ## SubscriptionPriceConnectionPageInfo ### Fields - **endCursor** (String) - The cursor for the last item in the current page. - **hasNextPage** (Boolean) - Indicates if there are more pages after the current one. - **hasPreviousPage** (Boolean) - Indicates if there are pages before the current one. - **startCursor** (String) - The cursor for the first item in the current page. - **resolution** (String!) - The temporal resolution of the prices. - **currency** (String!) - The currency of the prices. - **count** (Int!) - The number of items in the current page. - **precision** (String) - The precision of the price values. - **minEnergy** (Float) - The minimum energy value in the current page. - **minTotal** (Float) - The minimum total price in the current page. - **maxEnergy** (Float) - The maximum energy value in the current page. - **maxTotal** (Float) - The maximum total price in the current page. ``` -------------------------------- ### Subscription Source: https://developer.tibber.com/docs/reference Represents a user's subscription to Tibber services. ```APIDOC ## Subscription ### Fields - **id** (ID!) - The unique identifier for the subscription. - **subscriber** (LegalEntity!) - The owner of the subscription. - **validFrom** (String) - The time the subscription started. - **validTo** (String) - The time the subscription ended. - **status** (String) - The current status of the subscription. - **statusReason** (String) - DEPRECATED: No longer available. - **priceInfo** (PriceInfo) - Price information related to the subscription. Set `resolution` to `QUARTER_HOURLY` to get quarter-hourly prices. - **resolution** (PriceInfoResolution) - Temporal resolution for price information. - **priceInfoRange** (SubscriptionPriceConnection) - Historical price information related to the subscription. Replaces `priceInfo.range`. - **resolution** (SubscriptionPriceRangeResolution!) - Temporal resolution. - **first** (Int) - Take the `n` first results from cursor. Cannot be used in conjunction with `last`. - **last** (Int) - Take the `n` last results from cursor. Cannot be used in conjunction with `first`. - **before** (String) - Base64-encoded ISO8601 date/time cursor position. Cannot be used in conjunction with `after`. - **after** (String) - Base64-encoded ISO8601 date/time cursor position. Cannot be used in conjunction with `before`. - **priceRating** (PriceRating) - DEPRECATED: Alternative price information related to the subscription. Use `Subscription.priceInfo` instead. ``` -------------------------------- ### Query Viewer Source: https://developer.tibber.com/docs/reference Retrieves data about the currently logged-in user. ```APIDOC ## Query viewer ### Description This query retrieves data about the logged-in user. ### Query viewer ### Arguments None ``` -------------------------------- ### Production Source: https://developer.tibber.com/docs/reference Information about energy production. ```APIDOC ## Production ### Fields - **from** (String!) - Start time of the production data. - **to** (String!) - End time of the production data. - **unitPrice** (Float) - The price per unit of energy. - **unitPriceVAT** (Float) - The price per unit of energy including VAT. - **production** (Float) - kWh produced. - **productionUnit** (String) - The unit of production measurement. - **profit** (Float) - Total profit of the production. - **currency** (String) - The cost currency. ``` -------------------------------- ### HomeConsumptionEdge Source: https://developer.tibber.com/docs/reference Represents an edge in the home consumption connection, linking a cursor to a consumption node. ```APIDOC ## HomeConsumptionEdge ### Description An edge in the home consumption connection. ### Fields - **cursor** (String!): A cursor for pagination. - **node** (Consumption!): The consumption data node. ``` -------------------------------- ### Price Source: https://developer.tibber.com/docs/reference Represents a price for a specific time period. ```APIDOC ## Price ### Fields * **total** (Float) - The total price (energy + taxes). * **energy** (Float) - Nord Pool spot price. * **tax** (Float) - The tax part of the price (guarantee of origin certificate, energy tax (Sweden only) and VAT). * **startsAt** (String) - The start time of the price. * **currency** (String!) - The price currency. * **level** (PriceLevel) - The price level compared to recent price values. ``` -------------------------------- ### Subscription LiveMeasurement Source: https://developer.tibber.com/docs/reference Subscribes to the real-time measurement stream from a Pulse or Watty device. ```APIDOC ## Subscription liveMeasurement ### Description Subscribe to real-time measurement stream from Pulse or Watty device. ### Method Subscription ### Arguments - **homeId** (ID!) - Required - The ID of the home to subscribe to. ### Response - **liveMeasurement** (LiveMeasurement) ``` -------------------------------- ### Checking Real-Time Consumption Feature Source: https://developer.tibber.com/docs/guides/calling-api GraphQL query to check if real-time consumption data is enabled for a specific home. ```APIDOC ## Query for Real-Time Consumption Feature ### Description Queries the API to determine if the home is equipped with devices that support streaming real-time consumption data. ### Method POST ### Endpoint https://api.tibber.com/v1-beta/gql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query to check for the feature. ### Request Example ```json { "query": "{ viewer { home(id: \"96a14971-525a-4420-aae9-e5aedaa129ff\") { id features { realTimeConsumptionEnabled } } } }" } ``` ### Headers - **Authorization**: Bearer [YOUR_ACCESS_TOKEN] - **Content-Type**: application/json ### Response #### Success Response (200) - **data** (object) - **viewer** (object) - **home** (object) - **id** (string) - The ID of the home. - **features** (object) - **realTimeConsumptionEnabled** (boolean) - Indicates if real-time consumption is enabled. ### Response Example ```json { "data": { "viewer": { "home": { "id": "96a14971-525a-4420-aae9-e5aedaa129ff", "features": { "realTimeConsumptionEnabled": true } } } } } ``` ``` -------------------------------- ### PriceRating Source: https://developer.tibber.com/docs/reference Provides price ratings and statistics for different time periods. ```APIDOC ## PriceRating ### Fields * **thresholdPercentages** (PriceRatingThresholdPercentages!) - The different 'high'/'low' price breakpoints (market dependent). * **hourly** (PriceRatingType!) - The hourly prices of today, the previous 7 days, and tomorrow. * **daily** (PriceRatingType!) - The daily prices of today and the previous 30 days. * **monthly** (PriceRatingType!) - The monthly prices of this month and the previous 31 months. ``` -------------------------------- ### Valid GraphQL Query for Home IDs Source: https://developer.tibber.com/docs/guides/graphql-concepts A basic GraphQL query to fetch the 'id' field for a list of homes. This demonstrates selecting scalar fields. ```graphql { homes { id } } ``` -------------------------------- ### MeteringPointData Source: https://developer.tibber.com/docs/reference Contains information about a specific metering point. ```APIDOC ## MeteringPointData ### Fields * **consumptionEan** (String) - The metering point ID of the home. * **gridCompany** (String) - The grid provider of the home. * **gridAreaCode** (String) - The grid area the home/metering point belongs to. * **priceAreaCode** (String) - The price area the home/metering point belongs to. * **productionEan** (String) - The metering point ID of the production. * **energyTaxType** (String) - The eltax type of the home (only relevant for Swedish homes). * **vatType** (String) - The VAT type of the home (only relevant for Norwegian homes). * **estimatedAnnualConsumption** (Int) - The estimated annual consumption as reported by grid company. ``` -------------------------------- ### PriceRatingEntry Source: https://developer.tibber.com/docs/reference Represents an individual price entry within a price rating period. ```APIDOC ## PriceRatingEntry ### Fields * **time** (String!) - The start time of the price. * **energy** (Float!) - Nord Pool spot price. * **total** (Float!) - The total price (incl. tax). * **tax** (Float!) - The tax part of the price (guarantee of origin certificate, energy tax (Sweden only) and VAT). * **difference** (Float!) - The percentage difference compared to the trailing price average (1 day for 'hourly', 30 days for 'daily' and 32 months for 'monthly'). * **level** (PriceRatingLevel!) - The price level compared to recent price values (calculated using 'difference' and 'priceRating.thresholdPercentages'). ``` -------------------------------- ### Subscription TestMeasurement Source: https://developer.tibber.com/docs/reference Subscribes to a test measurement stream. ```APIDOC ## Subscription testMeasurement ### Description Subscribe to test stream. ### Method Subscription ### Arguments - **count** (Int) - Optional - The number of test measurements to receive. - **complete** (Boolean) - Optional - Whether to complete the stream after receiving measurements. ``` -------------------------------- ### PriceRatingThresholdPercentages Source: https://developer.tibber.com/docs/reference Defines the percentage thresholds for 'high' and 'low' price ratings. ```APIDOC ## PriceRatingThresholdPercentages ### Fields * **high** (Float!) - The percentage difference when the price is considered to be 'high' (market dependent). * **low** (Float!) - The percentage difference when the price is considered to be 'low' (market dependent). ``` -------------------------------- ### GraphQL Endpoint URL Source: https://developer.tibber.com/docs/guides/calling-api The base URL for all GraphQL API requests. ```text https://api.tibber.com/v1-beta/gql ``` -------------------------------- ### SubscriptionPriceEdge Source: https://developer.tibber.com/docs/reference An edge object connecting a cursor to a price node. ```APIDOC ## SubscriptionPriceEdge ### Fields - **cursor** (String!) - The global ID of the element. - **node** (Price) - A single price node. ``` -------------------------------- ### PushNotificationInput Source: https://developer.tibber.com/docs/reference Input for sending push notifications. ```APIDOC ## PushNotificationInput ### Fields - **title** (String) - The title of the notification. - **message** (String!) - The main content of the notification. - **screenToOpen** (AppScreen) - The screen to open when the notification is tapped. ``` -------------------------------- ### MeterReadingInput Source: https://developer.tibber.com/docs/reference Input for submitting meter readings. Deprecated. ```APIDOC ## MeterReadingInput ### Fields - **homeId** (ID!) - The ID of the home. - **time** (String) - The timestamp of the reading. - **reading** (Int!) - The meter reading value. ``` -------------------------------- ### GraphQL Query Wrapped in JSON Source: https://developer.tibber.com/docs/guides/calling-api How to structure a GraphQL query within a JSON object for an HTTP POST request. ```json { "query": "{ viewer { name }}" } ``` -------------------------------- ### PushNotificationResponse Source: https://developer.tibber.com/docs/reference Response object for push notification requests. ```APIDOC ## PushNotificationResponse ### Fields - **successful** (Boolean!) - Indicates if the push notification was sent successfully. - **pushedToNumberOfDevices** (Int!) - The number of devices the notification was pushed to. ``` -------------------------------- ### PriceRatingType Source: https://developer.tibber.com/docs/reference Aggregated price statistics for a specific resolution (hourly, daily, monthly). ```APIDOC ## PriceRatingType ### Fields * **minEnergy** (Float!) - Lowest Nord Pool spot price over the time period. * **maxEnergy** (Float!) - Highest Nord Pool spot price over the time period. * **minTotal** (Float!) - Lowest total price (incl. tax) over the time period. * **maxTotal** (Float!) - Highest total price (incl. tax) over the time period. * **currency** (String!) - The price currency. * **entries** ([PriceRatingEntry!]!) - The individual price entries aggregated by hourly/daily/monthly values. ``` -------------------------------- ### Mutation SendMeterReading Source: https://developer.tibber.com/docs/reference Deprecated mutation for sending meter readings. This mutation is no longer available and calling it will have no effect. ```APIDOC ## Mutation sendMeterReading ### Description Deprecated; calling this mutation will do nothing. This mutation is no longer available. ### Method Mutation ### Input - **meterReadingInput** (MeterReadingInput!) - Required ### Response - **sendMeterReading** (MeterReadingResponse!) - Deprecated ``` -------------------------------- ### LegalEntity Source: https://developer.tibber.com/docs/reference Represents a legal entity with its associated contact and address information. ```APIDOC ## LegalEntity ### Description Represents a legal entity with its associated contact and address information. ### Fields - **id** (ID!): The unique identifier for the legal entity. - **firstName** (String): First/Given name of the entity. - **isCompany** (Boolean): True if the entity is a company. - **name** (String!): Full name of the entity. - **middleName** (String): Middle name of the entity. - **lastName** (String): Last name of the entity. - **organizationNo** (String): Organization number - only populated if entity is a company (isCompany=true). - **language** (String): The primary language of the entity. - **contactInfo** (ContactInfo): Contact information of the entity. - **address** (Address): Address information for the entity. ``` -------------------------------- ### MeterReadingResponse Source: https://developer.tibber.com/docs/reference Represents a meter reading. This object is deprecated and will only return default values. ```APIDOC ## MeterReadingResponse Deprecated; will only return default values. ### Fields * **homeId** ⚠️ (ID!) - Deprecated. Do not use anymore. * **time** ⚠️ (String) - Deprecated. Always returns `null`. * **reading** ⚠️ (Int!) - Deprecated. Always returns `0`. ``` -------------------------------- ### Mutation SendPushNotification Source: https://developer.tibber.com/docs/reference Sends a notification to Tibber app on registered devices. ```APIDOC ## Mutation sendPushNotification ### Description Sends notification to Tibber app on registered devices. ### Method Mutation ### Input - **pushNotificationInput** (PushNotificationInput!) - Required ### Response - **sendPushNotification** (PushNotificationResponse!) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.