The Neo Coolcam Powerplugs in Toon also in Domoticz

If your (rooted) Toon doesn't do what it's supposed to, post here. Dutch allowed / Posten in 't Nederlands toegestaan.

Moderators: marcelr, TheHogNL, Toonz

Post Reply
witteherder
Starting Member
Starting Member
Posts: 25
Joined: Thu Jan 10, 2019 2:28 pm

The Neo Coolcam Powerplugs in Toon also in Domoticz

Post by witteherder »

Hi

I dont know if I m in the right menu/ topc for this but:

I did followed the manual "Slimme stekkers Toon in samenwerking Domoticz made my mAiden
Very nice and its working

But how can I put this powerplugs also as a energy monitoring in Domoticz itself while its configured/ connected with Toon 2 (geroot)

Is there also a manual for that somewhere because I could not find it (yet)
Toon 2 Rooted User
Firmware version: 5.94.7
Raspberry Pi 3B+
Domoticz 2022.1
10 Neo Coolcam PowerPlus
Domotica Beginner (need little help in beginning)
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: The Neo Coolcam Powerplugs in Toon also in Domoticz

Post by mAiden »

Will tonight look how I have tuned, I get namely the consumption of the plugs also in Domoticz.
I think that I have run a crontab with a php script for this.
Member of the Toon Software Collective
witteherder
Starting Member
Starting Member
Posts: 25
Joined: Thu Jan 10, 2019 2:28 pm

Re: The Neo Coolcam Powerplugs in Toon also in Domoticz

Post by witteherder »

Would be very gratefull with a manual
I m just a beginner..
But your other manual was great anyway
Toon 2 Rooted User
Firmware version: 5.94.7
Raspberry Pi 3B+
Domoticz 2022.1
10 Neo Coolcam PowerPlus
Domotica Beginner (need little help in beginning)
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: The Neo Coolcam Powerplugs in Toon also in Domoticz

Post by mAiden »

First thanks Irelandfan for making this script, I have only adjusted it so that the consumption of my plug can be read in Domoticz.

Code: Select all

#!/usr/bin/php
<?php
	error_reporting(E_ALL);
/* Written by Ierlandfan */
/* 1-11-2015 */
/* Version 1.1 */
/* Edit by mAiden  */
/* 01-03-2019     */

/* Change ip_toon to the IP of your Toon */ 
	/* start of current Energy usage import */
	$file_string_electricity = file_get_contents('http://XXX.XXX.XXX.XXX/hdrv_zwave?action=getDevices.json');
	$parsed_json = json_decode($file_string_electricity, true);
#var_dump($parsed_json);

/* Create new virtual sensor and write down the idx value */
/* Define idxvalue here */
$ElecUsage=$parsed_json['dev_XX']['CurrentElectricityFlow'];
$ElecUsage1 = str_replace('.00', '', number_format($ElecUsage, 2, '.', ','));
$idx = XXX;
/* If this script is not run locally on the Domoticz server change 127.0.0.1 according to your Domoticz IP */
/* Send currentUsage to Domoticz */
$electricityusage = curl_init("http://XX.XX.XX.XX.XX:XXXX/json.htm?type=command&param=udevice&idx=$idx&svalue=$ElecUsage1");
curl_exec($electricityusage);
?>
1. Enter the IP address of Toon

2. Search for the correct dev number, you can find them by http://toonip/hdrv_zwave?action=getDevices.json

3. Create a Dummy in Domoticz

4. Enter IDX number of you Dummy

5. Enter IP and port of Domoticz

6. Create a crontab on a linux machine.. I do not know if this can also be done on Toon, I use a raspberry Pi for it.

Code: Select all

*/1 * * * * php /path/to/script/scriptname.php >/dev/null 2>&1
This crontab will be run every min. :)
Member of the Toon Software Collective
witteherder
Starting Member
Starting Member
Posts: 25
Joined: Thu Jan 10, 2019 2:28 pm

Re: The Neo Coolcam Powerplugs in Toon also in Domoticz

Post by witteherder »

Mr Aiden
6. Create a crontab on a linux machine.. I do not know if this can also be done on Toon, I use a raspberry Pi for it.
I have a Rasbian Raspberry Pi 3 B+

So I put in the command of LX terminal follow command?
*/1 * * * * php /path/to/script/scriptname.php >/dev/null 2>&1
And this should be also the toon ip right?
$electricityusage = curl_init("http://XX.XX.XX.XX.XX:XXXX/json.htm?type=command&param=udevice&idx=$idx&svalue=$ElecUsage1");
curl_exec($electricityusage);
After creat the Dummy I make a sensor and there I will put the IDX NR etc right or I have to do it different?
Or I make a Duummy with what Type ????

Sorry to ask but I m not so good in it yet
Toon 2 Rooted User
Firmware version: 5.94.7
Raspberry Pi 3B+
Domoticz 2022.1
10 Neo Coolcam PowerPlus
Domotica Beginner (need little help in beginning)
Post Reply

Return to “Toon issues and support (Nederlands toegestaan)”