terjesannum / tibber-exporter

Monitor your power usage and costs with Tibber, Prometheus and Grafana
MIT License
43 stars 5 forks source link

Can't fetch measurements #5

Closed lischetzke closed 11 months ago

lischetzke commented 11 months ago

Running into "Measurements to old" when running docker container.

Environment:

Logs

2023/10/18 13:11:11 Starting tibber-exporter/3.3.0 (https://github.com/terjesannum/tibber-exporter)
2023/10/18 13:11:12 Websocket url: wss://websocket-api.tibber.com/v1-beta/gql/subscriptions
2023/10/18 13:11:12 Found home: <REDACTED> - <REDACTED>
2023/10/18 13:11:12 Starting monitoring of home: <REDACTED> - <REDACTED>
2023/10/18 13:11:12 Current subscription: <REDACTED>
2023/10/18 13:11:12 Creating home collector for home <REDACTED>
2023/10/18 13:11:12 Realtime consumption enabled for <REDACTED>: true
2023/10/18 13:11:12 Starting live measurements monitoring of home <REDACTED>
2023/10/18 13:11:12 Creating measurements subscription for home<REDACTED>
2023/10/18 13:11:12 Updating prices for <REDACTED>
2023/10/18 13:11:12 Starting subscription <REDACTED> for home <REDACTED>
2023/10/18 13:11:12 Starting http listener
2023/10/18 13:11:12 {"type":"connection_init","payload":{"token":"<REDACTED>"}} client
2023/10/18 13:11:12 {"type":"connection_ack"} server
2023/10/18 13:11:12 {"id":"<REDACTED>","type":"subscribe","payload":{"query":"subscription ($id:ID!){liveMeasurement(homeId: $id){timestamp,power,minPower,maxPower,averagePower,accumulatedConsumption,accumulatedCost,currentL1,currentL2,currentL3,voltagePhase1,voltagePhase2,voltagePhase3,signalStrength,accumulatedProduction,accumulatedReward,powerProduction,powerReactive,powerProductionReactive,minPowerProduction,maxPowerProduction,powerFactor}}","variables":{"id":"<REDACTED>"}}} client
2023/10/18 13:11:12 Measurements subscription for home <REDACTED>
2023/10/18 13:11:16 Measurements to old: 0001-01-01 00:00:00 +0000 UTC
2023/10/18 13:11:21 Measurements to old: 0001-01-01 00:00:00 +0000 UTC
2023/10/18 13:11:26 Measurements to old: 0001-01-01 00:00:00 +0000 UTC

Tibber API Explorer

Query:

subscription {
  liveMeasurement(homeId:"<REDACTED>"){
    timestamp
    power
    accumulatedConsumption
    accumulatedCost
    currency
    minPower
    averagePower
    maxPower
  }
}

Result:

"Your subscription data will appear here after server publication"

Would be happy for any help. Not sure if issue occurs because of a misconfiguration on my side or a change of the API. Was working before.

terjesannum commented 11 months ago

Strange.. You don't get anything more in the API explorer? Looks like the measurement feed isn't starting properly

lischetzke commented 11 months ago

Could reconnecting Tibber Pulse help? The strange part is, that in the mobile app the real-time data is still working.

Will check Tibber Pulse when I'm at home. Just checked right now and it seems that Tibber Pulse disconnected last thursday. Cannot say for sure when Tibber-Exporter started with the issue but I'm sure that it was before last thursday.

Will keep you updated and thanks for your quick response.

terjesannum commented 11 months ago

If you get realtime data in the Tibber App I guess your Pulse is working fine. You should be seeing the measurements in the API exporter, not just "Your subscription data will appear here after server publication". So to me it looks like a network issue or some problem at the Tibber side.

What happens if you use the demo token 5K4MVS-OjfWhK_4yrjOlFe1F6kJXPVf7eQYggo8ebAE and home 96a14971-525a-4420-aae9-e5aedaa129ff ?

lischetzke commented 11 months ago

Using demo token:

Seems like an issue on my side then

lischetzke commented 11 months ago

Very strange behavior. After over a month without touching Tibber Pulse and without any issues, it decided to stop working because it is not perfectly aligned with my power meter. I've checked that now and I'm getting data again. Perhaps I've misinterpreted the App's data, because I noticed Grafana missing data before the Tibber App detected missing data.