Relecture du sujet : Luxmetre
Re: Luxmetre
Citer Titof2375
Message par Titof2375 » 14 avr. 2018, 18:53
moi je n'est rien trouve
Bonjour Titof2375,
Peux tu être plus explicite??? s'il te plait car je ne comprends pas ta réponse.
Luxmetre
Re: Luxmetre
Raspberry PI3/Raspbian stresk+RFXcomE pour volets Somfy+contacts sec Sonoff pour les ouvertures+RFLink+Trust ABST 604+Basic Sonoff pour lumières et ballon d'eau chaude+Compteur conso électrique OWL Micro+CM180 gestion+Station Orégon WMR 200 compléte.
-
mike913
- Messages : 159
- Inscription : 18 oct. 2014, 10:22
- Localisation : Morsang / Orge - Essonne
- Contact :
Re: Luxmetre
Bonjour,
Personnellement j'utilise l'IDE Arduino pour programmer mes esp. Voici mon programme à flasher sur l' ESP.
Il suffit de l' adapter pour qu'il envoie les données à domoticz en remplaçant les lignes:
par String url = "/json.htm?type=command¶m=udevice&idx=12&nvalue=0&svalue=";
plus d'explication sur le site: https://diyprojects.io/driving-gpio-esp ... m_Domoticz
Cordialement
Effectivement comme je n'utilise pas ESPEasy je ne savais pas qu'il n' était pas encore pris en compte par ESPEasy.Starbird a écrit :Bonjour,
j'ai commandé et reçu ce jour un VEML 7700 mais il n’envoie aucune information a Domoticz et d’ailleurs quand je vais sur le ESPEasy du Wemos D1 Devices est a 0 LUX.
Je ne peux que programme dans l'ESPEasy du Wemos D1 la device du BH1750 ou TLS 2561 quelqu'un peu-t’il m’indique comment faire?
D’ailleurs y a t'il une solution?
Merci.
Personnellement j'utilise l'IDE Arduino pour programmer mes esp. Voici mon programme à flasher sur l' ESP.
Code : Tout sélectionner
/*
LuxUV-2011
date 24/03/2018 Version 2.011
*/
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <VEML7700.h>
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Machine et script
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
String dest = "adresse IP du destinataire";
char Nom[] = "Lumière Ext";
const char* host = "Lolin-07";
char script[] = "LuxUV-2.011";
char sondes[] = "UVLux";
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Paramètres WIFI
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
const char* ssid = "SSID;
const char* password = "Pass Phrase";
HTTPClient http;
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Timers
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
unsigned long CurrentMillis = 0; // Millisseconde courante
unsigned long NextMillis = 0; // Millisseconde courante
#define INTERVAL 60000 ; // 60 secondes
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Config Sondes VEML
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
VEML7700 als;
float lux = 0;
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// PIN Analogique Sonde UV
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
int GUVAPin = A0; //Output from the sensor
int analogValue = 0;
float UV = 0;
int count = 0;
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// SETUP
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void setup()
{
Serial.begin(115200);
delay(10);
// WiFi.mode ( WIFI_STA );
WiFi.begin(ssid, password);
Serial.println ( "" );
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
// on affiche l'adresse IP qui nous a ete attribuee
Serial.println("");
Serial.print("Machine: ");
Serial.print(host);
Serial.print("\t");
Serial.println(WiFi.localIP());
/* envoie des données de démarrage */
String url = dest;
url += "/esp/php/start.php?Host=";
url += host;
url += "&Sondes=";
url += sondes;
url += "&Script=";
url += script;
url += "&Nom=";
url += Nom;
Serial.println(url);
http.begin(url);
http.addHeader("Content-Type", "text/html");
int httpCode = http.GET();
Serial.println(httpCode);
if (httpCode == HTTP_CODE_OK)
{
Serial.print("HTTP response code ");
Serial.println(httpCode);
String response = http.getString();
Serial.println(response);
}
http.end();
/* ICI Configurer les capteurs */
als.begin();
als.setIntegrationTime(VEML7700::ALS_INTEGRATION_50ms);
delay(1000);
NextMillis = millis();
}
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Boucle principale
// Cette boucle s'exécute à l'infini
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void loop()
{
CurrentMillis = millis() ;
if (CurrentMillis > NextMillis)
{
int analogValue = analogRead(GUVAPin);
float val = 0.05 * analogValue-1;
if ( val < 0 )
{
val = 0;
}
UV = val;
als.setPower(0);
als.setPower(0);
als.setGain(VEML7700::ALS_GAIN_d8);
als.setPower(1);
als.sampleDelay();
als.getALSLux(lux);
delay(500);
// envoie des données
String url = dest;
url += "/esp/php/logs.php?Host=";
url += host;
url += "&Sondes=";
url += sondes;
url += "&Lux=";
url += lux;
url += "&UV=";
url += UV * coef;
url += "&Analog=";
url += analogValue;
Serial.println(url);
http.begin(url);
http.addHeader("Content-Type", "text/html");
int httpCode = http.GET();
/* Serial.println(httpCode);
if (httpCode == HTTP_CODE_OK)
{
Serial.print("HTTP response code ");
Serial.println(httpCode);
String response = http.getString();
Serial.println(response);
} */
http.end();
NextMillis = CurrentMillis + INTERVAL ;
}
}
Code : Tout sélectionner
String url = dest;
url += "/esp/php/logs.php?Host=";
plus d'explication sur le site: https://diyprojects.io/driving-gpio-esp ... m_Domoticz
Cordialement
DS718+ 2 x 3To(SHR) - Firmware: DSM 7.0.1-42218
DS712+ 2 x 4To (SHR) - Firmware: DSM 6.2.4-25556
Raspberry - RFXTRX433 - Aeon Labs ZStick V2 - Domoticz
FreeBox Delta
https://meteo.folcke.net
https://wiki.folcke.net
DS712+ 2 x 4To (SHR) - Firmware: DSM 6.2.4-25556
Raspberry - RFXTRX433 - Aeon Labs ZStick V2 - Domoticz
FreeBox Delta
https://meteo.folcke.net
https://wiki.folcke.net
Re: Luxmetre
Ce n'est pas plus facile avec espeasy ? On peut aisément utiliser divers capteurs de toute sorte et notamment les luxmètres.
Domoticz Stable V4.9700 sur Synology DSM 6.2 / 2 x RFlink V48.4 - 433.92MHz(Dio/Chacon) & 433.42MHz(RTS) / Script en LUA & Blocky
-
mike913
- Messages : 159
- Inscription : 18 oct. 2014, 10:22
- Localisation : Morsang / Orge - Essonne
- Contact :
Re: Luxmetre
Non, avec le VEML7700 on ne peux pas utiliser ESPEasy, car pour l'instant il ne gère pas ce capteur.
DS718+ 2 x 3To(SHR) - Firmware: DSM 7.0.1-42218
DS712+ 2 x 4To (SHR) - Firmware: DSM 6.2.4-25556
Raspberry - RFXTRX433 - Aeon Labs ZStick V2 - Domoticz
FreeBox Delta
https://meteo.folcke.net
https://wiki.folcke.net
DS712+ 2 x 4To (SHR) - Firmware: DSM 6.2.4-25556
Raspberry - RFXTRX433 - Aeon Labs ZStick V2 - Domoticz
FreeBox Delta
https://meteo.folcke.net
https://wiki.folcke.net
Re: Luxmetre
je n'est rien trouve sur le VEML 7700.Starbird a écrit :Relecture du sujet : Luxmetre
Re: Luxmetre
Citer Titof2375
Message par Titof2375 » 14 avr. 2018, 18:53
moi je n'est rien trouve
Bonjour Titof2375,
Peux tu être plus explicite??? s'il te plait car je ne comprends pas ta réponse.
-
mike913
- Messages : 159
- Inscription : 18 oct. 2014, 10:22
- Localisation : Morsang / Orge - Essonne
- Contact :
Re: Luxmetre
Bonjour
Voici quelques liens:
https://github.com/tedyapo/arduino-VEML7700
https://www.gotronic.fr/art-capteur-de- ... -26821.htm
https://www.dfrobot.com/wiki/index.php/ ... U:_SEN0228
Voici quelques liens:
https://github.com/tedyapo/arduino-VEML7700
https://www.gotronic.fr/art-capteur-de- ... -26821.htm
https://www.dfrobot.com/wiki/index.php/ ... U:_SEN0228
DS718+ 2 x 3To(SHR) - Firmware: DSM 7.0.1-42218
DS712+ 2 x 4To (SHR) - Firmware: DSM 6.2.4-25556
Raspberry - RFXTRX433 - Aeon Labs ZStick V2 - Domoticz
FreeBox Delta
https://meteo.folcke.net
https://wiki.folcke.net
DS712+ 2 x 4To (SHR) - Firmware: DSM 6.2.4-25556
Raspberry - RFXTRX433 - Aeon Labs ZStick V2 - Domoticz
FreeBox Delta
https://meteo.folcke.net
https://wiki.folcke.net