Controlling Toon [HACKED] from Domoticz
Moderator: leecollings
Re: Controlling Toon [HACKED] from Domoticz
Hi Walberg,
There are 2 ways to control Toon from domoticz;
- Through the setpoint (and subsequently the 1st LUA script I've posted.
- Through the selector switches (auto program & toon scenes).
When using the setpoint it's important to use the script I've posted. Take note that I've used several user variables that contain important information about the toon; IP, PORT, etc.
When you are implementing these scripts it's also important to test if your HTTP commands to the toon are working correctly by testing them in your own browser..
@EdwinK the wiki only tells you how to add a normal Toon, this topic explains how to add the "hacked" version..
There are 2 ways to control Toon from domoticz;
- Through the setpoint (and subsequently the 1st LUA script I've posted.
- Through the selector switches (auto program & toon scenes).
When using the setpoint it's important to use the script I've posted. Take note that I've used several user variables that contain important information about the toon; IP, PORT, etc.
When you are implementing these scripts it's also important to test if your HTTP commands to the toon are working correctly by testing them in your own browser..
@EdwinK the wiki only tells you how to add a normal Toon, this topic explains how to add the "hacked" version..
-
- Posts: 46
- Joined: Thursday 28 May 2015 18:41
- Target OS: NAS (Synology & others)
- Domoticz version: 3.5877
- Location: Diemen Netherlands
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
Strange, when ik use the selector switches, the toon changes for a few seconds but then goes back to its original position.
-
- Posts: 52
- Joined: Wednesday 04 October 2017 11:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
The first script seems not to be working for me, or I configured something wrong. I have no idea where I should enter a new setpoint for the temperature. Than again, I don't desire to enter a custom temperature.
I use the selector switches in combination with the 2nd script and all is working great. Getting the right temperatures, settings, etc.
I also tried to read the gas (and electricity) value from Toon into Domoticz from this post.
I use the selector switches in combination with the 2nd script and all is working great. Getting the right temperatures, settings, etc.
I also tried to read the gas (and electricity) value from Toon into Domoticz from this post.
But I don't really understand what to do here. I'm quite new to domoticz, but can anyone explain how I implement this? Do I need to make new dummies, and upload the php files to my PI? or can I run it as a script in Domoticz? I really don't knowDennisD wrote: ↑Wednesday 19 July 2017 20:59 Already figured out the gas usage, forgot to post it here
For the other values you want to pull from your toon, read this post (bit old, but files still function): https://www.domoticaforum.eu/viewtopic. ... oot#p77453 . I will attach all files to this post just to share!
For the gas_data_json file (modified electricity_data_json file):
Goto http://ip_toon/hdrv_zwave?action=getDevices.json and look for:. The most important bit is the dev_3.1 part because that can be different in other toons. Open gas_date_json.php and search for:Code: Select all
"dev_3.1":{"uuid":"eneco-001-018946:hdrv_zwave_68927F8D936", "name":"HAE_METER_v2_1", "internalAddress":"3.1", "type":"gas", "supportsCrc":"0", "CurrentGasFlow":"0.00", "CurrentGasQuantity":"3080.00", "location":"(null)"},
now change the dev_3.1 to the one you have in the mentioned url. Make sure you change the ip_toon to the ip your toon has and also make a gasmeter (add virtual sensor) and fill in the idx. If you upload to mindergas you could also add your gas meter value to the following line:Code: Select all
$gasUsage= $parsed_json['dev_3.1']['CurrentGasQuantity'];
Now domoticz will have the actual meter value and you can upload it to mindergas.Code: Select all
$gasUsage= $parsed_json['dev_3.1']['CurrentGasQuantity'] + yourmetervalue;
-
- Posts: 7
- Joined: Monday 26 January 2015 9:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
I'm stuck with this as well.
Also my output from http://ip_toon/hdrv_zwave?action=getDevices.json doesn't have a dev_3.1
It looks like this:
I'm assuming I need to put the gas_data_json.php file in the Domoticz scripts folder, but then what?
Also my output from http://ip_toon/hdrv_zwave?action=getDevices.json doesn't have a dev_3.1
It looks like this:
Code: Select all
{
"dev_settings_device":{"uuid":"neco-001-002844:hdrv_zwave_104623C69244", "name":"settings_device", "internalAddress":"settings_device", "type":"settings_device", "supportsCrc":"49", "location":"(null)"},
"dev_3":{"uuid":"eneco-001-002844:hdrv_zwave_73123C62C14", "name":"FGWP011", "internalAddress":"3", "type":"FGWP011", "supportsCrc":"0", "supportedCC":"72 86 70 85 8e 25 73 32 31 7a", "TargetStatus":"-1", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "IsConnected":"0", "HealthValue":"1", "location":"(null)"},
"dev_4":{"uuid":"eneco-001-002844:hdrv_zwave_70223C6497C", "name":"HAE_METER_v2", "internalAddress":"4", "type":"HAE_METER_v2", "supportsCrc":"1", "supportedCC":"22 3c 3d 3e 56 60 70 72 7a 86 8b 73", "IsConnected":"1", "HealthValue":"10", "location":"(null)"},
"dev_4.1":{"uuid":"eneco-001-002844:hdrv_zwave_7024873497D", "name":"HAE_METER_v2_1", "internalAddress":"4.1", "type":"gas", "supportsCrc":"0", "CurrentGasFlow":"0.00", "CurrentGasQuantity":"50690.00", "location":"(null)"},
"dev_4.2":{"uuid":"eneco-001-002844:hdrv_zwave_7025CFF497D", "name":"HAE_METER_v2_2", "internalAddress":"4.2", "type":"elec", "supportsCrc":"0", "CurrentElectricityFlow":"76.00", "CurrentElectricityQuantity":"2167368.00", "location":"(null)"},
"dev_4.3":{"uuid":"eneco-001-002844:hdrv_zwave_70258EC497D", "name":"HAE_METER_v2_3", "internalAddress":"4.3", "type":"elec_delivered_nt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"},
"dev_4.4":{"uuid":"eneco-001-002844:hdrv_zwave_7027CCD497D", "name":"HAE_METER_v2_4", "internalAddress":"4.4", "type":"elec_received_nt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"},
"dev_4.5":{"uuid":"eneco-001-002844:hdrv_zwave_702D7AB497D", "name":"HAE_METER_v2_5", "internalAddress":"4.5", "type":"elec_delivered_lt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"},
"dev_4.6":{"uuid":"eneco-001-002844:hdrv_zwave_7021EFB497D", "name":"HAE_METER_v2_6", "internalAddress":"4.6", "type":"elec_received_lt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"}
}
-
- Posts: 1
- Joined: Wednesday 04 October 2017 18:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
Did you try changing dev_3.1 to dev_4.1 in the gas_data_json.php script?
Change:
To:
Change:
Code: Select all
$gasUsage= $parsed_json['dev_3.1']['CurrentGasQuantity'];
Code: Select all
$gasUsage= $parsed_json['dev_4.1']['CurrentGasQuantity'];
-
- Posts: 51
- Joined: Friday 18 September 2015 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
FunFair wrote: ↑Wednesday 04 October 2017 11:37 The first script seems not to be working for me, or I configured something wrong. I have no idea where I should enter a new setpoint for the temperature. Than again, I don't desire to enter a custom temperature.
I use the selector switches in combination with the 2nd script and all is working great. Getting the right temperatures, settings, etc.
I also tried to read the gas (and electricity) value from Toon into Domoticz from this post.
But I don't really understand what to do here. I'm quite new to domoticz, but can anyone explain how I implement this? Do I need to make new dummies, and upload the php files to my PI? or can I run it as a script in Domoticz? I really don't knowDennisD wrote: ↑Wednesday 19 July 2017 20:59 Already figured out the gas usage, forgot to post it here
For the other values you want to pull from your toon, read this post (bit old, but files still function): https://www.domoticaforum.eu/viewtopic. ... oot#p77453 . I will attach all files to this post just to share!
For the gas_data_json file (modified electricity_data_json file):
Goto http://ip_toon/hdrv_zwave?action=getDevices.json and look for:. The most important bit is the dev_3.1 part because that can be different in other toons. Open gas_date_json.php and search for:Code: Select all
"dev_3.1":{"uuid":"eneco-001-018946:hdrv_zwave_68927F8D936", "name":"HAE_METER_v2_1", "internalAddress":"3.1", "type":"gas", "supportsCrc":"0", "CurrentGasFlow":"0.00", "CurrentGasQuantity":"3080.00", "location":"(null)"},
now change the dev_3.1 to the one you have in the mentioned url. Make sure you change the ip_toon to the ip your toon has and also make a gasmeter (add virtual sensor) and fill in the idx. If you upload to mindergas you could also add your gas meter value to the following line:Code: Select all
$gasUsage= $parsed_json['dev_3.1']['CurrentGasQuantity'];
Now domoticz will have the actual meter value and you can upload it to mindergas.Code: Select all
$gasUsage= $parsed_json['dev_3.1']['CurrentGasQuantity'] + yourmetervalue;
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.
Open the file gas_data_json.php and search for:
Code: Select all
$idx = 0;
Code: Select all
$file_string_gas = file_get_contents('http://ip_toon/hdrv_zwave?action=getDevices.json');
Code: Select all
$gasusage = curl_init("http://ip_toon/json.htm?type=command¶m=udevice&idx=$idx&nvalue=0&svalue=$gasUsage");
Code: Select all
*/1 * * * * /home/pi/domoticz/scripts/php/gas_data_json.php, save it on exit and the gas sensor should start updating.
-
- Posts: 1
- Joined: Thursday 05 October 2017 15:51
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
Thnx! Tonight Im gonna try all your steps. Been trying to read the gas usage values from json using LUA script but all I got were errors. Now i finally know where to put the PHP files
-
- Posts: 7
- Joined: Monday 26 January 2015 9:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
you mention:
$gasusage = curl_init("http://ip_toon/json.htm?type=command¶m=udevice&idx=$idx&nvalue=0&svalue=$gasUsage");
and replace ip_toon with the actual ip adress of you toon
Shouldn't this be the IP of Domoticz?
Anyway, it is working for me now and I have a readout of the gas usage and the gas meter reading.
Many thanks for your help Dennis!
$gasusage = curl_init("http://ip_toon/json.htm?type=command¶m=udevice&idx=$idx&nvalue=0&svalue=$gasUsage");
and replace ip_toon with the actual ip adress of you toon
Shouldn't this be the IP of Domoticz?
Anyway, it is working for me now and I have a readout of the gas usage and the gas meter reading.
Many thanks for your help Dennis!
-
- Posts: 51
- Joined: Friday 18 September 2015 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
Regarding the ip, you are correct, my mistake, should have been up of domoticz. Glad you got it working now!
-
- Posts: 11
- Joined: Monday 09 October 2017 10:20
- Target OS: Linux
- Domoticz version: 2021.1
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
Hi everybody, I've registered specially for this thread to be able to ask some questions.
So, I have a Toon, I've just rooted it and it's working ok now.
Now, I also have a Domoticz setup running on a Windows 7 VM that is also working quite nicely for me.
I used to have Toon connected to Domoticz through the 'official' way however because I am cutting Eneco loose I need to be able to control it in another way.
Here's the thing, I am by all means not an experienced Domoticz user so the tutorial in the OP of this thread gave me a headache and a lot of questions
Can somebody help me with a nooby tutorial, please?
If you want I am willing to write the step by step document myself if someone can provide me with the right info
So, I have a Toon, I've just rooted it and it's working ok now.
Now, I also have a Domoticz setup running on a Windows 7 VM that is also working quite nicely for me.
I used to have Toon connected to Domoticz through the 'official' way however because I am cutting Eneco loose I need to be able to control it in another way.
Here's the thing, I am by all means not an experienced Domoticz user so the tutorial in the OP of this thread gave me a headache and a lot of questions
Can somebody help me with a nooby tutorial, please?
If you want I am willing to write the step by step document myself if someone can provide me with the right info
-
- Posts: 46
- Joined: Thursday 28 May 2015 18:41
- Target OS: NAS (Synology & others)
- Domoticz version: 3.5877
- Location: Diemen Netherlands
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
Tried to change Toon Scenes from Domoticz Switches from Home to Away, but after about 1 minute the system is back to Home? So there is something wrong with the script but what?
-
- Posts: 46
- Joined: Thursday 28 May 2015 18:41
- Target OS: NAS (Synology & others)
- Domoticz version: 3.5877
- Location: Diemen Netherlands
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
And here the fourth file (log file) i could not post it in the last file).
Re: Controlling Toon [HACKED] from Domoticz
Walberg,
It looks like the command to change the scene never reached the Toon.
Every minute the script runs to synchronise the changes from Toon to domoticz, so when this script runs after 1 minute the scene selector is back to Home.
The best way to test this is to press the selector switch in Domoticz while you are standing in front of your Toon. Confirm that you see the scene change on your Toon. I'm guessing it doesn't!
So if I'm right the problem is in the scene selector. Did you include the right triggers to this selector? IS the IP Address of your Toon correct?
It looks like the command to change the scene never reached the Toon.
Every minute the script runs to synchronise the changes from Toon to domoticz, so when this script runs after 1 minute the scene selector is back to Home.
The best way to test this is to press the selector switch in Domoticz while you are standing in front of your Toon. Confirm that you see the scene change on your Toon. I'm guessing it doesn't!
So if I'm right the problem is in the scene selector. Did you include the right triggers to this selector? IS the IP Address of your Toon correct?
-
- Posts: 46
- Joined: Thursday 28 May 2015 18:41
- Target OS: NAS (Synology & others)
- Domoticz version: 3.5877
- Location: Diemen Netherlands
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
Yes your right, only Toon auto program is working (Switches when i am with ipad in front of Toon). But thermostat scenes and Program does not work.
Beneath my settings when edit Toon Scenes And here Toon Thermostat (there's little to edit)
Beneath my settings when edit Toon Scenes And here Toon Thermostat (there's little to edit)
Re: Controlling Toon [HACKED] from Domoticz
Yo,
Look at your screenshot and my screenshot
You are using @ instead of &
Look at your screenshot and my screenshot
You are using @ instead of &
-
- Posts: 46
- Joined: Thursday 28 May 2015 18:41
- Target OS: NAS (Synology & others)
- Domoticz version: 3.5877
- Location: Diemen Netherlands
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
aaahrgg, I have seen these rules with the original several times, also with the Toon Auto program, which of course was good. Always looking at my own mistake. The switches now work. Thanks. Only the thermostat setting ToonThermostaat still does not work.
Re: Controlling Toon [HACKED] from Domoticz
What's going on with ToonThermostaat?
Post screenshots / etc
Post screenshots / etc
-
- Posts: 46
- Joined: Thursday 28 May 2015 18:41
- Target OS: NAS (Synology & others)
- Domoticz version: 3.5877
- Location: Diemen Netherlands
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
When pushing flame you got the arrows up en down but setting temperature change only for a few seconds on the dummy but not the setpoint on the Toon (printscreen of my VNC) by example setting temperature at 22 after a few seconds return to 20 on the Domoticz screen but at the VNC screen (= Toon) nothing changed.
Re: Controlling Toon [HACKED] from Domoticz
So the script that's supposed to fire when you change the setpoint is not working.
Again the same problem as your Scene selector. This means the script that runs every minute is putting the setpoint in the domoticz back to what it is on the Toon. Can you show me the script that runs when you change the setpoint? (Should be called ToonSetPoint)
Again the same problem as your Scene selector. This means the script that runs every minute is putting the setpoint in the domoticz back to what it is on the Toon. Can you show me the script that runs when you change the setpoint? (Should be called ToonSetPoint)
-
- Posts: 46
- Joined: Thursday 28 May 2015 18:41
- Target OS: NAS (Synology & others)
- Domoticz version: 3.5877
- Location: Diemen Netherlands
- Contact:
Re: Controlling Toon [HACKED] from Domoticz
-- Script used for Toon Thermostaat utility device, upon changing temp in Domoticz, temperature is sent to Toon.
--
commandArray = {}
ToonThermostatSensorName = uservariables['UV_ToonThermostatSensorName'] -- Sensor showing current setpoint
ToonIP = uservariables['UV_ToonIP']
for deviceName,deviceValue in pairs(devicechanged) do
if (deviceName == ToonThermostatSensorName) then
if uservariables['UV_ToonChangedByDomoticz'] == 1 then
commandArray['Variable:UV_ToonChangedByDomoticz'] = '0'
else
SetPoint = otherdevices_svalues[ToonThermostatSensorName]
ToonCommand = string.format('http://%s/happ_thermstat?action=setSetpoint&Setpoint=%s', ToonIP, SetPoint*100)
print('Setting Toon setpoint to '.. SetPoint)
commandArray['OpenURL'] = ToonCommand
end
end
end
return commandArray
And here my dummy
--
commandArray = {}
ToonThermostatSensorName = uservariables['UV_ToonThermostatSensorName'] -- Sensor showing current setpoint
ToonIP = uservariables['UV_ToonIP']
for deviceName,deviceValue in pairs(devicechanged) do
if (deviceName == ToonThermostatSensorName) then
if uservariables['UV_ToonChangedByDomoticz'] == 1 then
commandArray['Variable:UV_ToonChangedByDomoticz'] = '0'
else
SetPoint = otherdevices_svalues[ToonThermostatSensorName]
ToonCommand = string.format('http://%s/happ_thermstat?action=setSetpoint&Setpoint=%s', ToonIP, SetPoint*100)
print('Setting Toon setpoint to '.. SetPoint)
commandArray['OpenURL'] = ToonCommand
end
end
end
return commandArray
And here my dummy
Who is online
Users browsing this forum: No registered users and 1 guest