If anyone is still interested in getting the current state directly from Toon I managed to alter the script that was placed on Github by
rvdm. RVDM has done some awesome work!
To make a few modifications I forked the script, results can be found
here.
How to get the current State from Toon into Domoticz
1. Create a uservariable in Domoticz
variable type: integer
variable value: can be any discrete number. Consider starting with 8. Toon state can only be 0 to 4, so if you install the script correct you should notice certain change.
2. Make sure you’ve got Python & Git installed on your rpi or synology
I run Domoticz on my Synology NAS and installed the pachages using
ipkg.
After installation it's easy, for instance:
3. Install the (python) Toon module
Code: Select all
git clone https://github.com/mphagenaars/toon.git
cd toon
python setup.py install
4. modify toon2domoticz.py
Inside the Toon folder you will find a script named
toon2domoticz.py. You can copy this script to a location of your choice. Mine is placed inside the
domoticz/var/scripts folder.
Make sure you can execute the script:
Or use a tool like WinSCP to set permissions.
You need to edit just two lines inside the script. Most easy way to edit would be to use WinSCP, but off course you can also use VI or any other editor of your choice
Code: Select all
domoticzserver = "your_ip_here:port"
uservariable = "name_of_uservar"
for instance
Code: Select all
domoticzserver = "192.168.1.50:8084"
uservariable = "varToonState"
5. execute the script
username & password are the same as you use to log on to
https://toonopafstand.eneco.nl
Code: Select all
toon2domoticz.py -U your_username_here -P your_password_here
If you installed everything correct the uservariable should now be changed to the current Toon state.
The uservar can change into 5 different Eneco Toon states:
RELAX (comfort) = 0,
ACTIVE (thuis) = 1
SLEEP (slapen) = 2
AWAY (weg) = 3
HOLIDAY (vakantie) = 4
I’ve scheduled the script to run every 5 minutes on my Synology NAS. You can do the same on your rpi using cron.
You can now use the current Toon state inside your Blockly or LUA scripts
I also added this information to the
wiki