[Store] AP Systems

Discussion et échanges de scripts pour la box eedomus

[Store] AP Systems

Messagepar dominiquebelge » 20 Avr 2021 14:28

Bonjour à vous,

Je viens d'installer des panneaux solaires avec un micro-controlleur de la marque AP Systems. J'aimerais intégrer ces information sur ma box eedomus.
Le périphérique proposé sur le store recueille les information de production cumulée et j'aimerais obtenir les informations de production instantanée.

Avez-vous déjà modifié ce genre de script? Pouvez-vous me guider sur les outils utilisés? car la documentation n'est pas très complète sur le sujet.

Code : Tout sélectionner
<?
//https://doc.eedomus.com/view/Scripts

$adressOption = getArg('adress');
$valOption = getArg('val');

//$adressOption = '192.168.0.26';
//$valOption = 1;

$address = 'http://'.$adressOption.'/index.php/realtimedata/old_energy_graph?date=' . date('Y-m-d') . '&period=weekly';
$request = httpQuery($address, $action = 'GET', $post = NULL, $oauth_token = NULL, $headers = NULL, $use_cookies = false, $ignore_errors = true);

$xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
$xml .= "<APSYSTEMS>\n";

if (strpos($request, '<h1>Not Found</h1>')){
    $xml .= "<ETAT> AP Systems injoignable</ETAT>\n";
    $xml .= "</APSYSTEMS>"; 
    // Alternative
    sdk_header('text/xml');
    echo $xml;
    return;
}

$xml .= "<ETAT> ok </ETAT>\n";
//{"energy":[{"date":"11\/02","energy":2.07},{"date":"11\/03","energy":3.2},{"date":"11\/04","energy":3.77},{"date":"11\/05","energy":4.09},{"date":"11\/06","energy":3.89},{"date":"11\/07","energy":3.2},{"date":"11\/08","energy":2.28}],"total_energy":22.5,"subtitle":""}
$returnValues = sdk_json_decode($request);
if ($valOption == 1) {
    $valreturn = $returnValues['energy'][count($returnValues['energy'])-1]['energy'];
} else {
    $valreturn = $returnValues['total_energy'];
}
$xml .= "<VALUE>" . $valreturn . "</VALUE>\n";
$xml .= "</APSYSTEMS>"; 
sdk_header('text/xml');
echo $xml;

?>


Merci d'avance,
dominiquebelge
 
Messages : 5
Inscription : 29 Mars 2021

Re: Information AP Systems

Messagepar merguez07 » 20 Avr 2021 16:43

Bonjour,

j'espère une fois de plus ne pas parler à un bot :D

dominiquebelge a écrit:Le périphérique proposé sur le store recueille les information de production cumulée et j'aimerais obtenir les informations de production instantanée.


de quel plugin parles tu ?
tuto 1 -->Programmation des scripts Eedomus
tuto 2 -->SmartDevice
tuto 3 -->Le déclenchement de règles
scripts -->Météo du jour | GH Thermostat | TotalWatt | Detecfire | smartbattery
Skype Eedomus -->lien vers le skype Eedomus
merguez07
 
Messages : 2346
Inscription : 15 Sep 2017
Localisation : Le Teil en Ardèche

Re: Information AP Systems

Messagepar ARTNOW » 20 Avr 2021 17:10

BOT OR NO BOT that is the question MDR :D
EEDOMUS + -RFP1000-IPX 800 V4-IPX 800 V5 - FIBARO -GOOGLE(Home-Nest & mini)
ARDUINO-RASPBERRY PRUSA MK3S
Domotisation de :1xPiscine/9xClimatisations réversibles/2xVolets somfy/1xAlarme/1xChauffe-Eau thermodynamique/3xPortes Garage et 1xportail
ARTNOW
 
Messages : 1280
Inscription : 22 Avr 2018
Localisation : LOIRE ATLANTIQUE

Re: Information AP Systems

Messagepar merguez07 » 20 Avr 2021 19:17

ARTNOW a écrit:BOT OR NO BOT that is the question MDR


oui je me mefie toujours des premiers messages.
Mais bon celui là était pertinent.

Si notre ami dominique ne réagit pas rapidement je concluerais que les BOT ont fait des supers progrès
tuto 1 -->Programmation des scripts Eedomus
tuto 2 -->SmartDevice
tuto 3 -->Le déclenchement de règles
scripts -->Météo du jour | GH Thermostat | TotalWatt | Detecfire | smartbattery
Skype Eedomus -->lien vers le skype Eedomus
merguez07
 
Messages : 2346
Inscription : 15 Sep 2017
Localisation : Le Teil en Ardèche

Re: Information AP Systems

Messagepar ARTNOW » 20 Avr 2021 19:58

Oui , pas facile de faire la part des choses ...... :shock:
EEDOMUS + -RFP1000-IPX 800 V4-IPX 800 V5 - FIBARO -GOOGLE(Home-Nest & mini)
ARDUINO-RASPBERRY PRUSA MK3S
Domotisation de :1xPiscine/9xClimatisations réversibles/2xVolets somfy/1xAlarme/1xChauffe-Eau thermodynamique/3xPortes Garage et 1xportail
ARTNOW
 
Messages : 1280
Inscription : 22 Avr 2018
Localisation : LOIRE ATLANTIQUE

Re: Information AP Systems

Messagepar ARTNOW » 20 Avr 2021 20:06

En plus les bots s'enrichissent de multiples connaissances et peuvent être pertinent parfois....... donc paf on se fait avoir , mais bon ils finissent par se faire démasqués en quelques jours ….on à pas finit de se faire avoir , il faut qu'on surveilles :roll:
EEDOMUS + -RFP1000-IPX 800 V4-IPX 800 V5 - FIBARO -GOOGLE(Home-Nest & mini)
ARDUINO-RASPBERRY PRUSA MK3S
Domotisation de :1xPiscine/9xClimatisations réversibles/2xVolets somfy/1xAlarme/1xChauffe-Eau thermodynamique/3xPortes Garage et 1xportail
ARTNOW
 
Messages : 1280
Inscription : 22 Avr 2018
Localisation : LOIRE ATLANTIQUE

Re: Information AP Systems

Messagepar dominiquebelge » 21 Avr 2021 07:03

J'ai des bottes en caoutchouc quand il pleut, ça répond à la question?

Il s'agit de ce plugin est celui-ci
https://secure.eedomus.com/pages/doc.php?type=apsystems&file=readme_fr.md

Et le script que j'ai mis dans mon poste est copié tel quel.

En reparcourant le store, j 'ai vu que le créateur proposait un lien "github", je vais aussi creuser de ce côté là.

Au sinon, je vais me plonger dans le php pour modifier le script à a convenance. Même un bot doit être capable de s'adpapter ;-)

Bonne journée
dominiquebelge
 
Messages : 5
Inscription : 29 Mars 2021

Re: Information AP Systems

Messagepar ARTNOW » 21 Avr 2021 07:17

Salut dominiquebelge , désolé de la méprise , mais on est toujours méfiant concernant les premiers messages des nouveaux arrivants , je n'ai pas la compétence pour t'aider , mais ne désespère pas ici il y à des collègues qui sauront probablement t'aider . ;)
EEDOMUS + -RFP1000-IPX 800 V4-IPX 800 V5 - FIBARO -GOOGLE(Home-Nest & mini)
ARDUINO-RASPBERRY PRUSA MK3S
Domotisation de :1xPiscine/9xClimatisations réversibles/2xVolets somfy/1xAlarme/1xChauffe-Eau thermodynamique/3xPortes Garage et 1xportail
ARTNOW
 
Messages : 1280
Inscription : 22 Avr 2018
Localisation : LOIRE ATLANTIQUE

Re: Information AP Systems

Messagepar merguez07 » 21 Avr 2021 08:06

dominiquebelge a écrit:J'ai des bottes en caoutchouc quand il pleut, ça répond à la question?


bon c'est clair, tu n'es pas un BOT (les BOT ne font pas d'humour)

le lien que tu nous as mis ne dit pas grand chose (du moins chez moi). J'ai finalement trouvé le plugin

dominiquebelge a écrit:Le périphérique proposé sur le store recueille les information de production cumulée et j'aimerais obtenir les informations de production instantanée.


toute la question est : est ce que l'APsystem fournit ce paramètre ?

Le plugin fait la requête :
'http://'.IP_APSYSTEM.'/index.php/realtimedata/old_energy_graph?date=' . date('Y-m-d') . '&period=weekly';

cette requête ne fournit (semble t-il) qu'un json ne contenant que l''energie fournie (production cumulée)

Y a t-il une autre requête qui te donnerait ces valeurs de puissance instantanée ?
tuto 1 -->Programmation des scripts Eedomus
tuto 2 -->SmartDevice
tuto 3 -->Le déclenchement de règles
scripts -->Météo du jour | GH Thermostat | TotalWatt | Detecfire | smartbattery
Skype Eedomus -->lien vers le skype Eedomus
merguez07
 
Messages : 2346
Inscription : 15 Sep 2017
Localisation : Le Teil en Ardèche

Re: Information AP Systems

Messagepar dominiquebelge » 21 Avr 2021 08:30

C'est justement cette autre requête que je pense devoir trouver. Mais je n'ai pas encore compris comment formuler cette requête.

Voici le code de l'interface web du produit, les informations sont sans doute renseignés dans realtiemedata :

Code : Tout sélectionner
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!-- 兼容IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- 支持国产浏览器高速模式 -->
<meta name="renderer" content="webkit">
<!-- 响应式布局 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Altenergy Power Control Software</title>
<link type="image/x-icon" href="http://192.168.1.105/resources/images/favicon.ico" rel="shortcut icon">
<link href="http://192.168.1.105/resources/css/bootstrap.min.css" rel="stylesheet">
<link href="http://192.168.1.105/resources/css/ecu-style.css" rel="stylesheet">
<link href="http://192.168.1.105/resources/css/bootstrapValidator.css" rel="stylesheet">
<!--[if lt IE 8]>
<link href="http://192.168.1.105/resources/css/bootstrap-ie7.css" rel="stylesheet">
<![endif]-->
<script src="http://192.168.1.105/resources/js/jquery-1.8.2.min.js"></script>
<script src="http://192.168.1.105/resources/js/bootstrap.min.js"></script>
<script src="http://192.168.1.105/resources/js/bootstrapValidator.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn"t work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="js/html5shiv.min.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- 顶部导航栏 -->
<header>
<div class="navbar navbar-default navbar-top">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" data-target="#navbar-header" data-toggle="collapse" type="button">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://www.altenergy-power.com">
<img src="http://192.168.1.105/resources/images/logo.png">
</a>
</div>
<div class="navbar-collapse collapse" id="navbar-header">
<ul class="nav navbar-nav navbar-title">
<li><a id="ecu_title">ENERGY COMMUNICATION UNIT</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<a class="btn chlang" id="english" >English</a>|
<a class="btn chlang" id="chinese" >Chinese</a>
</ul>
</div>
</div>
</div>
</header><!-- 菜单导航栏 -->
<nav>
<div class="navbar navbar-default navbar-menu">
<div class="container">
<p class="navbar-menu-title">Home</p>
<div class="navbar-header">
<button class="navbar-toggle" data-target="#navbar-menu" data-toggle="collapse" type="button">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span> </button>
</div>
<div class="navbar-collapse collapse" id="navbar-menu">
<ul class="nav navbar-nav ">
<li><a href="http://192.168.1.105/index.php/home" class="active">Home</a></li>
<li><a href="http://192.168.1.105/index.php/realtimedata">Real Time Data</a><span> </span></li>
<li><a href="http://192.168.1.105/index.php/management">Administration</a><span> </span></li>
<li><a href="http://192.168.1.105/index.php/meter/meter_power_graph">Advanced</a><span> </span></li>
</ul>
</div>
</div>
</div>
</nav>
<section>
<div class="container container-main">
<!-- 侧边导航栏 -->
<aside class="col-md-3 col-md-push-9">
<div class="list-group">
<a id="ecu_time" class="list-group-item align-center" ></a>
<a class="list-group-item active align-center">ENVIRONMENTAL BENEFITS</a>
<a class="list-group-item benefit align-center">CO<sub>2</sub> Offset Equivalent to</a>
<a class="list-group-item benefit"><img src="http://192.168.1.105/resources/images/car.png"><div class="pull-right"><center>1<br>GALLONS</center></div></a>
<a class="list-group-item benefit"><img src="http://192.168.1.105/resources/images/tree.png"><div class="pull-right"><center>0<br>TREES</center></div></a>
<a class="list-group-item benefit"><img src="http://192.168.1.105/resources/images/carbon.png"><div class="pull-right"><center>15<br>KG</center></div></a>
</div>
</aside>
<!-- 正文 -->
<article class="col-md-9 col-md-pull-3">
<div class="panel panel-default">
<div class="panel-heading">
Home </div>
<div class="panel-body">
<table class="table table-condensed table-striped table-bordered">
<tr>
<!-- ECU ID -->
<th scope="row" class="col-xs-6">ECU ID</th>
<td>*****************</td>
</tr>
<tr>
<!-- 历史发电量 -->
<th scope="row">Lifetime generation</th>
<td>20.93 kWh </td>
</tr>
<tr>
<!-- 最近一次系统功率 -->
<th scope="row">Last System Power</th>
<td>262 W </td>
</tr>
<tr>
<!-- 系统当天累计发电量 -->
<th scope="row">Generation of Current Day</th>
<td>3.56 kWh </td>
</tr>
<tr>
<!-- 最近一次连接服务器时间 -->
<th scope="row">Last Connection to website</th>
<td>2021-04-07 17:22:47</td>
</tr>
<tr>
<!-- 逆变器总台数 -->
<th scope="row">Number of Inverters</th>
<td>1</td>
</tr>
<tr>
<!-- 最近一次逆变器连接台数 -->
<th scope="row">Last Number of Inverters Online</th>
<td>1</td>
</tr>
<tr>
<!-- 软件版本号 -->
<th scope="row">Current Software Version</th>
<td>C1.1.8</td>
</tr>
<tr>
<!-- 当前时区 -->
<th scope="row">Current Time Zone</th>
<td>Europe/Paris</td>
</tr>
<tr>
<!-- ECU有线网络Mac地址 -->
<th scope="row">ECU Eth0 Mac Address</th>
<td>******************</td>
</tr>
<!-- ECU无线网络Mac地址 -->
<tr>
<th scope="row">ECU Wlan0 Mac Address</th>
<td>********************</td>
</tr>
</table>
<script>
var weekday_en = new Array(7);
weekday_en[0]="Sunday";
weekday_en[1]="Monday";
weekday_en[2]="Tuesday";
weekday_en[3]="Wednesday";
weekday_en[4]="Thursday";
weekday_en[5]="Friday";
weekday_en[6]="Saturday";
var weekday_ch = new Array(7);
weekday_ch[0]="星期日";
weekday_ch[1]="星期一";
weekday_ch[2]="星期二";
weekday_ch[3]="星期三";
weekday_ch[4]="星期四";
weekday_ch[5]="星期五";
weekday_ch[6]="星期六";
var today = new Date();
today.setFullYear(2021
);
today.setMonth(3);
today.setDate(07
);
today.setHours(17
);
today.setMinutes(25
);
today.setSeconds(09
);
var timestamp = today.getTime();
/* 显示实时时间 */
runTime();
function runTime() {
setTimeout(runTime, 1000);
timestamp = timestamp + 1000;
today.setTime(timestamp);
showTime();
}
function showTime() {
var year, month, date, hour, minute, second, day;
year = today.getFullYear();
month = today.getMonth() + 1;
date = today.getDate();
hour = today.getHours();
minute = today.getMinutes();
second = today.getSeconds();
day = today.getDay();
if (month < 10) { month = "0" + month;}
if (date < 10) { date = "0" + date;}
if (hour < 10) { hour = "0" + hour;}
if (minute < 10) { minute = "0" + minute;}
if (second < 10) { second = "0" + second;}
if (/[\u4E00-\u9FA5]/i.test($("#ecu_title").html())) {
$('#ecu_time').html(year + "年" + month + "月" + date + "日 " + hour + ":" + minute + ":" + second + "<br>" + weekday_ch[day]);
}
else {
$('#ecu_time').html(year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second + "<br>" + weekday_en[day]);
}
}
</script>
</div>
</div>
</article>
</div>
</section>
<footer class="footer">&copy; 2015 Altenergy Power System Inc.</footer>
<script>
/* 指定5分钟刷新一次 */
function myrefresh() {
window.location.reload();
}
setTimeout('myrefresh()',300000);
/* 切换语言 */
$(".chlang").click(function(){
$.ajax({
url : "http://192.168.1.105/index.php/management/set_language",
type : "post",
dataType : "json",
data: "language=" + $(this).attr("id"),
})
setTimeout("location.reload();",500);//刷新页面
});
</script>
</body>
</html>


Merci d'avance
dominiquebelge
 
Messages : 5
Inscription : 29 Mars 2021

Re: Information AP Systems

Messagepar merguez07 » 21 Avr 2021 10:34

non je ne tire rien de la page web

et si tu testais :
'http://'.IP_APSYSTEM.'/index.php/realtimedata/old_power_graph?date=' . date('Y-m-d') . '&period=weekly';
tuto 1 -->Programmation des scripts Eedomus
tuto 2 -->SmartDevice
tuto 3 -->Le déclenchement de règles
scripts -->Météo du jour | GH Thermostat | TotalWatt | Detecfire | smartbattery
Skype Eedomus -->lien vers le skype Eedomus
merguez07
 
Messages : 2346
Inscription : 15 Sep 2017
Localisation : Le Teil en Ardèche

Re: Information AP Systems

Messagepar merguez07 » 21 Avr 2021 13:28

je te fais une proposition de script

Code : Tout sélectionner
<?

$adressOption = getArg('adress');

$url_energy = 'http://'.$adressOption.'/index.php/realtimedata/old_energy_graph?';
$url_power  = 'http://'.$adressOption.'/index.php/realtimedata/old_power_graph?';

$json   = httpQuery($url_energy);
$result = sdk_json_decode($json);
$energy = $result['energy'][count($result['energy'])-1]['energy'];
$json   = httpQuery($url_power);
$result = sdk_json_decode($json);
$power = $result['power'][count($result['power'])-1]['each_system_power'];

$xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
$xml .= "<APSYSTEMS>\n";
$xml .= "<ENERGY>" . $energy . "</ENERGY>\n";
$xml .= "<POWER>" . $power . "</POWER>\n";
$xml .= "</APSYSTEMS>"; 
sdk_header('text/xml');
echo $xml;

?>
tuto 1 -->Programmation des scripts Eedomus
tuto 2 -->SmartDevice
tuto 3 -->Le déclenchement de règles
scripts -->Météo du jour | GH Thermostat | TotalWatt | Detecfire | smartbattery
Skype Eedomus -->lien vers le skype Eedomus
merguez07
 
Messages : 2346
Inscription : 15 Sep 2017
Localisation : Le Teil en Ardèche

Re: Information AP Systems

Messagepar dominiquebelge » 21 Avr 2021 15:07

Super, ca marche! Un grand merci, c'est super propre ;-)

Je vais regarder vos tutos, ça pourra m'aider pour les prochains essais!
dominiquebelge
 
Messages : 5
Inscription : 29 Mars 2021

Re: Information AP Systems

Messagepar merguez07 » 21 Avr 2021 15:44

dominiquebelge a écrit:Super, ca marche! Un grand merci, c'est super propre


:P :P :P :thumbup:
tuto 1 -->Programmation des scripts Eedomus
tuto 2 -->SmartDevice
tuto 3 -->Le déclenchement de règles
scripts -->Météo du jour | GH Thermostat | TotalWatt | Detecfire | smartbattery
Skype Eedomus -->lien vers le skype Eedomus
merguez07
 
Messages : 2346
Inscription : 15 Sep 2017
Localisation : Le Teil en Ardèche

Re: Information AP Systems

Messagepar fred1964 » 23 Avr 2021 07:57

Bonjour, je possede un AP Systems seulement le plugiing ne fonctionne pas « erreur de valeur » je voulais savoir si vous aviez une passerelle ECU-R ou ECU-C ?

On est bien d’accord que l’adresse IP est bien celle de l’ECU ?
fred1964
 
Messages : 84
Inscription : 09 Fév 2016

Re: Information AP Systems

Messagepar merguez07 » 23 Avr 2021 08:04

bonjour fred1964,

arrives tu à obtenir avec ton navigateur web des infos sur ton APsystem ?

si oui peux tu m'envoyer le lien de l'URL en MP
tuto 1 -->Programmation des scripts Eedomus
tuto 2 -->SmartDevice
tuto 3 -->Le déclenchement de règles
scripts -->Météo du jour | GH Thermostat | TotalWatt | Detecfire | smartbattery
Skype Eedomus -->lien vers le skype Eedomus
merguez07
 
Messages : 2346
Inscription : 15 Sep 2017
Localisation : Le Teil en Ardèche

Re: Information AP Systems

Messagepar fred1964 » 24 Avr 2021 06:55

Bonjour merguez07
Sur un navigateur, si je tape l’adresse IP de mon ECU-R (passerelle APsystems) rien ne se passe (connexion au serveur impossible))
fred1964
 
Messages : 84
Inscription : 09 Fév 2016

Re: Information AP Systems

Messagepar merguez07 » 24 Avr 2021 07:40

fred1964 a écrit:Sur un navigateur, si je tape l’adresse IP de mon ECU-R (passerelle APsystems) rien ne se passe (connexion au serveur impossible))


Il y a un truc que je pige pas. Que ce soit ECU-R ou ECU-C tu devrais pouvoir avoir les données fournies par tes micro-onduleurs. Est ce que tu les as avec leur application pour téléphone mobile ?
t'es tu inscrit auprès d'APsystem à miribel https://forum-photovoltaique.fr/viewtopic.php?t=40113
tuto 1 -->Programmation des scripts Eedomus
tuto 2 -->SmartDevice
tuto 3 -->Le déclenchement de règles
scripts -->Météo du jour | GH Thermostat | TotalWatt | Detecfire | smartbattery
Skype Eedomus -->lien vers le skype Eedomus
merguez07
 
Messages : 2346
Inscription : 15 Sep 2017
Localisation : Le Teil en Ardèche

Re: Information AP Systems

Messagepar fred1964 » 24 Avr 2021 11:34

J’arrive à me connecter en wifi avec l’appli ÉCU APP et je peux donc paramétrer ma passerelle.

J’ai bien un compte chez APS, mon système est bien connecté et je peux voir ma production sur leur site et aussi sur l’appli EMA APP

Pour le reste impossible de me connecter à l’ecu-R en tapant l’adresse IP de la passerelle.

Pour info la passerelle est paramètrée en DHCP

Faut il avoir un accès spécial ?
fred1964
 
Messages : 84
Inscription : 09 Fév 2016

Re: Information AP Systems

Messagepar merguez07 » 24 Avr 2021 12:01

fred1964 a écrit:Faut il avoir un accès spécial ?


tu as bien une clé API ?
tuto 1 -->Programmation des scripts Eedomus
tuto 2 -->SmartDevice
tuto 3 -->Le déclenchement de règles
scripts -->Météo du jour | GH Thermostat | TotalWatt | Detecfire | smartbattery
Skype Eedomus -->lien vers le skype Eedomus
merguez07
 
Messages : 2346
Inscription : 15 Sep 2017
Localisation : Le Teil en Ardèche

Suivant

Retour vers Scripts & Périphériques du store

Qui est en ligne ?

Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 9 invité(s)