flopp999 / Tibber-Domoticz

Script to communicate with Tibber. Help me with a buy-me-a-coffee
https://www.buymeacoffee.com/flopp999
GNU General Public License v3.0
8 stars 4 forks source link

No new devices created #57

Closed evanhemmen closed 1 year ago

evanhemmen commented 1 year ago

Hi, I saw that about a year ago a similar issue was closed as it solved itself but I'm afraid my issue is not solving itself.

I istalled the plugin v1.2.0 as per instructions on my Domoticz v2022.1 on a Raspberry Pi running Raspbian. No new devices are created (restarting or rebooting Domoticz doesn't help either).

Both Domoticz log as Tibber.log do not show any errors.

Tibberlog

Any suggestions?

Edit: If I use the Demo Token Domoticz log is showing some errors:

2022-12-31 15:29:22.696 Error: Tibber: 'onMessage' failed 'IndexError':'list index out of range'.
2022-12-31 15:29:22.696 Error: Tibber: Exception traceback:
2022-12-31 15:29:22.696 Error: Tibber: ----> Line 535 in '/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py', function onMessage
2022-12-31 15:29:22.696 Error: Tibber: ----> Line 269 in '/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py', function onMessage 
belzig commented 1 year ago

Same with me. No device created.

Version: 2022.1 (build 14318) Build Hash: a380461ea Compile Date: 2022-04-22 07:36:31 dzVents Version: 3.1.8 Python Version: 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110]

flopp999 commented 1 year ago

Thanks for creating an issue. I have now fix it. It was wrong Demo token. If you had copied your own Token it should have worked. Did you change the token?

belzig commented 1 year ago

Hi, now it works like a charm with the demotoken.

With my own token, still no new devices show up. I think its because my contract hasnt be confirmed yet. I`ll try again when it ist confirmed and Pulse IR is delivered.

Thanks for your work

evanhemmen commented 1 year ago

If you've seen this post before this edit: nevermind.... :-)

It took a couple of minutes and suddenly the devices became visible.

Thank you very much for the update, much appreciated.

Still there is a error message in the Domoticz log, any idea what it means?

Error Domoticz Tibber

JanvdW304 commented 1 year ago

I have the same issue, and I think that the plugin only works the moment that the contract is started. Till then the realTimeConsumptionEnabled element is false which lead to the error message "No real time hardware is installed". See my issue for details

evanhemmen commented 1 year ago

Thanks for the info. This could be the reason as my contract starts 14th of January. In the Tibber app I already see the tariffs so I thought it would be available to me via the api as wel. I'll wait and report back after the 14th.

flopp999 commented 1 year ago

It should with Demo token. Do you get devices when using Demo token?

belzig commented 1 year ago

If you want to use the demotoken, go to Tibber api Explorer. https://developer.tibber.com/explorer -> Load Demotoken

Try this query

{ viewer { homes { id address { address1 address2 address3 postalCode city country latitude longitude } } } } Then you shoud get this output

{ "data": { "viewer": { "homes": [ { "id": "96a14971-525a-4420-aae9-e5aedaa129ff", "address": { "address1": "Winterfell Castle 1", "address2": null, "address3": null, "postalCode": null, "city": null, "country": null, "latitude": null, "longitude": null } } ] } } }

The creditals for Domotics are then Token 5K4MVS-OjfWhK_4yrjOlFe1F6kJXPVf7eQYggo8ebAE <- Thats the demotoken HomeID 96a14971-525a-4420-aae9-e5aedaa129ff <-Thats the ID provided by the query

Then a awfull lot of devices will be created. No worry, they will be deleted when you delete the Tibber Api 2.0 in Hardware Folder

Hope it helps

flopp999 commented 1 year ago

You don't need to create an account to be able to use the Demo token.

belzig commented 1 year ago

Yes your right, you can run the API Explorer without being logged in.

evanhemmen commented 1 year ago

It should with Demo token. Do you get devices when using Demo token?

Yes devices appeared with demo token.

Another question: will the currency change to Euro and the tariff to Netherlands when I use my own Token and Home ID?

flopp999 commented 1 year ago

It should with Demo token. Do you get devices when using Demo token?

Yes devices appeared with demo token.

Another question: will the currency change to Euro and the tariff to Netherlands when I use my own Token and Home ID?

Good question. I didn't know that Tibber existed in the Netherlands.

evanhemmen commented 1 year ago

Hahaha, now you know :-).

I’ll let you know what happens when my contract starts 14th of January.

me-processware commented 1 year ago

It should with Demo token. Do you get devices when using Demo token?

Yes devices appeared with demo token. Another question: will the currency change to Euro and the tariff to Netherlands when I use my own Token and Home ID?

Good question. I didn't know that Tibber existed in the Netherlands.

+1 on the EUR part :) i'am from the netherlands also.

bigger problem is the plugin stopped today again @ 12:59 pm (a default let's brake things on the api side?)

2023-01-11 01:38:30.052404 onHeartbeat 2023-01-11 01:38:30.052567 onHeartbeatLivePowerEvery 2023-01-11 01:38:30.210266 Something went wrong during fetching Live Power from Tibber 2023-01-11 01:38:30.210394 received 4400 (private use) User-agent HTTP header or userAgent property within connectionParams missing or not informative enough; value 'user_agent'; then sent 4400 (private use) User-agent HTTP header or userAgent property within connectionParams missing or not informative enough; value 'user_agent'

Sicco74 commented 1 year ago

Hahaha, now you know :-).

I’ll let you know what happens when my contract starts 14th of January.

I am also curious, also NL and starting the 1st of Feb...

Sicco74 commented 1 year ago

It should with Demo token. Do you get devices when using Demo token?

Yes devices appeared with demo token. Another question: will the currency change to Euro and the tariff to Netherlands when I use my own Token and Home ID?

Good question. I didn't know that Tibber existed in the Netherlands.

Yes, I am starting from the 1st of Feb and also would like Dutch prices and Euro :-).

me-processware commented 1 year ago

It should with Demo token. Do you get devices when using Demo token?

Yes devices appeared with demo token. Another question: will the currency change to Euro and the tariff to Netherlands when I use my own Token and Home ID?

Good question. I didn't know that Tibber existed in the Netherlands.

+1 on the EUR part :) i'am from the netherlands also.

bigger problem is the plugin stopped today again @ 12:59 pm (a default let's brake things on the api side?)

2023-01-11 01:38:30.052404 onHeartbeat 2023-01-11 01:38:30.052567 onHeartbeatLivePowerEvery 2023-01-11 01:38:30.210266 Something went wrong during fetching Live Power from Tibber 2023-01-11 01:38:30.210394 received 4400 (private use) User-agent HTTP header or userAgent property within connectionParams missing or not informative enough; value 'user_agent'; then sent 4400 (private use) User-agent HTTP header or userAgent property within connectionParams missing or not informative enough; value 'user_agent'

i found the error and fixed it here https://github.com/me-processware/Tibber-Domoticz/commit/8dfa3fbbe97c61eba635e047e9c3ff0e165c6a7c

flopp999 commented 1 year ago

It works for me with User-Agent. If you got time you are welcome to do a PR 😀

me-processware commented 1 year ago

It works for me with User-Agent. If you got time you are welcome to do a PR 😀

done i had to google that. never done it before

evanhemmen commented 1 year ago

I promised to report back. My contract started today and now values are being updated based on my personal token and location-id.

Wrt euro's/€... In Domoticz you can edit the device and add €/kWh to the name and axis-label. Works perfect now!

Schermafbeelding 2023-01-14 143505