Giter Site home page Giter Site logo

spikharpax / avatar-plugin-eedomus Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 12.76 MB

eeDomus, Gestion des périphériques, mode Plan, Widgets et Règles vocales

JavaScript 84.10% CSS 6.72% HTML 9.18%
avatar domotique eedomus home-assistant home-automation mode-plan

avatar-plugin-eedomus's People

Watchers

 avatar  avatar

avatar-plugin-eedomus's Issues

aide au plugin

Bonjour stephane, j'espere tu vas bien?
s'il te plait un aide pour ton plugin eedomus et un autre plugin, j ai un peux modifier le plugin eedomus, parceque avec ton plugin eeDomus il y avait plusieurs action pour une seule fonction, donc j ai modifier et creer plusieur fonctions pour chaque action, le plugin fonctionne tres bien avec toute les commandes, le probleme et le suivant
j ai creer un plugin scenariochambre j ai la lampe ne s allume pas
info: scénario From: Salon
info: Intent scenariochambre, Syntax: true
info: Action scenariochambre
info: scenariochambre from: Salon To: Salon
info: voici ton scenario
info: Remote play with callback
info: call(scenariochambre) in 47ms
info: eeDomus command: lampLight From: Salon
error: eeDomus Les valeurs pour realiser l'action sont manquantes.
info: Remote speak with callback
info: call(eeDomus) in 31ms
info: Remote speak with callback
voila le code :
Avatar.call('eeDomus',{client:data.client,command:'lampLight',value:'100'},function(){});

autre probleme , moi je suis debutant pour le moment je ne connais pas gand chose au cron, j ai le plugin scenariochambre qui ne se lance pas, j'ai un peux compris que j ai pas preciser quel piece
"cron": {
"scenariochambre": {
"name": "scenariochambre",
"time": "* 7 * * *"
}
}
}
voila l'erreur:
info: Cron: scenariochambre
info: Reloading: scenariochambre
error: Caught exception: TypeError: Cannot read property 'room' of undefined at setClient (C:/Avatar/resources/core/plugins/scenariochambre/scenariochambre.js:123:21) at Object.exports.cron (C:/Avatar/resources/core/plugins/scenariochambre/scenariochambre.js:3:18) at CronJob.onTick (C:\Avatar\resources\core\manager\cron.js:28:28) at callbackWrapper (C:\Avatar\resources\core\node_modules\cron\lib\cron.js:427:24)
info: Cron: scenariz
info: scenariz cron current room by sensor Salon
voici les liens des 2 plugins:
https://drive.google.com/drive/folders/1q9aSAh3JQDo93ARvO460Puq1N7nrZoow?usp=sharing

https://drive.google.com/drive/folders/1ReYmws1Q_QrmHYWzN2sRgNCZ5LgXo1z1?usp=sharing

merci d'avance pour ton precieux aide, passe un bon weekend

eedomus

stephane dabord je te fait mes excuses c estait pas mon intention de fermer le post,
c est fait stephane pour lightcolor ca fonctionne trés bien j ai modifier les valeur de ma box sur le fichier propriter par ce que tu a met,
"lightColor":{
"command" : "set",
"0,0,0,100" : ["(color|light) * warm white","light * white hot"],
"60,100,0,0" : ["(color|light) * apple green"],
"100,0,0,0" : ["(color|light) * red"],
"0,100,100,0" : ["(color|light) * cyan color"],
"0,0,100,0" : ["(color|light) * blue"],
"100,0,100,0" : ["(color|light) * magenta"],
"100,30,0,0" : ["(color|light) * orange"],
"100,100,0,0" : ["(color|light) * yellow"]
},
apres modification ca fonctionne
"lightColor":{
"command" : "set",
"100,100,100" : ["(color|light) * warm white","light * white hot"],
"0,100,0" : ["(color|light) * apple green"],
"100,0,0" : ["(color|light) * red"],
"0,25,100" : ["(color|light) * cyan color"],
"0,0,100" : ["(color|light) * blue"],
"100,0,100" : ["(color|light) * magenta"],
"100,50,0" : ["(color|light) * orange"],
"40,100,11" : ["(color|light) * yellow"]
},

je ne comprend pas pourquoi depuis plusieur mois je n ai pas fait attention aux valeurs dans le fichier .prop
mais j ais toujours le lightDimmer qui ne fonctionne pas , pourtant tu as met le bon valeur
0 = pour eteint et 100= pour allumer
stephane pas besoin de faire un console.log puisque on l a deja sur l interface du serveur
merci encore pour ton aide stephane bon dimanche

aide au plugin

bonjour stephane,
je sais, ca n a pas de rapport avec le plugin eedomus mais il n a y a un autre forum ou te demander de l aide
j ai creer un plugin pour scraper avec cette url c est fonctionnel:
http://alerte.vigilance-meteo.fr/getwarning_fr.php?plz=93100&uwz=UWZ-FR&lang=fr';

enfaite je veux un plugin ou chacun met son departement
j ai rajouter ca dans le fichier js:
if (!config.num_departement){
console.log("numero non défini");
Avatar.speak('numéro département non renseigner')
callback();
}
var num_departement = config.num_departement;
console.log('dept :' + config.num_departement);

j ai cette erreur : info: Salon Client is connected
info: quels sont les alertes vigilance From: Salon
info: IntentVigilance tokens: true
info: Actionvigilance
error: call(vigilance) config is not defined
info: call(vigilance) in 6ms

fichier prop:
{
"modules" : {
"vigilance" : {
"description": "Avatar donne les vigilance intempérie ",
"version": "1.0",
"active" : true,
"num_departement" : "93100",
"rules" : ["vigilance"]
}
}
}

fichier js:
var Promise = require('q').Promise;

require('colors');

exports.action = function(data, callback){

    if (!config.num_departement){
    console.log("numero non défini");
     Avatar.speak('numéro département non renseigner')
     callback();

}
var num_departement = config.num_departement;
console.log('dept :' + config.num_departement);

info("Alerte vigilance from:", data.client);
var url = 'http://alerte.vigilance-meteo.fr/getwarning_fr.php?plz='+num_departement+'&uwz=UWZ-FR&lang=fr';
http_request(url)
.then(body => scraper(body))
.then(function(vigilance) { 
	Avatar.speak("voici les vigilance:" + vigilance, data.client, function(){ 
		Avatar.Speech.end(data.client);
   });
})
.catch(function(err) {
	Avatar.speak(err, data.client, function(){ 
		Avatar.Speech.end(data.client);
   });
});

    callback();

}

function scraper(body) {

return new Promise(function (resolve, reject) { 
	var $ = require('cheerio').load(body, { xmlMode: true, ignoreWhitespace: false, lowerCaseTags: false });
    console.log(vigilance)
    var vigilance = $("#content h1:nth-child(2)").first().text()+ " : "+$('#content p:nth-child(3)').first().text();
	
	if (!vigilance) {
		return reject('Désolé je n\'arrive pas accédé au site');
	}
	
	resolve (vigilance);
});

}

function http_request (url) {

return new Promise(function (resolve, reject) {
	
	var request = require('request');
	request({ 'uri' : url}, function (err, response, body) {
	
		if (err || response.statusCode != 200) {
		  return reject ('Désolé je n\'arrive pas accédé au site');
		}

		resolve(body);
	});
	
});

}
merci pour tout ton aide

aide au plugin(boucle)

salut stephane;
un aide stp pour une boucle
cette boucle je sais faire : for(var a=0;a<6;a++){
}
mais ce n est pas la bonne boucle
en faite je veux comme l exemple en dessous pour que avatar me dise comme ca:
fajr a 03:41 ensuite chourouk a 05:47 ect.....

Fajr Chourouk Dhohr Asr Maghreb Icha
03:41 05:47 13:50 18:07 21:56 23:48

stephane j ai fait recherche sur le net aussi video sur youtube pour les boucles do while et while mais je n ai pas reussi

var Promise = require('q').Promise;

require('colors');

exports.action = function(data, callback){

info("horaire de priere:", data.client);
var url = 'https://lemuslimpost.com/horaires-priere-paris-75.html';
http_request(url)
.then(body => scraper(body))
.then(function(priere) { 
	Avatar.speak("voici les horaires de priere du:" + priere, data.client, function(){ 
		Avatar.Speech.end(data.client);
   });
})
.catch(function(err) {
	Avatar.speak(err, data.client, function(){ 
		Avatar.Speech.end(data.client);
   });
});

callback();

}

function scraper(body) {

return new Promise(function (resolve, reject) {

var $ = require('cheerio').load(body, { xmlMode: true, ignoreWhitespace: false, lowerCaseTags: false });
var priere=""
for(var a=0;a<6;a++){
console.log(priere)
var priere=priere+$('#mvp-content-main table:nth-child(3) thead').first().text()+" : "+$('#mvp-content-main table:nth-child(3) tbody tr:nth-child(1) td:nth-child(1)').eq(a).text()+ " :a "+$('#mvp-content-main table:nth-child(3) tbody tr:nth-child(2) td:nth-child(1)').eq(a).text()+' : '

}
if (!priere) {
return reject('Désolé je ne peux pas accédé au site');
}

	resolve (priere);
});

}

function http_request (url) {

return new Promise(function (resolve, reject) {
	
	var request = require('request');
	request({ 'uri' : url}, function (err, response, body) {
	
		if (err || response.statusCode != 200) {
		  return reject ('Désolé je ne peux pas accédé au site');
		}

		resolve(body);
	});
	
});

}
merci encore stephane

probleme corriger allume/eteindre ampoule hue

bonjour stephane, j ai corriger le probleme pour allumage extinctions mes lumières hue, jai modifier dans le plugin eedomus sur le fichier proprieté "switchLight par "set" et aussi dans le fichier js(je pense pas necessaire sur le fichier js):
"lightDimmer" : {
"command" : "set",
"100" : ["turn on * light","light * light"],
"0" : ["turn off * light"]
},
il n y a plus d erreur: 'l'action EEDomus a échouée', avatar m allume et m eteindre correctement mes lumiere
stephe; - une mise a jour pour le plugin 'tvSchedule', il ne fonctionne plus
- un forum pour avatar est essensiel
bon noel et bon fete en famille

aide au plugin

bonjour stephane,
un aide stp pour ce plugin franchement j ai tout essayer pour la commande mais ca ne fonctionne toujours pas
a mon avis la commande c est l etat mais ca ne fonctionne pas
j ai toujour cette erreur :
info: vérifier la connexion internet From: Salon
info: IntentInternet tokens: true
info: Actioninternet
error: call(internet) Cannot read property 'yellow' of undefined
info: call(internet) in 5ms

fichier js:
exports.action = function(data, callback){

var tblCommand = {
internet: function() {internet(data, client)}
};

info("Internet command:", data.action.command.yellow, "From:", data.client.yellow);
tblCommanddata.action.command;
callback();

var url = 'http://www.google.fr/';
console.log(url);
var request = require('request');
request({ 'uri' : url }, function (err, response, body) {

var fs = require('fs');
fs.exists('./resources/core/plugins/internet/stat.txt', function (exists) {
var Statt = fs.createWriteStream('./resources/core/plugins/internet/stat.txt');
Statt.end();
});

var etat;
etat = fs.readFileSync("./resources/core/plugins/internet/stat.txt", "UTF-8");
console.log("Demande explicite contenu fichier stat.txt = "+etat);

if (err || response.statusCode != 200) {

if (etat != "NOK") {
fs.writeFileSync("./resources/core/plugins/internet/stat.txt", "NOK", "UTF-8");
return;
}

Avatar.speak(internet.etat + NOK + "pas de connexion internet", data.client, function (){
  Avatar.Speech.end(data.client);

});
callback();
}

else {
if (etat != "OK") {
fs.writeFileSync("./resources/core/plugins/internet/stat.txt", "OK", "UTF-8");
return;
}

Avatar.speak(internet.etat + OK + "la connexion fonctionne correctement", data.client, function (){
  Avatar.Speech.end(data.client);

});
callback();
}
});
}

aide

bonjour stephane,
un aide au plugin stp, c est bon j ai appris un peu
je n ai pas de retour vocal au plugin internet

fichier.js
var Promise = require('q').Promise;

require('colors');

exports.action = function(data, callback){

let client = setClient(data);

info("internet from:", data.client);
internet (data, client);

callback();

}

function internet (data, client) {

var url = 'http://www.google.fr/';
function http_request (url) {
return new Promise(function (resolve, reject) {
var request = require('request');
request({ 'uri' : url}, function (err, response, body) {

if (err || response.statusCode != 200) {
return reject ('Désolé je n'arrive pas accédé a l internet');
}
resolve(body);
});

});
}

var fs = require('fs');
fs.exists('./resources/core/plugins/internet/stat.txt', function (exists) {
var Statt = fs.createWriteStream('./resources/core/plugins/internet/stat.txt');
Statt.end();

});

var etat;
etat = fs.readFileSync("./resources/core/plugins/internet/stat.txt", "UTF-8");
console.log("Demande explicite contenu fichier stat.txt = "+etat);

if (etat != "NOK") {
fs.writeFileSync("./resources/core/plugins/internet/stat.txt", "NOK", "UTF-8");
return;
} else {
Avatar.speak(Config.modules.internet.etat+"pas de connexion internet:", data.client, function (){
Avatar.Speech.end(data.client);
});
return callback();
}

if (etat != "OK") {
fs.writeFileSync("./resources/core/plugins/internet/stat.txt", "OK", "UTF-8");
return;
} else {
Avatar.speak(Config.modules.internet.etat+"la connexion fonctionne correctement:", data.client, function (){
Avatar.Speech.end(data.client);
});
return callback();
}
}

function setClient (data) {

var client = data.client;

if (data.action.room)
client = (data.action.room != 'current') ? data.action.room : (Avatar.currentRoom) ? Avatar.currentRoom : Config.default.client;

if (data.action.setRoom)
client = data.action.setRoom;

  return client;

}
Cordialement

plugin eedomus

bonjour stephane j ai les commande allume/eteins les lumieres qui ne fonctionne pas, ca affiche dans la console " l'action eedomus a echouer" , aussi pour changer de couleur la commande passe mais aucun changement de couleur, il y a que la commande lightvariator fonctionne treés bien un aide stp cordialement

info: mets les lumières à 10 % From: Salon
info: IntentEEDomus syntax: true
info: ActionEEDomus action: set
info: eeDomus command: set From: Salon
info: Remote speak with callback
info: call(eeDomus) in 36ms
info: eeDomus periphID: 1433999 value: 10
info: eeDomus periphID: 1434007 value: 10
info: mets les lumières en bleu From: Salon
info: IntentEEDomus syntax: true
info: ActionEEDomus action: set
info: eeDomus command: set From: Salon
info: Remote speak with callback
info: call(eeDomus) in 47ms
info: eeDomus periphID: 1434000 value: 0,0,100,0
info: eeDomus periphID: 1434008 value: 0,0,100,0
info: éteins les lumières From: Salon
info: IntentEEDomus syntax: true
info: ActionEEDomus action: switchLight
info: eeDomus command: switchLight From: Salon
info: call(eeDomus) in 21ms
error: l'action EEDomus a échouée

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.