How to get domoticz data to ESP8266??

Everything about esp8266 and more.

Moderator: leecollings

Post Reply
DickN
Posts: 8
Joined: Monday 06 March 2017 19:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

How to get domoticz data to ESP8266??

Post 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
kimot
Posts: 104
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: How to get domoticz data to ESP8266??

Post 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/
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
DickN
Posts: 8
Joined: Monday 06 March 2017 19:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: How to get domoticz data to ESP8266??

Post 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
kimot
Posts: 104
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: How to get domoticz data to ESP8266??

Post 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 !");
  }
}
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: How to get domoticz data to ESP8266??

Post 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).
kimot
Posts: 104
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: How to get domoticz data to ESP8266??

Post 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 !!!
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
DickN
Posts: 8
Joined: Monday 06 March 2017 19:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: How to get domoticz data to ESP8266??

Post by DickN »

kimot wrote: Sunday 17 March 2019 22:08 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 !!!
Yes!!! :D :D :D
This is what I mean.
I Tested it and it works perfect

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests