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, TerrorSource, Toonz

The Neo Coolcam Powerplugs in Toon also in Domoticz

Postby witteherder » Fri Mar 01, 2019 4:14 pm

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.9.6
Raspberry Pi 3B+
Domoticz V4.10717
7 Neo Coolcam PowerPlus
Domotica Beginner (need little help in beginning)
witteherder
Starting Member
Starting Member
 
Posts: 23
Joined: January 2019

Re: The Neo Coolcam Powerplugs in Toon also in Domoticz

Postby mAiden » Fri Mar 01, 2019 4:24 pm

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.
mAiden
Member
Member
 
Posts: 263
Joined: July 2017

Re: The Neo Coolcam Powerplugs in Toon also in Domoticz

Postby witteherder » Fri Mar 01, 2019 6:02 pm

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.9.6
Raspberry Pi 3B+
Domoticz V4.10717
7 Neo Coolcam PowerPlus
Domotica Beginner (need little help in beginning)
witteherder
Starting Member
Starting Member
 
Posts: 23
Joined: January 2019

Re: The Neo Coolcam Powerplugs in Toon also in Domoticz

Postby mAiden » Fri Mar 01, 2019 6:11 pm

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. :)
mAiden
Member
Member
 
Posts: 263
Joined: July 2017

Re: The Neo Coolcam Powerplugs in Toon also in Domoticz

Postby witteherder » Sat Jul 27, 2019 11:30 am

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.9.6
Raspberry Pi 3B+
Domoticz V4.10717
7 Neo Coolcam PowerPlus
Domotica Beginner (need little help in beginning)
witteherder
Starting Member
Starting Member
 
Posts: 23
Joined: January 2019


Return to Toon issues and support (Nederlands toegestaan)

Who is online

Users browsing this forum: No registered users and 1 guest