Error ToonThermostat

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

waspy
Posts: 52
Joined: Friday 22 February 2019 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10430
Contact:

Re: Error ToonThermostat

Post by waspy »

Looks like the toonapilib is not found in one of the stated Python paths.
As far as I can remember, the pip3 installation call puts the library in /usr/local/lib/python3.5/dist-packages/toonapilib.
If you can find it there, you can create a symlink in /usr/lib/python3.5 or copy the toonapilib folder into /usr/lib/python3.5/.

I installed toonapilib on a real pi3 and a virtual machine on which I did most of the testing.
On the latter on I can't remember that I needed to create symlinks.
Not sure for the real Pi3 though.
And I'm running different versions of domoticz on the Pi and VM. Maybe the latest version also looks in ../dist-packages for python libraries.
stephanvdplas
Posts: 73
Joined: Wednesday 13 February 2019 18:09
Target OS: Windows
Domoticz version: 2023.1
Location: Netherlands
Contact:

Re: Error ToonThermostat

Post by stephanvdplas »

Hmm, I'm not able to get it running (Windows OS):

Code: Select all

Error: PluginList: Parsing 'C:\Program Files (x86)\Domoticz\plugins\toonapilib\', 'Error document empty.' at line 0 column 0 in XML ''
I placed the contents of /toonapilib in the plugins folder and renamed toonapilib.py to plugin.py, but am afraid I'm missing a step/

The Python runtime is starting:

Code: Select all

Status: PluginSystem: Started, Python version '3.7.2'.
Status: Python EventSystem: Initalizing event module.
What does this errpr document empty at line 0 column 0 in XML mean?
- Running LMS, Domoticz and Dashticz on a windows 11 laptop.
- LMS (11 players) / Hue (26 lights, 2 switches) / Z-wave (14 devices) / Toon (unrooted) / Chromecast
waspy
Posts: 52
Joined: Friday 22 February 2019 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10430
Contact:

Re: Error ToonThermostat

Post by waspy »

Hello,

There is no renaming involved. Install toonapilib first. Then download the plugin.py from gitlab.

In the plugins folder of domoticz you create a new subfolder. Does not matter how you call it.

Then copy the downloaded plugin.py into that subfolder andere restart domoticz.



Verstuurd vanaf mijn SM-G935F met Tapatalk

Ritchie
Posts: 12
Joined: Wednesday 13 February 2019 15:07
Target OS: -
Domoticz version:
Contact:

Re: Error ToonThermostat

Post by Ritchie »

I dont know what happened, but exactly 1 hour after starting with the API, I dont receive any data anymore, and my Toon App is also showing no updates anymore.
stephanvdplas
Posts: 73
Joined: Wednesday 13 February 2019 18:09
Target OS: Windows
Domoticz version: 2023.1
Location: Netherlands
Contact:

Re: Error ToonThermostat

Post by stephanvdplas »

waspy wrote: Friday 22 February 2019 15:45 Hello,
There is no renaming involved. Install toonapilib first. Then download the plugin.py from gitlab.
In the plugins folder of domoticz you create a new subfolder. Does not matter how you call it.
Then copy the downloaded plugin.py into that subfolder andere restart domoticz.
I created a subfolder (toonapilib) in the plugins folder. But I really don't know what is meant with "Install toonapilib" and where I can download a plugin.py if it is not the toonapilib.py renamed. Sorry for being noob on this part of Domoticz.
- Running LMS, Domoticz and Dashticz on a windows 11 laptop.
- LMS (11 players) / Hue (26 lights, 2 switches) / Z-wave (14 devices) / Toon (unrooted) / Chromecast
waspy
Posts: 52
Joined: Friday 22 February 2019 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10430
Contact:

Re: Error ToonThermostat

Post by waspy »

Please read the install guide on the github page of my project.


Verstuurd vanaf mijn SM-G935F met Tapatalk

astrapowerrr
Posts: 141
Joined: Tuesday 31 January 2017 20:34
Target OS: -
Domoticz version:
Contact:

Re: Error ToonThermostat

Post by astrapowerrr »

waspy wrote:Please read the install guide on the github page of my project.


Verstuurd vanaf mijn SM-G935F met Tapatalk
Hi wasby

I’m a little noob to on this. And I also read the install guide. To be honest, when you have never ever used python or something.
Or have to google what python is. Then it is a real struggle to understand what all of this means.

So I am trying to learn as we speak. But it’s a lot of abracadabra for me.

So I will be waiting when a noob user guide is in the wiki... and follow a step by step instruction.

Greets Marco.


Verzonden vanaf mijn iPhone met Tapatalk
stephanvdplas
Posts: 73
Joined: Wednesday 13 February 2019 18:09
Target OS: Windows
Domoticz version: 2023.1
Location: Netherlands
Contact:

Re: Error ToonThermostat

Post by stephanvdplas »

waspy wrote: Friday 22 February 2019 16:34 Please read the install guide on the github page of my project.
Where can I find it? When I search Github I only see: https://github.com/wasp/waspy where there is no info about installing a python plugin or downloading a plugin.py to domoticz on Windows...
- Running LMS, Domoticz and Dashticz on a windows 11 laptop.
- LMS (11 players) / Hue (26 lights, 2 switches) / Z-wave (14 devices) / Toon (unrooted) / Chromecast
waspy
Posts: 52
Joined: Friday 22 February 2019 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10430
Contact:

Re: Error ToonThermostat

Post by waspy »

Snowtiger
Posts: 120
Joined: Tuesday 18 October 2016 13:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10915
Contact:

Error ToonThermostat

Post by Snowtiger »

You should look in this project file of Github for installatiemonteur informatie :
https://github.com/JohnvandeVrugt/toona ... INSTALL.md
Waspy beat me :D
waspy
Posts: 52
Joined: Friday 22 February 2019 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10430
Contact:

Re: Error ToonThermostat

Post by waspy »

Yeah, cause waspy was already taken; had to create a github account under my real name :D
tne7laa
Posts: 30
Joined: Sunday 05 March 2017 10:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Error ToonThermostat

Post by tne7laa »

tne7laa wrote: Friday 22 February 2019 12:45

Code: Select all

2019-02-22 12:30:08.944 Status: (Toon API) Started.
2019-02-22 12:30:09.106 Error: (ToonApiLib) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/toonapilib4domoticz/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2019-02-22 12:30:09.106 Error: (Toon API) Module Import failed, exception: 'ImportError'
2019-02-22 12:30:09.106 Error: (Toon API) Module Import failed: ' Name: toonapilib'
2019-02-22 12:30:09.106 Error: (Toon API) Error Line details not available.
2019-02-22 12:31:30.616 Error: Toon API hardware (13) thread seems to have ended unexpectedly
I tried everything now today. Copying files between "/usr/lib/python3.5" and "~/domoticz/plugins/toonapilib4domoticz", etc.
Also installing en removing toonapilib with different versions (3.0.2 and latest)
But still get the error message above and don't know what's wrong. :roll:
waspy
Posts: 52
Joined: Friday 22 February 2019 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10430
Contact:

Re: Error ToonThermostat

Post by waspy »

stephanvdplas wrote: Friday 22 February 2019 15:23 Hmm, I'm not able to get it running (Windows OS):

Code: Select all

Error: PluginList: Parsing 'C:\Program Files (x86)\Domoticz\plugins\toonapilib\', 'Error document empty.' at line 0 column 0 in XML ''
I placed the contents of /toonapilib in the plugins folder and renamed toonapilib.py to plugin.py, but am afraid I'm missing a step/

The Python runtime is starting:

Code: Select all

Status: PluginSystem: Started, Python version '3.7.2'.
Status: Python EventSystem: Initalizing event module.
What does this errpr document empty at line 0 column 0 in XML mean?
Hello Stephan,

I did not test my plugin on windows yet, but as it is written in python it should be O/S indepedent.
To help you I installed the latest domoticz beta version om my windows 10 laptop.

Then I installed the latest !!! 32 bit!!! python 3.x version. (https://www.python.org/ftp/python/3.7.2 ... -3.7.2.exe)
There is a remark here https://www.domoticz.com/wiki/Using_Python_plugins to install the 32 bit version even on 64 bit platforms.
During installation you should check 'Add pythonX to path' option.

You should have pip installed along with the python installation as well.
We use pip to install the toonlibapi: open a windows command prompt (I ran it with admin rights) and enter: pip install toonapilib==3.0.2.
Maybe for the newer versions of python one can use the latest toonapilib, but I did not try it.

Anyway, at this point I have installed domoticz, python 3.7 + pip support and installed toonapilib using pip.
Now it's time to add my plugin script to domoticz.

Go to the install location of domoticz: i.e. c:\program files(x86)\domoticz.
Create a subfolder named 'plugins' if it does not exist yet.
Within that folder create another folder i.e. toonapilib.
Now copy the plugin.py file that you can obtain from https://github.com/JohnvandeVrugt/toonapilib4domoticz

(Re)Start domoticz and the plugin should be selectable from the pulldown list in the hardware section.
Enter your credentials and api keys and off you go!

Good luck!

Edit: meanwhile I have added installation instructions for windows targets to my repository: https://github.com/JohnvandeVrugt/toona ... ALL_WIN.md
Last edited by waspy on Friday 22 February 2019 20:06, edited 1 time in total.
robdank1986
Posts: 5
Joined: Thursday 28 September 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Error ToonThermostat

Post by robdank1986 »

Same error results for me in the log, i can see the hardware and add the hardware to domoticz. What did you fill in at the developerspage of TOON? Ik got the consumer key en secret by creating an app, not sure what to enter at the URL part? just filled in test??

2019-02-22 12:30:08.944 Status: (Toon API) Started.
2019-02-22 12:30:09.106 Error: (ToonApiLib) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/toonapilib4domoticz/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2019-02-22 12:30:09.106 Error: (Toon API) Module Import failed, exception: 'ImportError'
2019-02-22 12:30:09.106 Error: (Toon API) Module Import failed: ' Name: toonapilib'
2019-02-22 12:30:09.106 Error: (Toon API) Error Line details not available.
2019-02-22 12:31:30.616 Error: Toon API hardware (13) thread seems to have ended unexpectedly

Also not sure i did the first part right, about the pip installation, i ran the command but got error back from pi, do i need to download a specific file and put it in a specific folder first?

I know, bad english en pretty big NOOB here. Hope someone can create a bit more detailed explanation or pont me in the right direction :-)

Thanks in advance!
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: Error ToonThermostat

Post by dressie »

Okay, I got it to work with Windows10. I quickly installed Domoticz on my notebook, and was happy to see that it created devices!
Now it's time to figure out why Phyton is acting up on both my Pi's. One is running stable, the other one the latest beta version of Domoticz.
Did anybody else get any further?
Let''s try to get this to work or share what worked for you!
waspy
Posts: 52
Joined: Friday 22 February 2019 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10430
Contact:

Re: Error ToonThermostat

Post by waspy »

I'm trying to figure out what is going on when the toonapilib is not found in domoticz.

So I deinstalled the toonapilib on my test VM running raspbian and restarted domoticz.
The log file show the error that it cannot find the toonapilib.

Code: Select all

2019-02-16 23:17:14.651 Error: (ToonApiLib) failed to load 'plugin.py', Python Path used was '/home/pi/dev-domoticz/plugins/toonapilib4domoticz/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-i386-linux-gnu:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2019-02-16 23:17:14.651 Error: (TestApilib) Module Import failed, exception: 'ImportError'
2019-02-16 23:17:14.651 Error: (TestApilib) Module Import failed: ' Name: toonapilib'
2019-02-16 23:17:14.651 Error: (TestApilib) Error Line details not available.

Then I installed toonapilib without sudo, thus with plain pi user rights.
Restarting domoticz service (sudo domoticz restart) yields the same error:

Code: Select all

2019-02-16 23:27:24.267 Error: (ToonApiLib) failed to load 'plugin.py', Python Path used was '/home/pi/dev-domoticz/plugins/toonapilib4domoticz/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-i386-linux-gnu:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2019-02-16 23:27:24.267 Error: (TestApilib) Module Import failed, exception: 'ImportError'
2019-02-16 23:27:24.267 Error: (TestApilib) Module Import failed: ' Name: toonapilib'
2019-02-16 23:27:24.267 Error: (TestApilib) Error Line details not available.

I uninstalled toonapilib (pip3 uninstall toonapilib). Notethat files were located in /home/pi/.local/lib/python3.5/site-packages/toonapilib/.
Now I installed toonapilib with admin rights: sudo pip3 install toonapilib

Code: Select all

2019-02-16 23:30:56.325 Error: (ToonApiLib) failed to load 'plugin.py', Python Path used was '/home/pi/dev-domoticz/plugins/toonapilib4domoticz/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-i386-linux-gnu:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2019-02-16 23:30:56.325 Error: (TestApilib) Module Import failed, exception: 'SyntaxError'
2019-02-16 23:30:56.325 Error: (TestApilib) Import detail: File: /usr/local/lib/python3.5/dist-packages/toonapilib/helpers.py, Line: 26, offset: 17
2019-02-16 23:30:56.325 Error: (TestApilib) Error Line ' access_token: str
2019-02-16 23:30:56.325 ' 
This error shows when you do not use version 3.0.2 but 3.0.4 of toonapilib.
I suspect a compatibility issue with Python 3.5 that is installed on my environment.

But NOW, I install toonapilib once more, but force the 3.0.2 version: sudo pip3 install toonapilib==3.0.2.
Toonapilib is located in /usr/local/lib/python3.5/dist-packages/toonapilib

Code: Select all

2019-02-16 23:42:56.588 (TestApilib) Creating Toon devices
No more errors... :o
This result was obtained while using Domoticz development version 4.1043.0.


I will check my Pi as well. But keep in mind: use sudo pip3 install toonapilib to install the python library!

Update #1:
Just checked my Pi. I have created a symlink from the installed toonapilib to /usr/lib/python3.5/toonapilib:
sudo ln -s /usr/local/lib/python3.5/dist-packages/toonapilib /usr/lib/python3.5/toonapilib
If I remove the link, domoticz fails to import the plugin. After recreating the symlink, all is well.
robdank1986
Posts: 5
Joined: Thursday 28 September 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Error ToonThermostat

Post by robdank1986 »

waspy wrote: Friday 22 February 2019 21:51 I'm trying to figure out what is going on when the toonapilib is not found in domoticz.

So I deinstalled the toonapilib on my test VM running raspbian and restarted domoticz.
The log file show the error that it cannot find the toonapilib.

Code: Select all

2019-02-16 23:17:14.651 Error: (ToonApiLib) failed to load 'plugin.py', Python Path used was '/home/pi/dev-domoticz/plugins/toonapilib4domoticz/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-i386-linux-gnu:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2019-02-16 23:17:14.651 Error: (TestApilib) Module Import failed, exception: 'ImportError'
2019-02-16 23:17:14.651 Error: (TestApilib) Module Import failed: ' Name: toonapilib'
2019-02-16 23:17:14.651 Error: (TestApilib) Error Line details not available.

Then I installed toonapilib without sudo, thus with plain pi user rights.
Restarting domoticz service (sudo domoticz restart) yields the same error:

Code: Select all

2019-02-16 23:27:24.267 Error: (ToonApiLib) failed to load 'plugin.py', Python Path used was '/home/pi/dev-domoticz/plugins/toonapilib4domoticz/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-i386-linux-gnu:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2019-02-16 23:27:24.267 Error: (TestApilib) Module Import failed, exception: 'ImportError'
2019-02-16 23:27:24.267 Error: (TestApilib) Module Import failed: ' Name: toonapilib'
2019-02-16 23:27:24.267 Error: (TestApilib) Error Line details not available.

I uninstalled toonapilib (pip3 uninstall toonapilib). Notethat files were located in /home/pi/.local/lib/python3.5/site-packages/toonapilib/.
Now I installed toonapilib with admin rights: sudo pip3 install toonapilib

Code: Select all

2019-02-16 23:30:56.325 Error: (ToonApiLib) failed to load 'plugin.py', Python Path used was '/home/pi/dev-domoticz/plugins/toonapilib4domoticz/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-i386-linux-gnu:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
2019-02-16 23:30:56.325 Error: (TestApilib) Module Import failed, exception: 'SyntaxError'
2019-02-16 23:30:56.325 Error: (TestApilib) Import detail: File: /usr/local/lib/python3.5/dist-packages/toonapilib/helpers.py, Line: 26, offset: 17
2019-02-16 23:30:56.325 Error: (TestApilib) Error Line ' access_token: str
2019-02-16 23:30:56.325 ' 
This error shows when you do not use version 3.0.2 but 3.0.4 of toonapilib.
I suspect a compatibility issue with Python 3.5 that is installed on my environment.

But NOW, I install toonapilib once more, but force the 3.0.2 version: sudo pip3 install toonapilib==3.0.2.
Toonapilib is located in /usr/local/lib/python3.5/dist-packages/toonapilib

Code: Select all

2019-02-16 23:42:56.588 (TestApilib) Creating Toon devices
No more errors... :o
This result was obtained while using Domoticz development version 4.1043.0.


I will check my Pi as well. But keep in mind: use sudo pip3 install toonapilib to install the python library!

Update #1:
Just checked my Pi. I have created a symlink from the installed toonapilib to /usr/lib/python3.5/toonapilib:
sudo ln -s /usr/local/lib/python3.5/dist-packages/toonapilib /usr/lib/python3.5/toonapilib
If I remove the link, domoticz fails to import the plugin. After recreating the symlink, all is well.
To everybody,

Holy s**t updating to the latest beta version of domoticz did the trick!
waspy
Posts: 52
Joined: Friday 22 February 2019 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10430
Contact:

Re: Error ToonThermostat

Post by waspy »

Yep, I already supspected that upgrading to the latest beta would to the trick.
Meanwhile i was searching the domoticz repository to find the commit.

Anyway, I can also confirm that upgrading to the latest beta fixes the path issue.
You can update to the latest beta by issueing /home/pi/dev-domoticz/updatebeta.
Don't forget to backup first! ;)

If you do not want to update, you can always add the symbolic link as I explained in my previous post.
robdank1986
Posts: 5
Joined: Thursday 28 September 2017 14:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Error ToonThermostat

Post by robdank1986 »

waspy wrote: Friday 22 February 2019 22:47 Yep, I already supspected that upgrading to the latest beta would to the trick.
Meanwhile i was searching the domoticz repository to find the commit.

Anyway, I can also confirm that upgrading to the latest beta fixes the path issue.
You can update to the latest beta by issueing /home/pi/dev-domoticz/updatebeta.
Don't forget to backup first! ;)

If you do not want to update, you can always add the symbolic link as I explained in my previous post.
I added the devices to my setup, but the commands do not work, i recieve data for gas and energy but when i select a program is does not work and the selector state does not change. Same for setpoint. Is this working for you? First read of state/temperature is ok, also keeps updatet
waspy
Posts: 52
Joined: Friday 22 February 2019 0:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10430
Contact:

Re: Error ToonThermostat

Post by waspy »

I did not implement the commands to change the states yet. It's on my imaginary to-do list.
Too busy helping others I guess ;) But I think this is not too hard, so I will try to fix it asap.

Regarding the set point. When I change the temperature using the Toon app, I can change the thermostat setpoint from domoticz as well.
It's something that is controlled by the toonapilib. My plugin just calls the toonapilib api. So if that fails, we need to address the maintainer of toonapilib. I have not had the time yet to figure out when it works and when it doesn't.

I created this plugin because I like the integration of Toon in Domoticz.
I do not control any zwave devices by means of the Toon device. Nor do I have any smoke alarms.
But in the near future I will do my best to integrate these devices into my plugin.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest