Page 1 of 1
How to get domoticz data to ESP8266??
Posted: Saturday 16 March 2019 15:40
by DickN
Hello all,
I like to have a wireless display connected to domoticz.
I have an ESP-1 and a LCD-ic2 display
Are there posibilities in Domoticz to send data to an ESP8266 and display some info like the state of the Domoticz Security Panel or the Temperature?
If there is allready a Topic can you give me the link?
Thanks
Re: How to get domoticz data to ESP8266??
Posted: Saturday 16 March 2019 15:52
by kimot
I suggest ESPeasy firmware for ESP8266.
Or if you want program something yourself-here is examples for data exchange Domoticz - ESP8266:
https://diyprojects.io/esp8266-web-clie ... -api-json/
https://diyprojects.io/driving-gpio-esp ... -wireless/
Re: How to get domoticz data to ESP8266??
Posted: Saturday 16 March 2019 16:42
by DickN
Thanks for the info.
These examples shows sending data form ESP to Domoticz.
I want to receive data from Domoticz to show on a LCD display connected to ESP-01
Re: How to get domoticz data to ESP8266??
Posted: Saturday 16 March 2019 21:02
by kimot
No second example shows how receive HTTP call FROM Domoticz and parse parameters for your usage.
You call
Code: Select all
http://IP_ESP8266/gpio?id=D1&etat=1&token=123abCde
from Domoticz
( IP_ESP8266 is your ESP address )
The example show you how to parse "id", "etat" and "token" values.
In this example for pin number, its status and password, but you can use text for your display instead off or any other stuff.
Code: Select all
void updateGpio(){
Serial.println("Update GPIO command from DOMOTICZ : ");
for ( int i = 0 ; i < server.args(); i++ ) {
Serial.print(server.argName(i)); Serial.println(server.arg(i));
}
String gpio = server.arg("id");
String token = server.arg("token");
if ( token != "123abCde" ) {
Serial.println("Not authentified ");
return;
}
int etat = server.arg("etat").toInt();
int pin = D1;
if ( gpio == "D1" ) {
pin = D1;
} else if ( gpio == "D7" ) {
pin = D7;
} else if ( gpio == "D8" ) {
pin = D8;
} else {
pin = D1;
}
Serial.print("Update GPIO "); Serial.println(pin);
if ( etat == 1 ) {
digitalWrite(pin, HIGH);
Serial.println("GPIO updated : On");
} else if ( etat == 0 ) {
digitalWrite(pin, LOW);
Serial.println("GPIO updated : Off");
} else {
Serial.println("Bad Led Value !");
}
}
Re: How to get domoticz data to ESP8266??
Posted: Sunday 17 March 2019 18:43
by MikeF
A while ago I developed a remote display unit (via WiFi) taking data from Domoticz, using a separate Raspberry Pi (not an ESP8266) and a 20x4 i2c LCD, with code written in Python - see link:
https://www.domoticz.com/forum/viewtopi ... 7&start=38
- don't know if this helps (or is transferable to ESP8266).
Re: How to get domoticz data to ESP8266??
Posted: Sunday 17 March 2019 22:08
by kimot
Like I wrote before - with ESPeasy very easy task:
https://www.letscontrolit.com/wiki/index.php/LCDDisplay
So simply send:
http://<espeasyip>/control?cmd=LCD,<row>,<col>,<text>
http://<espeasyip>/control?cmd=LCD,1,1,Hallo !!!
Re: How to get domoticz data to ESP8266??
Posted: Monday 18 March 2019 21:59
by DickN
Yes!!!
This is what I mean.
I Tested it and it works perfect
Thanks