ottopaulsen / MMM-Tibber

Show data from Tibber in MagicMirror
MIT License
33 stars 11 forks source link

Current consuption isn't shown in the graph #52

Closed user74656 closed 1 year ago

user74656 commented 1 year ago

I just installed the module an everything works fine, but my current cunsumption isn't shown in the graph, but in the power gauge: This is my config:

 module: 'MMM-Tibber',
    position: 'bottom_center',
    config: {
        tibberToken: ‘XXXX’,
        homeId: ‘XXXXXXX’,
        updateInterval: 10, // Tibber query update interval in minutes
  // Chart
  historyHours: 24, // How long history for price and consumption to see in the graph
  futureHours: 48, // How long into the future to see price data
  graphWidth: 1000, // Uses available width by default
  graphHeight: 270,
showPrice: true,
  priceChartType: "column", // column, line or spline
  // Price label and min/max price text
  priceUnit: "€",
  decimalSeparator: ",",
   showCurrentPrice: true,
showConsumption: true,
  consumptionChartType: "spline", // column, line or spline
  consumptionLineWidth: 3, // For line and spline
  consumptionColor: "#ffcc00", // For line and spline
  consumptionDecimals: 1,
 // Min and Max price lines
  showMinPrice: true,
  showMaxPrice: true,
   showMinConsumption: true,
  showMaxConsumption: true,
}

screenshot1

ottopaulsen commented 1 year ago

I cannot see anything wrong with your config, but I suggest that you remove config where you use the default value. You could try to turn on logging and watch the console output. See if you can see any error messages, and also if you can see the consumption data logged.

user74656 commented 1 year ago

According to the log, everything seems to be working properly. The consumption data is also displayed in the log: [25.03.2023 12:02.59.746] [LOG] MMM-Tibber: Tibber subscription data:{ "timestamp": "2023-03-25T12:02:59.000+01:00", "power": 232, "accumulatedConsumption": 3.6794, "accumulatedCost": 0, "currency": "EUR", "minPower": 70, "averagePower": 305.3, "maxPower": 4391, "voltagePhase1": null, "voltagePhase2": null, "voltagePhase3": null, "currentL1": null, "currentL2": null, "currentL3": null }

ottopaulsen commented 1 year ago

That is for the gauges. The consumption graph is a data series similar to the price data.

user74656 commented 1 year ago
         {
            "total": 0.2852,
            "startsAt": "2023-03-26T22:00:00.000+02:00",
            "level": "EXPENSIVE"
          },
          {
            "total": 0.2795,
            "startsAt": "2023-03-26T23:00:00.000+02:00",
            "level": "EXPENSIVE"
          }
        ]
      }
    },
    "consumption": {
      "nodes": []
    }
  }
}
[25.03.2023 17:31.25.191] [LOG]   MMM-Tibber: Consumption parts:
[25.03.2023 17:31.25.193] [LOG]   MMM-Tibber: []
[25.03.2023 17:31.25.398] [LOG]   Found endpoint: wss://websocket-api.tibber.com/v1-beta/gql/subscriptions
[25.03.2023 17:31.25.402] [LOG]   User-Agent: MMM-Tibber/2.22.0 (linux; Node.js/v16.14.2)
[25.03.2023 17:31.25.407] [LOG]   Initializing WebSocket

Is this the right place? There is nothing at consumption

ottopaulsen commented 1 year ago

Looks like consumption is empty. Can you try the API explorer at the tibber developer pages, and see if you can get consumption there? If not, you can ask Tibber why.

user74656 commented 1 year ago

In the API explorer of tibber, the consumption is also not displayed. The problem seems to be there. Thanks for your help :)