Re: Controlling Toon [HACKED] from Domoticz
Posted: Friday 20 October 2017 9:19
Open source Home Automation System
https://forum.domoticz.com/
Ah I see, yeah you are probably rightMaes wrote: ↑Friday 20 October 2017 9:23 Because of the app store. Marcelr rooted my toon on 4th of april 2016. A lot has changed since then and the "software" that's loaded on my Toon does not support automatic updates.
So, if I want to use any of this new stuff, the Toon will have to be flashed again to the newest version.
Code: Select all
#!/usr/bin/php
<?php
/* Version 1.0 written by Ierlandfan */
/* Version 1.0 modified by DennisD */
/* Version 2.0 rewritten by FunFair */
/* Version 2.1 update by FunFair */
/* 24-10-2017 */
/*
Changelog Version 2.2:
- Corrected Low and Normal tariff. They were reversed.
Changelog Version 2.1:
- Implemented production counters for P1 meter.
- Removed the compare to previous value, so it will update every minute.
Changelog Version 2.0:
- Rewrite from version 1.0
- Define IP adresses and idx value at start
- Check if Toon value is lower than Domoticz Value. (In case connection is lost with meteradapter, Toon will output wrong values.) */
/* Instructions:
- Create a virtual P1 meter in Domoticz and write down idx value.
- Place script in Domoticz folder /home/pi/domoticz/scripts/p1_meter/ or desired folder.
- Set IP numbers and idx values below.
- Make sure Curl is installed (sudo apt-get install php-curl).
- Make sure script is executable (chmod +x filename.php).
- All echo's are used for debugging.
- Put script in 'crontab -e' to run every minute. */
#Example crontab: (*/1 * * * * /home/pi/domoticz/scripts/p1_meter/p1_meter_data_json.php)
/* Set IP addresses and idx*/
$IPDomoticz = '192.168.0.200:8080';
$IPToon = '192.168.0.11';
$idx = 26;
/* read electricity value from Domoticz */
$json_string = file_get_contents("http://$IPDomoticz/json.htm?type=devices&rid=$idx");
$parsed_json = json_decode($json_string, true);
$parsed_json = $parsed_json['result'][0];
$ElecUsageCounterDomoticz = $parsed_json['Counter']*1000;
$ElecProductionCounterDomoticz = $parsed_json['CounterDeliv']*1000;
echo "Electricity Usage Counter Domoticz = ";
echo $ElecUsageCounterDomoticz;
echo " Wh";
echo "\n";
echo "Electricity Production Counter Domoticz = ";
echo $ElecProductionCounterDomoticz;
echo " Wh";
echo "\n";
echo "\n";
/* start of the total Energy Usage counter import */
$file_string_ElecUsageCounter = file_get_contents("http://$IPToon/hdrv_zwave?action=getDevices.json");
$parsed_json_ElecCounter = json_decode($file_string_ElecUsageCounter, true);
/* start of current Energy Usage import */
$file_string_ElecUsage = file_get_contents("http://$IPToon/happ_pwrusage?action=GetCurrentUsage");
$parsed_json_ElecUsage = json_decode($file_string_ElecUsage, true);
/* start of the total Energy Production counter import */
$file_string_ElecProductionCounter = file_get_contents("http://$IPToon/hdrv_zwave?action=getDevices.json");
$parsed_json_ElecProductionCounter = json_decode($file_string_ElecProductionCounter, true);
/* start of current Energy Production import */
$file_string_ElecProduction = file_get_contents("http://$IPToon/happ_pwrusage?action=GetCurrentUsage");
$parsed_json_ElecProduction = json_decode($file_string_ElecProduction, true);
/* extract counter normal tariff and low tariff and add them together */
$ElecUsageCounterNT = $parsed_json_ElecCounter['dev_3.3']['CurrentElectricityQuantity']; #normal tariff
$ElecUsageCounterLT = $parsed_json_ElecCounter['dev_3.5']['CurrentElectricityQuantity']; #low tariff
$ElecUsageCounterToon = $ElecUsageCounterNT + $ElecUsageCounterLT;
$ElecProductionCounterNT = $parsed_json_ElecProductionCounter['dev_3.4']['CurrentElectricityQuantity']; #normal tariff
$ElecProductionCounterLT = $parsed_json_ElecProductionCounter['dev_3.6']['CurrentElectricityQuantity']; #low tariff
$ElecProductionCounterToon = $ElecProductionCounterNT + $ElecProductionCounterLT;
echo "Electricity Counter Toon Low Tariff = ";
echo $ElecUsageCounterLT;
echo " Wh";
echo "\n";
echo "Electricity Counter Toon Normal Tariff = ";
echo $ElecUsageCounterNT;
echo " Wh";
echo "\n";
echo "Electricity Counter Toon Total = ";
echo $ElecUsageCounterToon;
echo " Wh";
echo "\n";
echo "\n";
echo "Electricity Production Counter Toon Low Tariff = ";
echo $ElecProductionCounterLT;
echo " Wh";
echo "\n";
echo "Electricity Production Counter Toon Normal Tariff = ";
echo $ElecProductionCounterNT;
echo " Wh";
echo "\n";
echo "Electricity Production Counter Toon Total = ";
echo $ElecProductionCounterToon;
echo " Wh";
echo "\n";
echo "\n";
/* extract the current powerusage */
$ElecUsageToon=$parsed_json_ElecUsage['powerUsage']['value'];
echo "Electricity Usage Toon = ";
echo $ElecUsageToon;
echo " Watt";
echo "\n";
/* extract the current powerProduction */
$ElecProductionToon=$parsed_json_ElecProduction['powerProduction']['value'];
echo "Electricity Production Toon = ";
echo $ElecProductionToon;
echo " Watt";
echo "\n";
/* write new value to Domoticz */
if ($ElecUsageCounterDomoticz == 0){ #this is for the first run only, when the idx is still empty.
$WriteInitValue = curl_init("http://$IPDomoticz/json.htm?type=command¶m=udevice&idx=$idx&nvalue=0&svalue=$ElecUsageCounterLT;$ElecUsageCounterNT;$ElecProductionCounterLT;$ElecProductionCounterNT;$ElecUsageToon;$ElecProductionToon;");
curl_exec($WriteInitValue);
}
else if ($ElecUsageCounterToon < $ElecUsageCounterDomoticz){
echo "Toon value incorrect, do nothing \n";
}
else if ($ElecUsageCounterToon >= $ElecUsageCounterDomoticz){
$WriteValue = curl_init("http://$IPDomoticz/json.htm?type=command¶m=udevice&idx=$idx&nvalue=0&svalue=$ElecUsageCounterLT;$ElecUsageCounterNT;$ElecProductionCounterLT;$ElecProductionCounterNT;$ElecUsageToon;$ElecProductionToon;");
echo "\n";
echo "Write new value \n";
curl_exec($WriteValue);
}
else {
echo "Domoticz value incorrect, do nothing \n";
}
?>
Yes, curl is installed.
Code: Select all
-- Check the wiki at
-- http://www.domoticz.com/wiki/%27dzVents%27:_next_generation_LUA_scripting
return {
on = {
timer = {
'every minute'
}
},
execute = function(domoticz)
local ToonThermostatSensorName = domoticz.variables('UV_ToonThermostatSensorName').value -- Sensor showing current setpoint
local ToonTemperatureSensorName = domoticz.variables('UV_ToonTemperatureSensorName').value -- Sensor showing current room temperature
local ToonScenesSensorName = domoticz.variables('UV_ToonScenesSensorName').value -- Sensor showing current program
local ToonAutoProgramSensorName = domoticz.variables('UV_ToonAutoProgramSensorName').value -- Sensor showing current auto program status
local ToonProgramInformationSensorName = domoticz.variables('UV_ToonProgramInformationSensorName').value -- Sensor showing displaying program information status
local ToonIP = domoticz.variables('UV_ToonIP').value
local DomoticzIP = domoticz.variables('UV_DomoticzIP').value
-- Handle json
--local json = assert(loadfile "C:\\Program Files (x86)\\Domoticz\\scripts\\lua\\json.lua")() -- For Windows
--local json = assert(loadfile "/home/maes/domoticz/scripts/lua/JSON.lua")() -- For Linux
local json = assert(loadfile "/volume1/@appstore/domoticz/var/scripts/lua/JSON.lua")() -- For Synology
--local handle = assert(io.popen(string.format('curl http://%s/happ_thermstat?action=getThermostatInfo', ToonIP)))
local handle = assert(io.popen(string.format('curl http://192.168.3.104/happ_thermstat?action=getThermostatInfo', ToonIP)))
local ThermostatInfo = handle:read('*all')
handle:close()
local jsonThermostatInfo = json:decode(ThermostatInfo)
if jsonThermostatInfo == nil then
return
end
local currentSetpoint = tonumber(jsonThermostatInfo.currentSetpoint) / 100
local currentTemperature = tonumber(jsonThermostatInfo.currentTemp) / 100
local currentProgramState = tonumber(jsonThermostatInfo.programState)
if currentProgramState == 0 then currentProgramState = 10 -- No
elseif currentProgramState == 1 then currentProgramState = 20 -- Yes
elseif currentProgramState == 2 then currentProgramState = 30 -- Temporary
end
local currentActiveState = tonumber(jsonThermostatInfo.activeState)
if currentActiveState == -1 then currentActiveState = 50 -- Manual
elseif currentActiveState == 0 then currentActiveState = 40 -- Comfort
elseif currentActiveState == 1 then currentActiveState = 30 -- Home
elseif currentActiveState == 2 then currentActiveState = 20 -- Sleep
elseif currentActiveState == 3 then currentActiveState = 10 -- Away
end
local currentNextTime = jsonThermostatInfo.nextTime
local currentNextSetPoint = tonumber(jsonThermostatInfo.nextSetpoint) / 100
local currentBoiletSetPoint = jsonThermostatInfo.currentInternalBoilerSetpoint
----
-- Update the thermostat sensor to current setpoint
if domoticz.devices(ToonThermostatSensorName).setPoint*100 ~= currentSetpoint*100 then
domoticz.log('Updating thermostat sensor to new set point: ' ..currentSetpoint)
domoticz.devices(ToonThermostatSensorName).updateSetPoint(currentSetpoint).silent()
end
-- Update the toon scene selector sensor to current program state
if domoticz.devices(ToonScenesSensorName).level ~= currentActiveState then -- Update toon selector if it has changed
domoticz.log('Updating Toon Scenes selector to: '..currentActiveState)
domoticz.devices(ToonScenesSensorName).switchSelector(currentActiveState).silent()
end
-- Updates the toon auto program switch
if domoticz.devices(ToonAutoProgramSensorName).level ~= currentProgramState then -- Update toon auto program selector if it has changed
domoticz.log('Updating Toon Auto Program selector to: '..currentProgramState)
domoticz.devices(ToonAutoProgramSensorName).switchSelector(currentProgramState).silent()
end
-- Updates the toon program information text box
if currentNextTime == 0 or currentNextSetPoint == 0 then
ToonProgramInformationSensorValue = 'Op ' ..currentSetpoint.. '°'
else
ToonProgramInformationSensorValue = 'Om ' ..os.date('%H:%M', currentNextTime).. ' op ' ..currentNextSetPoint.. '°'
end
if domoticz.devices(ToonProgramInformationSensorName).text ~= ToonProgramInformationSensorValue then
domoticz.log('Updating Toon Program Information to: '..ToonProgramInformationSensorValue)
domoticz.devices(ToonProgramInformationSensorName).updateText(ToonProgramInformationSensorValue)
end
print("currentTemperature - " .. currentTemperature)
-- Update the temperature sensor to current room temperature
if domoticz.round(domoticz.devices(ToonTemperatureSensorName).temperature, 1) ~= domoticz.round(currentTemperature, 1) then
domoticz.log('Updating the temperature sensor to new value: ' ..currentTemperature)
domoticz.devices(ToonTemperatureSensorName).updateTemperature(currentTemperature)
end
end
}
Hi, I am using this scripts for my energy readings.FunFair wrote: ↑Sunday 22 October 2017 9:55 I've updated the php script that reads out the production values from the smartmeter (trough Toon) aswell.
This one works with a virtual P1 Meter.
I am still testing it. Seeing as today there is almost no sun and I only have 2 solarpanels. I don't expect to return any power.
-edit-Code: Select all
#!/usr/bin/php <?php /* Version 1.0 written by Ierlandfan */ /* Version 1.0 modified by DennisD */ /* Version 2.0 rewritten by FunFair */ /* Version 2.1 update by FunFair */ /* 24-10-2017 */ /* Changelog Version 2.2: - Corrected Low and Normal tariff. They were reversed. Changelog Version 2.1: - Implemented production counters for P1 meter. - Removed the compare to previous value, so it will update every minute. Changelog Version 2.0: - Rewrite from version 1.0 - Define IP adresses and idx value at start - Check if Toon value is lower than Domoticz Value. (In case connection is lost with meteradapter, Toon will output wrong values.) */ /* Instructions: - Create a virtual P1 meter in Domoticz and write down idx value. - Place script in Domoticz folder /home/pi/domoticz/scripts/p1_meter/ or desired folder. - Set IP numbers and idx values below. - Make sure Curl is installed (sudo apt-get install php-curl). - Make sure script is executable (chmod +x filename.php). - All echo's are used for debugging. - Put script in 'crontab -e' to run every minute. */ #Example crontab: (*/1 * * * * /home/pi/domoticz/scripts/p1_meter/p1_meter_data_json.php) /* Set IP addresses and idx*/ $IPDomoticz = '192.168.0.200:8080'; $IPToon = '192.168.0.11'; $idx = 26; /* read electricity value from Domoticz */ $json_string = file_get_contents("http://$IPDomoticz/json.htm?type=devices&rid=$idx"); $parsed_json = json_decode($json_string, true); $parsed_json = $parsed_json['result'][0]; $ElecUsageCounterDomoticz = $parsed_json['Counter']*1000; $ElecProductionCounterDomoticz = $parsed_json['CounterDeliv']*1000; echo "Electricity Usage Counter Domoticz = "; echo $ElecUsageCounterDomoticz; echo " Wh"; echo "\n"; echo "Electricity Production Counter Domoticz = "; echo $ElecProductionCounterDomoticz; echo " Wh"; echo "\n"; echo "\n"; /* start of the total Energy Usage counter import */ $file_string_ElecUsageCounter = file_get_contents("http://$IPToon/hdrv_zwave?action=getDevices.json"); $parsed_json_ElecCounter = json_decode($file_string_ElecUsageCounter, true); /* start of current Energy Usage import */ $file_string_ElecUsage = file_get_contents("http://$IPToon/happ_pwrusage?action=GetCurrentUsage"); $parsed_json_ElecUsage = json_decode($file_string_ElecUsage, true); /* start of the total Energy Production counter import */ $file_string_ElecProductionCounter = file_get_contents("http://$IPToon/hdrv_zwave?action=getDevices.json"); $parsed_json_ElecProductionCounter = json_decode($file_string_ElecProductionCounter, true); /* start of current Energy Production import */ $file_string_ElecProduction = file_get_contents("http://$IPToon/happ_pwrusage?action=GetCurrentUsage"); $parsed_json_ElecProduction = json_decode($file_string_ElecProduction, true); /* extract counter normal tariff and low tariff and add them together */ $ElecUsageCounterNT = $parsed_json_ElecCounter['dev_3.3']['CurrentElectricityQuantity']; #normal tariff $ElecUsageCounterLT = $parsed_json_ElecCounter['dev_3.5']['CurrentElectricityQuantity']; #low tariff $ElecUsageCounterToon = $ElecUsageCounterNT + $ElecUsageCounterLT; $ElecProductionCounterNT = $parsed_json_ElecProductionCounter['dev_3.4']['CurrentElectricityQuantity']; #normal tariff $ElecProductionCounterLT = $parsed_json_ElecProductionCounter['dev_3.6']['CurrentElectricityQuantity']; #low tariff $ElecProductionCounterToon = $ElecProductionCounterNT + $ElecProductionCounterLT; echo "Electricity Counter Toon Low Tariff = "; echo $ElecUsageCounterLT; echo " Wh"; echo "\n"; echo "Electricity Counter Toon Normal Tariff = "; echo $ElecUsageCounterNT; echo " Wh"; echo "\n"; echo "Electricity Counter Toon Total = "; echo $ElecUsageCounterToon; echo " Wh"; echo "\n"; echo "\n"; echo "Electricity Production Counter Toon Low Tariff = "; echo $ElecProductionCounterLT; echo " Wh"; echo "\n"; echo "Electricity Production Counter Toon Normal Tariff = "; echo $ElecProductionCounterNT; echo " Wh"; echo "\n"; echo "Electricity Production Counter Toon Total = "; echo $ElecProductionCounterToon; echo " Wh"; echo "\n"; echo "\n"; /* extract the current powerusage */ $ElecUsageToon=$parsed_json_ElecUsage['powerUsage']['value']; echo "Electricity Usage Toon = "; echo $ElecUsageToon; echo " Watt"; echo "\n"; /* extract the current powerProduction */ $ElecProductionToon=$parsed_json_ElecProduction['powerProduction']['value']; echo "Electricity Production Toon = "; echo $ElecProductionToon; echo " Watt"; echo "\n"; /* write new value to Domoticz */ if ($ElecUsageCounterDomoticz == 0){ #this is for the first run only, when the idx is still empty. $WriteInitValue = curl_init("http://$IPDomoticz/json.htm?type=command¶m=udevice&idx=$idx&nvalue=0&svalue=$ElecUsageCounterLT;$ElecUsageCounterNT;$ElecProductionCounterLT;$ElecProductionCounterNT;$ElecUsageToon;$ElecProductionToon;"); curl_exec($WriteInitValue); } else if ($ElecUsageCounterToon < $ElecUsageCounterDomoticz){ echo "Toon value incorrect, do nothing \n"; } else if ($ElecUsageCounterToon >= $ElecUsageCounterDomoticz){ $WriteValue = curl_init("http://$IPDomoticz/json.htm?type=command¶m=udevice&idx=$idx&nvalue=0&svalue=$ElecUsageCounterLT;$ElecUsageCounterNT;$ElecProductionCounterLT;$ElecProductionCounterNT;$ElecUsageToon;$ElecProductionToon;"); echo "\n"; echo "Write new value \n"; curl_exec($WriteValue); } else { echo "Domoticz value incorrect, do nothing \n"; } ?>
Tested it and changed it a bit. Changed the code above and attached new verion as zip. Corrected a huge rror by confusing daytime and nighttime.
corrected the other scripts aswell
-edit2-
corrected some variables for all scripts. See new attached file.
Code: Select all
pi@raspberrypi:~/domoticz/scripts/php $ ./electricity_data_json.php
Electricity Counter Domoticz = 0 Wh
Electricity Counter Toon = 0 Wh
Electricity Usage Toon = 413 Watt
PHP Fatal error: Call to undefined function curl_init() in /home/pi/domoticz/scripts/php/electricity_data_json.php on line 71
Code: Select all
pi@raspberrypi:~/domoticz/scripts/php $ ./gas_data_json.php
Gas Value Domoticz = 0 liters
Gas Value Toon = 590.00 liters
PHP Fatal error: Call to undefined function curl_init() in /home/pi/domoticz/scripts/php/gas_data_json.php on line 55
Code: Select all
pi@raspberrypi:~/domoticz/scripts/php $ ./electricity_data_json.php
Electricity Counter Domoticz = 0 Wh
Electricity Counter Toon = 0 Wh
Electricity Usage Toon = 654 Watt
{
"status" : "OK",
"title" : "Update Device"
}
https://www.domoticz.com/wiki/Domoticz_ ... 27s#Formatpascal34 wrote: ↑Friday 10 November 2017 10:59
Hi, I am using this scripts for my energy readings.
But wen I set in Domoticz Setup > Settings in Website Protection a username and Password the scripts stopped working, wen I remove my username and password they are updating again. How can I fix this.
Using Domoticz V3.8153 on a Rasberry Pi 3 B
Thanks, Pascal
Yes thats worksFunFair wrote: ↑Saturday 11 November 2017 9:26https://www.domoticz.com/wiki/Domoticz_ ... 27s#Formatpascal34 wrote: ↑Friday 10 November 2017 10:59
Hi, I am using this scripts for my energy readings.
But wen I set in Domoticz Setup > Settings in Website Protection a username and Password the scripts stopped working, wen I remove my username and password they are updating again. How can I fix this.
Using Domoticz V3.8153 on a Rasberry Pi 3 B
Thanks, Pascal
Add this to the $IPDomoticz setting.
So $IPDomoticz = 'username:password@domoticz-ip:port';
This is my outputFunFair wrote: ↑Saturday 11 November 2017 9:22 Check if the dev_x.x are correct in http://192.168.0.11/hdrv_zwave?action=getDevices.json
Change ip to your toon.
Maybe they are different from my Toon?
Look for "elec_delivered_nt" and "elec_delivered_lt"
Code: Select all
{
"dev_settings_device":{"uuid":"eneco-001-003065:hdrv_zwave_722E1463E52", "name":"settings_device", "internalAddress":"settings_device", "type":"settings_device", "supportsCrc":"0", "location":"(null)"},
"dev_3":{"uuid":"eneco-001-003065:hdrv_zwave_72262C23F3F", "name":"HAE_METER_v2", "internalAddress":"3", "type":"HAE_METER_v2", "supportsCrc":"1", "ccList":"22 3c 3d 3e 56 60 70 72 7a 86 8b 73", "supportedCC":"22 3c 3d 3e 56 60 70 72 7a 86 8b 73", "IsConnected":"1", "HealthValue":"10", "DeviceName":"", "location":"(null)"},
"dev_3.1":{"uuid":"eneco-001-003065:hdrv_zwave_72227F83F45", "name":"HAE_METER_v2_1", "internalAddress":"3.1", "type":"gas", "supportsCrc":"0", "ccList":"3c 3d 3e 72 86", "supportedCC":"3c 3d 3e 72 86", "CurrentGasFlow":"0.00", "CurrentGasQuantity":"1990.00", "location":"(null)"},
"dev_3.2":{"uuid":"eneco-001-003065:hdrv_zwave_722E9E83F45", "name":"HAE_METER_v2_2", "internalAddress":"3.2", "type":"elec", "supportsCrc":"0", "CurrentElectricityFlow":"3682.00", "CurrentElectricityQuantity":"9640.00", "location":"(null)"},
"dev_3.3":{"uuid":"eneco-001-003065:hdrv_zwave_722438D3F45", "name":"HAE_METER_v2_3", "internalAddress":"3.3", "type":"elec_delivered_nt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"},
"dev_3.4":{"uuid":"eneco-001-003065:hdrv_zwave_722255A3F45", "name":"HAE_METER_v2_4", "internalAddress":"3.4", "type":"elec_received_nt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"},
"dev_3.5":{"uuid":"eneco-001-003065:hdrv_zwave_72272633F45", "name":"HAE_METER_v2_5", "internalAddress":"3.5", "type":"elec_delivered_lt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"},
"dev_3.6":{"uuid":"eneco-001-003065:hdrv_zwave_722D79F3F45", "name":"HAE_METER_v2_6", "internalAddress":"3.6", "type":"elec_received_lt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"}
}
Do you have a smartmeter?gielie wrote: ↑Sunday 12 November 2017 16:43This is my outputFunFair wrote: ↑Saturday 11 November 2017 9:22 Check if the dev_x.x are correct in http://192.168.0.11/hdrv_zwave?action=getDevices.json
Change ip to your toon.
Maybe they are different from my Toon?
Look for "elec_delivered_nt" and "elec_delivered_lt"does this make sense?Code: Select all
{ "dev_settings_device":{"uuid":"eneco-001-003065:hdrv_zwave_722E1463E52", "name":"settings_device", "internalAddress":"settings_device", "type":"settings_device", "supportsCrc":"0", "location":"(null)"}, "dev_3":{"uuid":"eneco-001-003065:hdrv_zwave_72262C23F3F", "name":"HAE_METER_v2", "internalAddress":"3", "type":"HAE_METER_v2", "supportsCrc":"1", "ccList":"22 3c 3d 3e 56 60 70 72 7a 86 8b 73", "supportedCC":"22 3c 3d 3e 56 60 70 72 7a 86 8b 73", "IsConnected":"1", "HealthValue":"10", "DeviceName":"", "location":"(null)"}, "dev_3.1":{"uuid":"eneco-001-003065:hdrv_zwave_72227F83F45", "name":"HAE_METER_v2_1", "internalAddress":"3.1", "type":"gas", "supportsCrc":"0", "ccList":"3c 3d 3e 72 86", "supportedCC":"3c 3d 3e 72 86", "CurrentGasFlow":"0.00", "CurrentGasQuantity":"1990.00", "location":"(null)"}, "dev_3.2":{"uuid":"eneco-001-003065:hdrv_zwave_722E9E83F45", "name":"HAE_METER_v2_2", "internalAddress":"3.2", "type":"elec", "supportsCrc":"0", "CurrentElectricityFlow":"3682.00", "CurrentElectricityQuantity":"9640.00", "location":"(null)"}, "dev_3.3":{"uuid":"eneco-001-003065:hdrv_zwave_722438D3F45", "name":"HAE_METER_v2_3", "internalAddress":"3.3", "type":"elec_delivered_nt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"}, "dev_3.4":{"uuid":"eneco-001-003065:hdrv_zwave_722255A3F45", "name":"HAE_METER_v2_4", "internalAddress":"3.4", "type":"elec_received_nt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"}, "dev_3.5":{"uuid":"eneco-001-003065:hdrv_zwave_72272633F45", "name":"HAE_METER_v2_5", "internalAddress":"3.5", "type":"elec_delivered_lt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"}, "dev_3.6":{"uuid":"eneco-001-003065:hdrv_zwave_722D79F3F45", "name":"HAE_METER_v2_6", "internalAddress":"3.6", "type":"elec_received_lt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"} }
I don’t have a smart meter, so I figured out I have to change a lot in the script, I will take a shot to change this or does someone here allready have this script ready?FunFair wrote: ↑Sunday 12 November 2017 18:31Do you have a smartmeter?gielie wrote: ↑Sunday 12 November 2017 16:43This is my outputFunFair wrote: ↑Saturday 11 November 2017 9:22 Check if the dev_x.x are correct in http://192.168.0.11/hdrv_zwave?action=getDevices.json
Change ip to your toon.
Maybe they are different from my Toon?
Look for "elec_delivered_nt" and "elec_delivered_lt"does this make sense?Code: Select all
{ "dev_settings_device":{"uuid":"eneco-001-003065:hdrv_zwave_722E1463E52", "name":"settings_device", "internalAddress":"settings_device", "type":"settings_device", "supportsCrc":"0", "location":"(null)"}, "dev_3":{"uuid":"eneco-001-003065:hdrv_zwave_72262C23F3F", "name":"HAE_METER_v2", "internalAddress":"3", "type":"HAE_METER_v2", "supportsCrc":"1", "ccList":"22 3c 3d 3e 56 60 70 72 7a 86 8b 73", "supportedCC":"22 3c 3d 3e 56 60 70 72 7a 86 8b 73", "IsConnected":"1", "HealthValue":"10", "DeviceName":"", "location":"(null)"}, "dev_3.1":{"uuid":"eneco-001-003065:hdrv_zwave_72227F83F45", "name":"HAE_METER_v2_1", "internalAddress":"3.1", "type":"gas", "supportsCrc":"0", "ccList":"3c 3d 3e 72 86", "supportedCC":"3c 3d 3e 72 86", "CurrentGasFlow":"0.00", "CurrentGasQuantity":"1990.00", "location":"(null)"}, "dev_3.2":{"uuid":"eneco-001-003065:hdrv_zwave_722E9E83F45", "name":"HAE_METER_v2_2", "internalAddress":"3.2", "type":"elec", "supportsCrc":"0", "CurrentElectricityFlow":"3682.00", "CurrentElectricityQuantity":"9640.00", "location":"(null)"}, "dev_3.3":{"uuid":"eneco-001-003065:hdrv_zwave_722438D3F45", "name":"HAE_METER_v2_3", "internalAddress":"3.3", "type":"elec_delivered_nt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"}, "dev_3.4":{"uuid":"eneco-001-003065:hdrv_zwave_722255A3F45", "name":"HAE_METER_v2_4", "internalAddress":"3.4", "type":"elec_received_nt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"}, "dev_3.5":{"uuid":"eneco-001-003065:hdrv_zwave_72272633F45", "name":"HAE_METER_v2_5", "internalAddress":"3.5", "type":"elec_delivered_lt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"}, "dev_3.6":{"uuid":"eneco-001-003065:hdrv_zwave_722D79F3F45", "name":"HAE_METER_v2_6", "internalAddress":"3.6", "type":"elec_received_lt", "supportsCrc":"0", "CurrentElectricityFlow":"NaN", "CurrentElectricityQuantity":"NaN", "location":"(null)"} }
If not please check the currentgas and currentelectricity quantity if they are the same as on your toon display.
If so the script needs some changes to read out the correct values.