<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 11.00.9600.18098">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Zufällig habe ich dieses Projekt hier 
gefunden:</FONT></DIV>
<DIV><FONT size=2 face=Arial><A 
href="http://www.esp8266.nu/index.php/Main_Page">http://www.esp8266.nu/index.php/Main_Page</A></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Dort wird über ein ESP-WIFI-Modul Daten an 
verschiedene Heimautomatisierungs-Software geschickt.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Vorteil ist, das die Interfaces über eine 
Weboberfläche programmiert werden können, also nicht jedes mal wenns ein 
zusätzlicher Sensor ist oder sich die IP ändert wieder Änderungen am Code nötig 
sind.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Ich denke das wäre ein sehr einfacher Weg, Sensoren 
für VZ zu realisieren ?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Platinen gibts z.B. hier für 7 €:</FONT></DIV>
<DIV><FONT size=2 face=Arial><A 
href="http://www.ebay.de/itm/WIFI-ESP8266-Seriell-Dev-Modul-Drahtlos-Test-Board-Full-IO-Leads-ESP-12-TE301/311484720899?_trksid=p2047675.c100011.m1850&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D20140107083420%26meid%3D1d203b50fed94739822dba52b6ed0b3e%26pid%3D100011%26rk%3D1%26rkt%3D10%26sd%3D201464921200&tfrom=201464921200&tpos=unknow&ttype=price&talgo=origal">http://www.ebay.de/itm/WIFI-ESP8266-Seriell-Dev-Modul-Drahtlos-Test-Board-Full-IO-Leads-ESP-12-TE301/311484720899?_trksid=p2047675.c100011.m1850&_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D20140107083420%26meid%3D1d203b50fed94739822dba52b6ed0b3e%26pid%3D100011%26rk%3D1%26rkt%3D10%26sd%3D201464921200&tfrom=201464921200&tpos=unknow&ttype=price&talgo=origal</A></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Leider unterstützt die Software momentan nur 
verschiedene vorgegeben Heimautomatisierungs-Zentralen oder 
ThingSpeak</FONT></DIV>
<DIV><FONT size=2 face=Arial><A 
href="http://www.esp8266.nu/index.php/EasyProtocols">http://www.esp8266.nu/index.php/EasyProtocols</A></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Es müsste ein rel. einfaches sein, die Software so 
zu ändern, das sie auch in VZ loggt ?</FONT></DIV>
<DIV><FONT size=2 face=Arial>Mir fehlen aber leider die detailierten 
Arduino-Programmierkenntnisse, um das zu ändern.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Als, falls jemand Lust hat ?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Viele Grüße</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Klaus</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Hier noch ein Beispiel wie Daten momentan geschickt 
werden:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV>//#######################################################################################################<BR>//########################### 
Controller Plugin 001: Domoticz HTTP 
######################################<BR>//#######################################################################################################<BR><BR>#define 
CPLUGIN_001<BR>#define CPLUGIN_ID_001        
 1<BR>#define CPLUGIN_NAME_001       "Domoticz 
HTTP"<BR><BR>boolean CPlugin_001(byte function, struct EventStruct 
*event)<BR>{<BR>  boolean success = false;<BR><BR>  switch 
(function)<BR>  {<BR>    case CPLUGIN_PROTOCOL_ADD:<BR>  
    {<BR>        Protocol[++protocolCount].Number 
= CPLUGIN_ID_001;<BR>        
strcpy_P(Protocol[protocolCount].Name, PSTR(CPLUGIN_NAME_001));<BR>    
    Protocol[protocolCount].usesMQTT = false;<BR>      
  Protocol[protocolCount].usesAccount = false;<BR>      
  Protocol[protocolCount].usesPassword = false;<BR>      
  break;<BR>      }<BR><BR>    case 
CPLUGIN_PROTOCOL_SEND:<BR>      {<BR>        
char log[80];<BR>        boolean success = false;<BR>  
      char host[20];<BR>        
sprintf_P(host, PSTR("%u.%u.%u.%u"), Settings.Controller_IP[0], 
Settings.Controller_IP[1], Settings.Controller_IP[2], 
Settings.Controller_IP[3]);<BR><BR>        sprintf_P(log, 
PSTR("%s%s"), "HTTP : connecting to ", host);<BR>        
addLog(LOG_LEVEL_DEBUG, log);<BR>        if 
(printToWeb)<BR>        {<BR>        
  printWebString += log;<BR>          
printWebString += "<BR>";<BR>        }<BR>  
      // Use WiFiClient class to create TCP connections<BR>  
      WiFiClient client;<BR>        if 
(!client.connect(host, Settings.ControllerPort))<BR>        
{<BR>          connectionFailures++;<BR>    
      strcpy_P(log, PSTR("HTTP : connection failed"));<BR>  
        addLog(LOG_LEVEL_ERROR, log);<BR>    
      if (printToWeb)<BR>          
  printWebString += F("connection failed<BR>");<BR>    
      return false;<BR>        }<BR>  
      if (connectionFailures)<BR>        
  connectionFailures--;<BR><BR>        // We now create 
a URI for the request<BR>        String url = 
F("/json.htm?type=command&param=udevice&idx=");<BR>      
  url += event->idx;<BR><BR>        switch 
(event->sensorType)<BR>        {<BR>      
    case SENSOR_TYPE_SINGLE:            
          // single value sensor, used for Dallas, 
BH1750, etc<BR>            url += 
F("&svalue=");<BR>            url += 
UserVar[event->BaseVarIndex];<BR>            
break;<BR>          case SENSOR_TYPE_TEMP_HUM:  
                    // temp + 
hum + hum_stat, used for DHT11<BR>            url 
+= F("&svalue=");<BR>            url += 
UserVar[event->BaseVarIndex];<BR>            
url += ";";<BR>            url += 
UserVar[event->BaseVarIndex + 1];<BR>          
  url += ";0";<BR>            
break;<BR>          case SENSOR_TYPE_TEMP_BARO:  
                    // temp + 
hum + hum_stat + bar + bar_fore, used for BMP085<BR>        
    url += F("&svalue=");<BR>          
  url += UserVar[event->BaseVarIndex];<BR>        
    url += ";0;0;";<BR>            url 
+= UserVar[event->BaseVarIndex + 1];<BR>          
  url += ";0";<BR>            
break;<BR>          case SENSOR_TYPE_SWITCH:<BR>  
          url = 
F("/json.htm?type=command&param=switchlight&idx=");<BR>    
        url += event->idx;<BR>        
    url += F("&switchcmd=");<BR>          
  if (UserVar[event->BaseVarIndex] == 0)<BR>        
      url += "Off";<BR>            
else<BR>              url += "On";<BR>  
          break;<BR>          
case SENSOR_TYPE_DIMMER:<BR>            url = 
F("/json.htm?type=command&param=switchlight&idx=");<BR>    
        url += event->idx;<BR>        
    url += F("&switchcmd=");<BR>          
  if (UserVar[event->BaseVarIndex] == 0)<BR>        
      url += "Off";<BR>            
else<BR>            {<BR>      
        url += F("Set%20Level&level=");<BR>    
          url += 
UserVar[event->BaseVarIndex];<BR>            
}<BR>            break;<BR>      
  }<BR><BR>        url.toCharArray(log, 80);<BR>  
      addLog(LOG_LEVEL_DEBUG_MORE, log);<BR>      
  if (printToWeb)<BR>        {<BR>      
    printWebString += log;<BR>          
printWebString += "<BR>";<BR>        }<BR><BR>  
      // This will send the request to the server<BR>  
      client.print(String("GET ") + url + " HTTP/1.1\r\n" 
+<BR>                    
 "Host: " + host + "\r\n" +<BR>            
         "Connection: close\r\n\r\n");<BR><BR>  
      unsigned long timer = millis() + 200;<BR>    
    while (!client.available() && millis() < 
timer)<BR>          delay(1);<BR><BR>    
    // Read all the lines of the reply from server and print them to 
Serial<BR>        while (client.available()) {<BR>  
        String line = 
client.readStringUntil('\n');<BR>          
line.toCharArray(log, 80);<BR>          
addLog(LOG_LEVEL_DEBUG_MORE, log);<BR>          if 
(line.substring(0, 15) == "HTTP/1.1 200 OK")<BR>        
  {<BR>            strcpy_P(log, PSTR("HTTP : 
Succes!"));<BR>            addLog(LOG_LEVEL_DEBUG, 
log);<BR>            if (printToWeb)<BR>  
            printWebString += 
F("Success<BR>");<BR>            success = 
true;<BR>          }<BR>        
  delay(1);<BR>        }<BR>        
strcpy_P(log, PSTR("HTTP : closing connection"));<BR>        
addLog(LOG_LEVEL_DEBUG, log);<BR>        if 
(printToWeb)<BR>          printWebString += F("closing 
connection<BR>");<BR><BR>        
client.flush();<BR>        client.stop();<BR><BR>  
      break;<BR>      }<BR><BR>  }<BR>  
return success;<BR>}<BR><BR>boolean Domoticz_getData(int idx, float 
*data)<BR>{<BR>  boolean success = false;<BR>  char 
host[20];<BR>  sprintf_P(host, PSTR("%u.%u.%u.%u"), 
Settings.Controller_IP[0], Settings.Controller_IP[1], Settings.Controller_IP[2], 
Settings.Controller_IP[3]);<BR><BR>  // Use WiFiClient class to create TCP 
connections<BR>  WiFiClient client;<BR>  if (!client.connect(host, 
Settings.ControllerPort))<BR>  {<BR>    
connectionFailures++;<BR>    return false;<BR>  }<BR>  if 
(connectionFailures)<BR>    connectionFailures--;<BR><BR>  // We 
now create a URI for the request<BR>  String url = 
F("/json.htm?type=devices&rid=");<BR>  url += idx;<BR><BR>  // 
This will send the request to the server<BR>  client.print(String("GET ") + 
url + " HTTP/1.1\r\n" +<BR>              
 "Host: " + host + "\r\n" +<BR>            
   "Connection: close\r\n\r\n");<BR><BR>  unsigned long timer = 
millis() + 200;<BR>  while (!client.available() && millis() < 
timer)<BR>    delay(1);<BR><BR>  // Read all the lines of the 
reply from server and print them to Serial<BR><BR>  while 
(client.available()) {<BR>    String line = 
client.readStringUntil('\n');<BR>    if (line.substring(10, 14) == 
"Data")<BR>    {<BR>      String strValue = 
line.substring(19);<BR>      byte pos = strValue.indexOf(' 
');<BR>      strValue = strValue.substring(0, pos);<BR>  
    strValue.trim();<BR>      float value = 
strValue.toFloat();<BR>      *data = value;<BR>    
  success = true;<BR>    }<BR>  }<BR>  return 
success;<BR>}<BR></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV></BODY></HTML>