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

Error: (FindModule) Domoticz/DomoticzEx modules not found in interpreter. #56

Closed JanvdW304 closed 1 year ago

JanvdW304 commented 1 year ago

Today I installed the Tibber plugin and filled the token and Home ID in Domoticz hardware. But when I add the hardware in Domoticz I get an error in the log three times: Error: (FindModule) Domoticz/DomoticzEx modules not found in interpreter. No devices were created.

Disabling the Tibber hardware in Domoticz the same error messages appear again.

I can't find what causes the issue. Any ideas?

flopp999 commented 1 year ago

Is seems that there is something else wrong, if you still get errors after disabling Tibber

JanvdW304 commented 1 year ago

Why? And what?

I junst tried to add Tibber hardware again to be sure everything is done. This time o error message. A popup is displayed Hardware created, devices can be found in the devices tab and the log states: 2023-01-04 22:43:29.173 Status: Tibber: Started. 2023-01-04 22:43:29.173 Status: Tibber: Entering work loop. 2023-01-04 22:43:29.929 Status: Tibber: Initialized version 1.21, author 'flopp999' But still no devices are created...

I created the debug log (Tibber.log). This is the content: 2023-01-04 22:43:29.931028 onStart 2023-01-04 22:43:30.041525 Entered CheckInternet 2023-01-04 22:43:30.042131 Ping 2023-01-04 22:43:30.225422 Internet is OK 2023-01-04 22:43:30.368752 Entered CheckInternet 2023-01-04 22:43:30.426792 Ping 2023-01-04 22:43:30.563334 Internet is OK 2023-01-04 22:43:30.563910 Entered CheckInternet 2023-01-04 22:43:30.565610 Ping 2023-01-04 22:43:30.702177 Internet is OK 2023-01-04 22:43:30.804279 No real time hardware is installed 2023-01-04 22:43:39.076809 onHeartbeat 2023-01-04 22:43:49.054241 onHeartbeat

The message No real time hardware is installed is generated by the code when there's no active housenumber. Which is strange, because a home id is returned for my token in https://developer.tibber.com/explorer.

Besides that I saw that the manual procedure describes that you need to copy some files, among others 'tibberprice.zip'; I can't find this file anywhere.

flopp999 commented 1 year ago

I don't use this plugin myself anymore so I don't update it so often. I have renamed the zip-file. I also updated the Readme now. Try version 1.22

JanvdW304 commented 1 year ago

Just tried the latest version; same result

flopp999 commented 1 year ago

Have you allowed new devices in Domoticz settings?

JanvdW304 commented 1 year ago

Yes, I have

flopp999 commented 1 year ago

Have you installed all requirements?

"sudo pip3 install -r requirements.txt"

What version of python do you have?

Is Domoticz discover Python?

JanvdW304 commented 1 year ago

Yes, I got 'already satisfied' messages about the requirements. I use Python version 3.7.3. Python is used by Domoticz to control a Bose system, so Domoticz is able to use Python.

The Python script generates the message No real time hardware is installed in the log. It looks like that has to do with a valid house number (home id?)

flopp999 commented 1 year ago

Can you try to add one more Tibber hardware, but with different name.

Restarted DZ?

JanvdW304 commented 1 year ago

I can try this evening, but don't expect that this will make a difference. I did already delete the hardware and created it again (same issue). And yes, I restarted Domoticz (otherwise the Tibber hardware wouldn't even be shown)

flopp999 commented 1 year ago

What version of DZ do you have? Do you get any other message in log?

After I restart DZ it look like this

2023-01-05 14:00:16.505 Status: Build Hash: c9526851b, Date: 2022-01-31 09:34:32
2023-01-05 14:00:16.505 Status: Startup Path: /home/debian/domoticz/
2023-01-05 14:00:16.608 Status: PluginSystem: Started, Python version '3.9.2', 5 plugin definitions loaded.
2023-01-05 14:00:16.616 Status: WebServer(HTTP) started on address: :: with port 8080
2023-01-05 14:00:16.618 Status: Camera: settings (re)loaded
2023-01-05 14:00:16.619 Status: TCPServer: shared server started...
2023-01-05 14:00:16.619 Status: RxQueue: queue worker started...
2023-01-05 14:00:18.620 Tibber: Worker thread started.
2023-01-05 14:00:18.621 Status: Tibber: Started.
2023-01-05 14:00:18.621 Status: EventSystem: reset all events...
2023-01-05 14:00:18.622 Status: NotificationSystem: thread started...
2023-01-05 14:00:18.622 Status: Tibber: Entering work loop.
2023-01-05 14:00:18.622 Status: EventSystem: reset all device statuses...
2023-01-05 14:00:18.849 Status: Python EventSystem: Initializing event module.
2023-01-05 14:00:18.851 Status: EventSystem: Started
2023-01-05 14:00:18.851 Status: EventSystem: Queue thread started...
2023-01-05 14:00:19.656 Tibber: Home ID is not correct
2023-01-05 14:00:19.069 Status: PluginSystem: 1 plugins started.
2023-01-05 14:00:19.648 Status: Tibber: Initialized version 1.22, author 'flopp999'
2023-01-05 14:00:20.519 Tibber: Home 0 has ID = 96a14971-525a-4420-aae9-e5aedaa129ff
2023-01-05 14:00:21.021 Tibber: Using Home ID = 96a14971-525a-4420-aae9-e5aedaa129ff
2023-01-05 14:00:22.351 Tibber: Real time hardware is installed and will be fetched every 50 seconds
2023-01-05 14:00:22.504 Tibber: Current Price Updated
2023-01-05 14:00:23.333 Tibber: Minimum Price Updated
2023-01-05 14:00:23.333 Tibber: Maximum Price Updated
2023-01-05 14:00:23.333 Tibber: Mean Price Updated
2023-01-05 14:00:29.022 Tibber: Live power updated 
JanvdW304 commented 1 year ago

Domoticz version is 2022.2 (build 14895)

I created Tibber hardware with a new name ('Tibbers'). No devices were created, but this time I receive more rows in the Domoticz log: 2023-01-05 19:35:40.007 Tibbers: Worker thread started. 2023-01-05 19:35:40.007 Status: Tibbers: Started. 2023-01-05 19:35:40.007 Status: Tibbers: Entering work loop. 2023-01-05 19:35:41.044 Status: Tibbers: Initialized version 1.22, author 'flopp999' 2023-01-05 19:35:41.049 Error: Tibbers: Call to function 'onStart' failed, exception details: 2023-01-05 19:35:41.052 Error: Tibbers: Traceback (most recent call last): 2023-01-05 19:35:41.052 Error: Tibbers: File "/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py", line 419, in onStart 2023-01-05 19:35:41.052 Error: Tibbers: _plugin.onStart() 2023-01-05 19:35:41.052 Error: Tibbers: File "/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py", line 120, in onStart 2023-01-05 19:35:41.052 Error: Tibbers: WriteDebug("onStart") 2023-01-05 19:35:41.052 Error: Tibbers: File "/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py", line 559, in WriteDebug 2023-01-05 19:35:41.052 Error: Tibbers: if Parameters["Mode6"] == "Yes": 2023-01-05 19:35:41.052 Error: Tibbers: KeyError: 'Mode6' 2023-01-05 19:35:50.075 Error: Tibbers: Call to function 'onHeartbeat' failed, exception details: 2023-01-05 19:35:50.077 Error: Tibbers: Traceback (most recent call last): 2023-01-05 19:35:50.077 Error: Tibbers: File "/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py", line 566, in onHeartbeat 2023-01-05 19:35:50.077 Error: Tibbers: _plugin.onHeartbeat() 2023-01-05 19:35:50.077 Error: Tibbers: File "/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py", line 329, in onHeartbeat 2023-01-05 19:35:50.077 Error: Tibbers: WriteDebug("onHeartbeat") 2023-01-05 19:35:50.077 Error: Tibbers: File "/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py", line 559, in WriteDebug 2023-01-05 19:35:50.077 Error: Tibbers: if Parameters["Mode6"] == "Yes": 2023-01-05 19:35:50.077 Error: Tibbers: KeyError: 'Mode6' 2023-01-05 19:35:53.784 Tibbers: Worker thread started. 2023-01-05 19:35:53.684 Status: Tibbers: Stop directive received. 2023-01-05 19:35:53.782 Status: Tibbers: Exiting work loop. 2023-01-05 19:35:53.784 Status: Tibbers: Stopping threads. 2023-01-05 19:35:53.784 Status: Tibbers: Stopped. 2023-01-05 19:35:53.784 Status: Tibbers: Entering work loop. 2023-01-05 19:35:53.785 Status: Tibbers: Started. 2023-01-05 19:35:53.684 Error: Tibbers: Call to function 'onStop' failed, exception details: 2023-01-05 19:35:53.685 Error: Tibbers: Traceback (most recent call last): 2023-01-05 19:35:53.685 Error: Tibbers: File "/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py", line 525, in onStop 2023-01-05 19:35:53.685 Error: Tibbers: _plugin.onStop() 2023-01-05 19:35:53.685 Error: Tibbers: File "/home/pi/domoticz/plugins/Tibber-Domoticz/plugin.py", line 108, in onStop 2023-01-05 19:35:53.685 Error: Tibbers: if _plugin.GetDataCurrent.Connected() or _plugin.GetDataCurrent.Connecting(): 2023-01-05 19:35:53.685 Error: Tibbers: AttributeError: 'BasePlugin' object has no attribute 'GetDataCurrent' 2023-01-05 19:35:54.858 Tibbers: Using Home ID = 1a0d1013-d588-497b-8141-00ec1191553f 2023-01-05 19:35:54.486 Status: Tibbers: Initialized version 1.22, author 'flopp999' 2023-01-05 19:35:55.489 Tibbers: No real time hardware is installed

JanvdW304 commented 1 year ago

I checked the python script for the 'No real time hardware is installed' message, which is generated by this piece of code: for each in Data["data"]["viewer"]["homes"]: if each["id"] == self.HomeID: self.RealTime = each["features"]["realTimeConsumptionEnabled"] if self.RealTime is False: Domoticz.Log("No real time hardware is installed") WriteDebug("No real time hardware is installed")`

When I do the 'Homes/price/Consumption request in the Developer explorer I recognize the ["data"]["viewer"]["homes"] XML structure in the response, with some underlying XML elements. When I add ["features"]["realTimeConsumptionEnabled"] to the request, I get the following response: "features": { "realTimeConsumptionEnabled": false }, With the demo token the realTimeConsumptionEnabled element returns true.

I think that this causes my problem. Due to the fact that I have a Tibber account, but the start contract date is at Feb 1st, realTimeConsumptionEnabled is still false. I assume that the plugin will install on Feb 1st without any problem.

JanvdW304 commented 1 year ago

Just tested with demo token and corresponding home id; that works