rvdvoorde / domoticz-homewizard

Plugin for Domoticz
http://www.domoticz.com/
GNU General Public License v3.0
12 stars 10 forks source link

adding current electra + day total and current gas #13

Closed Itsmmai closed 5 years ago

Itsmmai commented 6 years ago

Hi,

Today I tried adding electra and gas usage (current and today) to your plugin. But I didn't succeed. PHP programing I get (a little bit) but this is completely new for me.

I really would like to add a Gas and Electricity meter or add the vallues to the current meters. I found out that current usage can be added to the by you created items.

I use the following in PHP:

////Stroom $stv = $data['response']['energylinks']['0']['used']['dayTotal']; //dagtotaal $sta = $data['response']['energylinks']['0']['used']['po']; //actueel if(is_numeric($stv) and is_numeric($sta)){web('n',"http://x.x.x.x:8077/json.htm?type=command&param=udevice&idx=9&nvalue=0&svalue=".$sta.";".($stv*1000)."" );}//Stroom echt tt verbruik

////Gas $gav = ''; $gaa = ''; $gav = $data['response']['energylinks']['0']['gas']['dayTotal']; //dagtotaal $gaa = $data['response']['energylinks']['0']['gas']['lastHour']; //actueel // echo "Gas gebruikt: ".$gaa." Gas vandaag: ".$gav."!"; if($gav > 0 ){web('n',"http://x.x.x.x:8077/json.htm?type=command&param=udevice&idx=122&nvalue=0&svalue=".($gav*1000)."" );} if($gav == 0 ){web('n',"http://x.x.x.x:8077/json.htm?type=command&param=udevice&idx=122&nvalue=0&svalue=0" );}

Can you please help me or add this to the new version ?

Thanks Ab

ajseesink commented 5 years ago

Is this added in the current version?