Closed swejmansson closed 2 years ago
Thanks for letting me know this. Are you buying electricity from Tibber? You must have a subscription to Tibber to get the hourly prices
Yes, I buy electricity from Tibber ๐ When I start the plugin the current price gets updated, but not after that. Let me know if you want some more info.
If it is to any use for you to have a full log from the past days, here you go ๐
Hi. First great work on this plugin. I'm also experiencing same issue as swejmansson. If I disable and enable the tibber plugin under HW in domotics, it does update price, so the query towards tibber seems to work, its only the automatically update at 0 minutes that appears to be lacking (at my side at least). Also (not sure if it's at your side or domo) would it be possible to have 2 decimals on cost when kr is selected?
@nisak80 , nice to here it is not only me having this issue ๐ Iยดm not really into Python but tried some digging in the code, I'm not skilled enough and failed. I did manage to force it to belive I dont have any Watty or Pulse connected, But still same issue.... We have to wait for @flopp999 to solve it and then buy him coffee ๐
I will look at this now, sorry for the long delay
Hi, version 1.13 is now available. Please update and tell if everything is fine now :)
Thanks for your patient
Thanks for the improvement! Now the current price is updated and I am happy ๐ I will evaluate it for some time and let you know if I notice something strange. I actually noticed some odd behaviors..... The current price plus the others appears to be downloaded quite often, not an issue but don't know if this was what you intended. At the moment I do not use the live data from Pulse but it appears it is now updated less frequent. I would say around every other minute. Also noticed you removed "Tibber - " from the device names, no issue, but I needed to update my scripts and visualizations in HomeHabit. Ok, but harder to sort/group, but easier to read, I'm happy with whatever name.
Bought you a cup of coffee, thanks for the good work ๐ชโ
Great work, thanks, will also buy you a coffe ๐
Like @swejmansson I also see that it is pulling prices as often as him, and not once an hour (at 0 min) as your readme say. That I dont care so much about, but live data on the other hand. with v 1.12 i had live data update every 30 sec, with 1.13 its now about every 50 sec. I also use live data from pulse, so the resolution can be much better I have tested on develope.tibber.
2022-01-24 07:32:31.541 Tibber: (Tibber) Live power updated 2022-01-24 07:32:45.070 Tibber: (Tibber) CurrentPrice Updated 2022-01-24 07:32:46.993 Tibber: (Tibber) 1.7238 2022-01-24 07:32:46.993 Tibber: (Tibber) Current Price Updated 2022-01-24 07:32:47.591 Tibber: (Tibber) Minimum Price Updated 2022-01-24 07:32:47.591 Tibber: (Tibber) Maximum Price Updated 2022-01-24 07:32:47.591 Tibber: (Tibber) Mean Price Updated 2022-01-24 07:33:18.060 Tibber: (Tibber) Live power updated 2022-01-24 07:34:06.072 Tibber: (Tibber) Live power updated 2022-01-24 07:34:25.063 Tibber: (Tibber) CurrentPrice Updated 2022-01-24 07:34:25.673 Tibber: (Tibber) 1.7238 2022-01-24 07:34:25.673 Tibber: (Tibber) Current Price Updated 2022-01-24 07:34:26.298 Tibber: (Tibber) Minimum Price Updated 2022-01-24 07:34:26.298 Tibber: (Tibber) Maximum Price Updated 2022-01-24 07:34:26.298 Tibber: (Tibber) Mean Price Updated 2022-01-24 07:34:58.434 Tibber: (Tibber) Live power updated 2022-01-24 07:35:48.433 Tibber: (Tibber) Live power updated 2022-01-24 07:36:05.069 Tibber: (Tibber) CurrentPrice Updated 2022-01-24 07:36:05.700 Tibber: (Tibber) 1.7238 2022-01-24 07:36:05.700 Tibber: (Tibber) Current Price Updated 2022-01-24 07:36:06.229 Tibber: (Tibber) Minimum Price Updated 2022-01-24 07:36:06.229 Tibber: (Tibber) Maximum Price Updated 2022-01-24 07:36:06.229 Tibber: (Tibber) Mean Price Updated 2022-01-24 07:36:35.972 Tibber: (Tibber) Live power updated 2022-01-24 07:37:28.414 Tibber: (Tibber) Live power updated 2022-01-24 07:37:45.050 Tibber: (Tibber) CurrentPrice Updated 2022-01-24 07:37:45.748 Tibber: (Tibber) 1.7238 2022-01-24 07:37:45.748 Tibber: (Tibber) Current Price Updated 2022-01-24 07:37:46.269 Tibber: (Tibber) Minimum Price Updated 2022-01-24 07:37:46.269 Tibber: (Tibber) Maximum Price Updated 2022-01-24 07:37:46.269 Tibber: (Tibber) Mean Price Updated 2022-01-24 07:38:17.953 Tibber: (Tibber) Live power updated
I will change so it is not updating prices that often. What parameter/s do you want every 10 seconds? power, minPower, maxPower, powerProduction, powerReactive, powerProductionReactive, minPowerProduction, maxPowerProduction, lastMeterProduction, powerFactor, voltagePhase1, voltagePhase2, voltagePhase3, currentL1, currentL2, currentL3, signalStrength, lastMeterConsumption, accumulatedConsumption, accumulatedProduction, accumulatedConsumptionLastHour, accumulatedProductionLastHour, accumulatedCost, accumulatedReward, averagePower
Thanks for the coffee :)
I have still not started to use the live data but my user cases I have thought of are related to "power" (power consumed right now) and the three phases. For me the others can be updated less frequent, but lets see what @nisak80 who accually use the has to say ๐ With an older version of the plugin I noticed some latencies in Domoticz event system when I activated the tibber plugin. My assumption was it had to do with pulling and storing all the live data. I might be wrong, but that was when I came up with the idea to add a switch to turn off all the live data if not used. With 1.13 I have no latencies.....
@swejmansson thanks for the information. I also have/had some issues with this plugin, sometimes when I start it, it will crash my DZ. I will wait for @nisak80
I'm on 1.13 and still have issues with updates. Domoticz 2022.1 Python Version: 3.7.3 2x Domoticz installations with same issue. Both on rpi4 OS Buster.
Only heartbeats after domoticz/plugin is first started. The plugin does not update devices every hour. I do not have a real time device yet. At initial start of domoticz or plugin the devices are updated. Below is a log stretching from 13.48 today to 16.27. Nothing but onHeartbeat during that time, except for 13.48 when plugin was started.
2022-02-01 13:48:31.970166 Internet is OK 2022-02-01 13:48:32.235183 Entered CheckInternet 2022-02-01 13:48:32.235813 Ping 2022-02-01 13:48:32.474662 Internet is OK 2022-02-01 13:48:32.552439 Current Price Updated 2022-02-01 13:48:32.760233 Entered CheckInternet 2022-02-01 13:48:32.761234 Ping 2022-02-01 13:48:32.998105 Internet is OK 2022-02-01 13:48:33.100631 Minimum Price Updated 2022-02-01 13:48:33.101128 Maximum Price Updated 2022-02-01 13:48:33.101494 Mean Price Updated 2022-02-01 13:48:38.330767 onHeartbeat 2022-02-01 13:48:48.076303 onHeartbeat 2022-02-01 13:48:58.054523 onHeartbeat 2022-02-01 13:49:08.078033 onHeartbeat 2022-02-01 13:49:18.065077 onHeartbeat 2022-02-01 13:52:08.085446 onHeartbeat 2022-02-01 13:52:18.058025 onHeartbeat 2022-02-01 13:52:28.085765 onHeartbeat 2022-02-01 13:52:38.085448 onHeartbeat 2022-02-01 13:52:48.058240 onHeartbeat 2022-02-01 13:52:58.165572 onHeartbeat 2022-02-01 13:53:08.095734 onHeartbeat 2022-02-01 13:53:18.069710 onHeartbeat 2022-02-01 13:53:28.091195 onHeartbeat 2022-02-01 13:53:38.070656 onHeartbeat 2022-02-01 13:53:48.054306 onHeartbeat 2022-02-01 13:53:58.074868 onHeartbeat 2022-02-01 13:54:08.067375 onHeartbeat .... 2022-02-01 15:59:48.098042 onHeartbeat 2022-02-01 15:59:58.072930 onHeartbeat 2022-02-01 16:00:08.057570 onHeartbeat 2022-02-01 16:00:18.130905 onHeartbeat 2022-02-01 16:00:28.052721 onHeartbeat 2022-02-01 16:00:38.076249 onHeartbeat 2022-02-01 16:00:48.061397 onHeartbeat 2022-02-01 16:00:58.096285 onHeartbeat 2022-02-01 16:01:08.072258 onHeartbeat 2022-02-01 16:01:18.213608 onHeartbeat 2022-02-01 16:01:28.090254 onHeartbeat 2022-02-01 16:01:38.062235 onHeartbeat 2022-02-01 16:01:48.083473 onHeartbeat 2022-02-01 16:01:58.060426 onHeartbeat .... 2022-02-01 16:25:28.097528 onHeartbeat 2022-02-01 16:25:38.068376 onHeartbeat 2022-02-01 16:25:48.177120 onHeartbeat 2022-02-01 16:25:58.059893 onHeartbeat 2022-02-01 16:26:08.078118 onHeartbeat 2022-02-01 16:26:18.057059 onHeartbeat 2022-02-01 16:26:28.082623 onHeartbeat 2022-02-01 16:26:38.059745 onHeartbeat 2022-02-01 16:26:48.087568 onHeartbeat 2022-02-01 16:26:58.165230 onHeartbeat 2022-02-01 16:27:08.094433 onHeartbeat
@dobber81 Do you buy electricity from Tibber?
I dont't until July this year! Is that the problem? I didn't realize that could be an issue as I got new proper values every time the script started from scratch.
Yes, that should be the problem. Since Tibber customer have different prices depending on where you live. Is that value the correct price you get during startup?
Yes it is correct for my zone according to the Tibber app on my phone.
Also I get correct values from tibbers api test page with my api key/home id. Maybe I'm using a different type of query. I will give this a go with my fathers account instead. His electricity is delivered by Tibber since a few months.
When using my fathers api-key with his homeid I get another error. This account is active and electricity is delivered by Tibber. The account has multiple homes, all with delivery from Tibber. If that helps or explains the below messages.
2022-02-01 18:11:53.347 Status: Tibber: Entering work loop. 2022-02-01 18:11:53.347 Status: Tibber: Started. 2022-02-01 18:11:54.929 Status: Tibber: Initialized version 1.13, author 'flopp999' 2022-02-01 18:11:57.107 Tibber: Using Home ID = 1d94f581-1b48-4e41-a2af-xxxxxxxxxxxxx 2022-02-01 18:11:57.618 Tibber: No real time hardware is installed 2022-02-01 18:11:58.735 Error: Tibber: 'onMessage' failed 'TypeError':''NoneType' object is not subscriptable'. 2022-02-01 18:11:58.735 Error: Tibber: Exception traceback: 2022-02-01 18:11:58.735 Error: Tibber: ----> Line 512 in '/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py', function onMessage 2022-02-01 18:11:58.735 Error: Tibber: ----> Line 267 in '/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py', function onMessage
2022-02-01 18:11:54.931767 onStart 2022-02-01 18:11:55.151159 Entered CheckInternet 2022-02-01 18:11:55.151753 Ping 2022-02-01 18:11:57.003116 Internet is OK 2022-02-01 18:11:57.312024 Entered CheckInternet 2022-02-01 18:11:57.312393 Ping 2022-02-01 18:11:57.566941 Internet is OK 2022-02-01 18:11:57.618572 No real time hardware is installed 2022-02-01 18:11:57.820544 Entered CheckInternet 2022-02-01 18:11:57.821315 Ping 2022-02-01 18:11:58.064902 Internet is OK 2022-02-01 18:11:58.380189 Entered CheckInternet 2022-02-01 18:11:58.380733 Ping 2022-02-01 18:11:58.633045 Internet is OK 2022-02-01 18:12:03.251544 onHeartbeat
Hi, sorry for lack of response, been busy. Just checked my domoticz and it seems like the pricing stopped updating 27. of January, but power still updated. Restarted the interface, and now prices are updating once again.
When it comes to what to update every 10 seconds i would suggest
The rest once every hour at 01 minute as you intended.
I guess people with solarpanels or other production equipment would like to have an equal update (10 seconds) of some production parameters, but not quite sure what. Might be quite some work, but the best would probably be to have a toggle in settings if you have production equpment, to querry theese or not.
I think I found the issue with my fathers tibber account. He has 2 houses, but there is a ghost-homeid in place. The last one always gives null values on all queries.
However I think if I enter a valid homeid in domoticz it should still work, right? Not in this case, because self.House always stay on numer 2, regardless of what homeid I put in domoticz.
If I put static "self.House = 1" on line 267 in your code I get no errors and values are put in to the domoticz devices. At least on first start. This way I force your plugin to use the "middle" of 0 and 2 homids. This makes me believe that maybe there is an issue with self.House being set properly according to what homeid is set in domoticz.
Edit: If the plugin tries to read all data from all homeid's and then just uses the one specified in self.House, nothing is wrong in the plugin which relates to self.Home always being the highest numer.
Regardless of what caused my issue I will have Tibber remove that faulty homeid from the account.
I think I have found the issue of devices not being updated by plugin.
Unless self.RealTime is True self.Count will never be set to 0. That is why, unless you have a realtime device, CurrentPrice is never updated. As a test I added this on line 346 in the plugin: if self.Count >= 5: self.Count = 0
When I did that the plugin update the values every 2 minutes. Not a good solution, but at least that tells you why some people without a realtime device get no updates.
This plugin has been working well for me for most of last year but at the end of the year, it stopped working. Done the update and I get the same effect as above that it only updates once. Now I saw in my settings Home ID something I'm not too sure what i should fill in here?
@dobber81 nice catch about self.Count never goes to 0 unless you have RealTime. I will fix this
I don't buy electricity from Tibber and I do not get any prices in Api Explorer. Can you please send me the query that you use in Api Explorer. And I think you use your personal Token and not the DEMO? :)
I connected a Tibber Pulse today and a lot of new devices showed up in domoticz. I will probably use a few of them to build (dzvents) a single P1-dummy device to get more info in to one combined device. For example current/total watt usage, production from solar panels etc. Is this something you would consider building in to the plugin? It would make fewer devices with more info in them in domoticz. Thanks for your great plugin!
This for example gives me current price. I don't know if my account gives me more than yours because they plan on delivering electricity to me from July 1st. I do use my own API-key and homeid :)
{
viewer {
homes {
currentSubscription{
priceInfo{
current{
total
energy
tax
startsAt
}
}
}
}
}
}
@dobber81 can you try this query in API Explorer { viewer { homes { currentSubscription { status } } } }
i get this response
{ "data": { "viewer": { "homes": [ { "currentSubscription": { "status": "running" } } ] } } }
thanks thats why you get price info
about the P1 smart meter, WOW that one I will use instead, same for the CM113 really nice devices
1.15 is uploaded can someone please test it? I hope the price update is fixed
2022-02-02 20:46:20.258339 Entered CheckInternet 2022-02-02 20:46:20.258726 Ping 2022-02-02 20:46:20.515389 Internet is OK 2022-02-02 20:46:29.085834 onHeartbeat 2022-02-02 20:46:29.086651 onHeartbeatLivePower 2022-02-02 20:46:29.337710 Something went wrong during fetching Live Power from Tibber 2022-02-02 20:46:29.338370 received 1002 (protocol error); then sent 1002 (protocol error) 2022-02-02 20:46:39.061403 onHeartbeat 2022-02-02 20:46:39.063822 onHeartbeatLivePower 2022-02-02 20:46:39.342638 Something went wrong during fetching Live Power from Tibber 2022-02-02 20:46:39.343314 received 1002 (protocol error); then sent 1002 (protocol error) 2022-02-02 20:46:49.066718 onHeartbeat
This is from my dads account with active subscription and no watty/pulse in account. (Can't use my own account anymore since I got a Pulse now) 1.15 from beta branch.
Can you try to use this Token? d1007ead2dc84a2b82f0de19451c5fb22112f7ae11d19bf2bedb224a003ff74a that is the old Demo token without Pulse/Watty
2022-02-02 20:56:50.423 Status: Tibber: Entering work loop. 2022-02-02 20:56:51.504 Tibber: Home ID is not correct 2022-02-02 20:56:51.988 Tibber: {'Status': '200', 'Headers': {'Date': 'Wed, 02 Feb 2022 19:56:51 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '78', 'Connection': 'keep-alive', 'X-Powered-By': 'Express', 'Access-Control-Allow-Origin': '', 'ETag': 'W/"4e-NbXzgCf0d59rCAGCnqhOpbdFEWs"', 'Vary': 'Accept-Encoding'}, 'Data': b'{"data":{"viewer":{"homes":[{"id":"c70dcbe5-4485-4821-933d-a8a86452737b"}]}}}\n'} 2022-02-02 20:56:51.988 Tibber: Home 0 has ID = c70dcbe5-4485-4821-933d-a8a86452737b 2022-02-02 20:56:51.502 Status: Tibber: Initialized version 1.15, author 'flopp999' 2022-02-02 20:56:52.669 Tibber: {'Status': '200', 'Headers': {'Date': 'Wed, 02 Feb 2022 19:56:52 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '78', 'Connection': 'keep-alive', 'X-Powered-By': 'Express', 'Access-Control-Allow-Origin': '', 'ETag': 'W/"4e-NbXzgCf0d59rCAGCnqhOpbdFEWs"', 'Vary': 'Accept-Encoding'}, 'Data': b'{"data":{"viewer":{"homes":[{"id":"c70dcbe5-4485-4821-933d-a8a86452737b"}]}}}\n'} 2022-02-02 20:56:52.669 Tibber: Using Home ID = c70dcbe5-4485-4821-933d-a8a86452737b 2022-02-02 20:57:00.158 Tibber: 1 2022-02-02 20:57:10.101 Tibber: 2 2022-02-02 20:57:20.087 Tibber: 3 2022-02-02 20:57:30.061 Tibber: 4 2022-02-02 20:57:40.093 Tibber: 5 2022-02-02 20:57:50.070 Tibber: 1 2022-02-02 20:58:00.070 Tibber: 2 2022-02-02 20:58:10.099 Tibber: 3 2022-02-02 20:58:20.093 Tibber: 4 2022-02-02 20:58:30.072 Tibber: 5 2022-02-02 20:58:40.098 Tibber: 1 2022-02-02 20:58:50.094 Tibber: 2
Tibber.log 2022-02-02 20:58:00.069353 onHeartbeat 2022-02-02 20:58:00.070293 onHeartbeatLivePower 2022-02-02 20:58:00.413756 Something went wrong during fetching Live Power from Tibber 2022-02-02 20:58:00.416024 received 1002 (protocol error); then sent 1002 (protocol error) 2022-02-02 20:58:10.096980 onHeartbeat
now I know why you get error 1002, give me a few minutes
1.16 is uploaded
Looks a lot better. No errors. Now I will just have to wait and see if the device is updated at 22:00 with new price.
2022-02-02 21:29:37.121686 onStart 2022-02-02 21:29:37.329681 Entered CheckInternet 2022-02-02 21:29:37.330069 Ping 2022-02-02 21:29:37.552783 Internet is OK 2022-02-02 21:29:46.147582 onHeartbeat 2022-02-02 21:29:46.148375 onHeartbeatLivePower 2022-02-02 21:29:56.073058 onHeartbeat 2022-02-02 21:29:56.075427 onHeartbeatLivePower 2022-02-02 21:30:06.096111 onHeartbeat 2022-02-02 21:30:06.096567 onHeartbeatLivePower 2022-02-02 21:30:16.067324 onHeartbeat 2022-02-02 21:30:16.069684 onHeartbeatLivePower 2022-02-02 21:30:26.089707 onHeartbeat 2022-02-02 21:30:26.092092 onHeartbeatLivePower 2022-02-02 21:30:36.064076 onHeartbeat 2022-02-02 21:30:36.065021 onHeartbeatLivePower 2022-02-02 21:30:46.136596 onHeartbeat 2022-02-02 21:30:46.137474 onHeartbeatLivePower 2022-02-02 21:30:56.063552 onHeartbeat 2022-02-02 21:30:56.066101 onHeartbeatLivePower
Should the onHeartbeatLivePower be active if the account does not have a live power device?
It was on the wrong line, I have now moved it to be inside LivePowerEvery Thanks for all testing :)
Least I can do when you're doing all the hard work :)
Sorry to report that Current Price was not updated at 22:00 on either of my two installations. One account with live update device and the other without.
2022-02-02 21:59:47.063630 onHeartbeatLivePower 2022-02-02 21:59:57.085169 onHeartbeat 2022-02-02 21:59:57.087638 onHeartbeatLivePower 2022-02-02 22:00:07.056973 onHeartbeat 2022-02-02 22:00:07.057851 onHeartbeatLivePower 2022-02-02 22:00:17.077719 onHeartbeat 2022-02-02 22:00:17.080153 onHeartbeatLivePower 2022-02-02 22:00:27.099121 onHeartbeat 2022-02-02 22:00:27.101561 onHeartbeatLivePower 2022-02-02 22:00:37.070427 onHeartbeat 2022-02-02 22:00:37.071328 onHeartbeatLivePower 2022-02-02 22:00:47.098356 onHeartbeat 2022-02-02 22:00:47.099265 onHeartbeatLivePower 2022-02-02 22:00:57.075409 onHeartbeat 2022-02-02 22:00:57.077957 onHeartbeatLivePower 2022-02-02 22:01:07.058704 onHeartbeat
Strange because it worked for me with the Demo Token. I will shutdown for today. Can you please let it run during the night and see if it updates.
I will, and before I go to bed I'll make sure to remove and pull everything from git again. Just to be sure.
Re-pulled from git and rebooted. Now my own installation pulls all the data! Will do the same to the installation without Pulse tomorrow and make sure everything is running smooth there as well. Tnx!
Found an issue that was part of my problem. If checkbox "Create devices for Pulse/Watty" is set to NO, then no devices are created at all, not even the current price etc. Did a fresh install of domoticz and the plugin on a test-pi and found this. I also belive that if it is set to NO, no data is updated at all, but I have not confirmed this yet.
After a few more tests, all with the same result, I think I'm sure. When Create devices for Pulse/Watty" is set to NO, no data att all is updated. This test was done with active account with no Pulse/Watty. When I set YES all data polling is resumed.
All my setups have now been running (and polling data) all day. Hourly updates are OK. Unless "Create devices for Pulse/Watty" is set to NO.
thank you so much for your help found the bug and upload ed version 1.17 feel free to try it :) I will close this issue since the main bug is fixed
Tried the plugin some versions ago but did not really had the time to use it. Today I decided to get it up and running and create some automations related to the current price. I updated to latest verison 1.12 and it starts up and the data from Pulse is coming in as it should but the "Current Prices" is not updated hourly. Cant figure out why, is it a bug? /Jens
Installation as follows: Version: 2021.1 Build Hash: 8547c5b7e Compile Date: 2021-04-17 17:29:11 dzVents Version: 3.1.7 Python Version: 3.7.3 (default, Dec 20 2019, 18:57:59) [GCC 8.3.0]