Page 5 of 22

Re: Controlling Toon [HACKED] from Domoticz

Posted: Monday 09 October 2017 19:02
by walberg
There was an error on my events, was set on Time instead of device. Change that, now it works.
Schermafbeelding 2017-10-09 om 18.59.18.jpg
Schermafbeelding 2017-10-09 om 18.59.18.jpg (154.16 KiB) Viewed 4244 times

Re: Controlling Toon [HACKED] from Domoticz

Posted: Monday 09 October 2017 19:10
by Maes
Good to hear :)

Now that you finally got it working, you can replace these scripts with the DzVents version I made. I put it in the opening post :lol: :lol:

Re: Controlling Toon [HACKED] from Domoticz

Posted: Monday 09 October 2017 19:37
by walberg
Ai, after changing ToonSetPoint and ToonGetInfo Toonthermostat is again not functioning.

Re: Controlling Toon [HACKED] from Domoticz

Posted: Monday 09 October 2017 19:49
by Maes
give me details

Re: Controlling Toon [HACKED] from Domoticz

Posted: Monday 09 October 2017 20:04
by walberg
I just brought the temperature via ToonThermostat from 20 to 22 degrees and then set. I am now looking at my VNC screen (unfortunately, I can not make a print screen of my domoticz with an active wake up vnc screen) But with the replacement script, my Toon does not want to take over the temperature anymore. Even Domoticz restarts (then my synology will start again) but that did not help.

Re: Controlling Toon [HACKED] from Domoticz

Posted: Monday 09 October 2017 20:06
by Maes
Ai.. just revert back to the old lua script, it works fine

Re: Controlling Toon [HACKED] from Domoticz

Posted: Monday 09 October 2017 20:21
by walberg
I already dit dat (for the moment).

Re: Controlling Toon [HACKED] from Domoticz

Posted: Monday 09 October 2017 20:29
by Maes
Just to make sure: You are using DzVents 2.3.0 ?
And when you created the new script did you select Type = "DzVents" ? And was it set to active?

Re: Controlling Toon [HACKED] from Domoticz

Posted: Tuesday 10 October 2017 13:53
by walberg
No, i don't know if there is a DZVent package for the Synology (where my Domoticz is installed).

Re: Controlling Toon [HACKED] from Domoticz

Posted: Tuesday 10 October 2017 15:03
by jovabe
Is there anyone out there who could help me out in a more simple way, since I am not a programmer, nor a hacker and I can't figure it out. May be there is someone out there near Leiden who is willing to do it for me for some small donation (pizza, beer, money).

Thanks for now.

Joost

Re: Controlling Toon [HACKED] from Domoticz

Posted: Tuesday 10 October 2017 17:45
by ronalddehaan
jovabe wrote:Is there anyone out there who could help me out in a more simple way, since I am not a programmer, nor a hacker and I can't figure it out. May be there is someone out there near Leiden who is willing to do it for me for some small donation (pizza, beer, money).

Thanks for now.

Joost
I've asked the same thing. Still waiting for reply. But hey, I'm not pushing :)

Verstuurd vanaf mijn SM-G903F met Tapatalk


Re: Controlling Toon [HACKED] from Domoticz

Posted: Tuesday 17 October 2017 16:23
by FunFair
DennisD wrote: Thursday 05 October 2017 8:20 I will try and explain howto make the gas sensor:
What i did was make a dummy switch in Domoticz/hardware and named it ToonHacked, just to keep things organized.After this is created click on make virtual sensor and then fill in a name that you want, in my case i did gas verbruik and in the pull down menu select gas. After this is created goto your devices (settings drop down menu) and search for "gas verbuik" or whatever name you called the virtual gas sensor, and look for the idx and remember/write it down.
I've copied these files to /home/pi/domoticz/scripts/p1_meter/ and made sure they are executable with chmod +x

Code: Select all

Electricity_data_json.php 
gas_data_json.php 
OT_data_json.php
I've added 1 virtual gasmeter (idx 24) and virtual electricity meter (idx 25)
Then I changed the Toon_IP, the Domoticz_IP and entered the 2 idx values where it should.

I've also set up crontab as followes (with crontab -e, not with sudo) so it should execute every minute.

Code: Select all

*/1 * * * * /home/pi/domoticz/scripts/p1_meter/gas_data_json.php
*/1 * * * * /home/pi/domoticz/scripts/p1_meter/Electricity_data_json.php
*/1 * * * * /home/pi/domoticz/scripts/p1_meter/OT_data_json.php
When I enter information manually to the meters it works.

Code: Select all

http://192.168.0.200:8080/json.htm?type=command&param=udevice&idx=24&nvalue=0&svalue=1061431
http://192.168.0.200:8080/json.htm?type=command&param=udevice&idx=25&nvalue=0&svalue=2205
This updates my gasmeter idx24 and electricitymeter idx25 to the entered svalue that I manually retreived from

Code: Select all

http://192.168.0.11/hdrv_zwave?action=getDevices.json
http://192.168.0.11/happ_pwrusage?action=GetCurrentUsage
But the php script doesn't seem to run?
What am I doing wrong? :o

-edit-
nvm.. I didn't have curl installed. Fixed it by executing "sudo apt-get install php-curl"

Next to that I made my own version of the electricity script, because I wanted to see the total (kwh) used and the current usage (watt)
I've added Add a virtual sensor "Electric (Instant+Counter)"

And than I made this code. I am not a coder so I probably don't code according to the rules lol.

Code: Select all

code obsolete, see new code below

Re: Controlling Toon [HACKED] from Domoticz

Posted: Tuesday 17 October 2017 22:10
by FunFair
Is it possible to update the information from "GetToonInfo" quicker than 1 minute?
When I switch the setting from home to away 1 minute is quite a long time for an update.

Isn't it possible to have the script trigger when the button has been pressed? That way it'll update instantly right?

Re: Controlling Toon [HACKED] from Domoticz

Posted: Wednesday 18 October 2017 9:23
by ronalddehaan
Is it possible to add all the proper steps and information about how to set up a Rooted Toon in Domoticz to a Wiki?
That way all outdated or wrong info is not finding its way into someone's setup and all the steps are in the proper sequence.

Re: Controlling Toon [HACKED] from Domoticz

Posted: Thursday 19 October 2017 21:42
by FunFair
My meter adapter went down for some reason and Toon started reporting bad values to Domoticz. So my database values were all messed up.
The power meter reported only the nighttime value and the gas value was in the millions.
So I altered the php script to make them more robust. I alsmo made it a bit easier for new users aswell.
It's probably not perfect. php files are attached to this post. and also shown in the code. If anyone has improvements, please share :)

note: the gas values with a smart meter will only update once every hour. The previous script would rewrite the same value every minute. This script will skip this, because it will only write a new value if it's different from the excisting one.
note2: before setting up the crontab. Run the files with ./electricity_data_json.php and ./gas_data_json.php from the commandline. If it doesn't work. Enable the echo's by removing the # signs to see a bit better what's happening.
note3: This code is written and tested by me for an hacked Toon firmware 4.7. The original script was written for firmware 3.x so I would think it will still work.

-update 23/10/17-
Created a P1_Meter script and Solar return power script.
Updated some things. See post later in this topic.

Re: Controlling Toon [HACKED] from Domoticz

Posted: Thursday 19 October 2017 23:28
by DennisD
Nice, good job!

Re: Controlling Toon [HACKED] from Domoticz

Posted: Thursday 19 October 2017 23:33
by Timeless
Currently this topic is mainly focused on controlling Toon from Domoticz (yeah yeah... I know it's in the forum title), but maybe there are also people that want to control Domoticz from Toon. And therefor "TerrorSoure" made a nice application: DomoticzBoard

It takes some time to setup but in the end I think it is pretty neat :)
Also if you need authorization see my post here

Re: Controlling Toon [HACKED] from Domoticz

Posted: Friday 20 October 2017 9:08
by Maes
Looks like a cool project, but unfortunately its not possible (afaik) to install apps on a rooted toon :(

Re: Controlling Toon [HACKED] from Domoticz

Posted: Friday 20 October 2017 9:10
by ronalddehaan
Maes wrote: Friday 20 October 2017 9:08 Looks like a cool project, but unfortunately its not possible (afaik) to install apps on a rooted toon :(
There is even an appstore available :lol:

https://www.domoticaforum.eu/viewtopic.php?f=87&t=11756

Re: Controlling Toon [HACKED] from Domoticz

Posted: Friday 20 October 2017 9:13
by Maes
Ahh.. I didn't know. Unfortunately it looks like I have to flash my Toon again. Which I can't do, Marcelr did it for me last time ;)