How to get domoticz data from ESP8266??

Everything about esp8266 and more.

Moderator: leecollings

Post Reply
ayasystems
Posts: 66
Joined: Tuesday 19 April 2016 23:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How to get domoticz data from ESP8266??

Post by ayasystems »

What is the best way to get domoticz data from ESP8266??

I don't know what is the best way to loop all devices from the JSON output in order to get the values...

I want to avoid do one call per device....

My idea is get themperature of two or three devices to show the data in one nextion display....

Regards!
NickHead
Posts: 83
Joined: Tuesday 29 October 2013 18:30
Target OS: Linux
Domoticz version:
Location: North East Coast of the UK
Contact:

Re: How to get domoticz data from ESP8266??

Post by NickHead »

Use MQTT. One transmitter to many receivers, does not load the system.

I use it in my Nextion Setup and have control over virtually everything .
A lot of stuff that is doing my head in.
djdehaan
Posts: 46
Joined: Thursday 11 June 2015 23:36
Target OS: Windows
Domoticz version: 2023.2
Location: Utrecht, NL
Contact:

Re: How to get domoticz data from ESP8266??

Post by djdehaan »

I use mySensors. ESP8266 programmed with Arduino IDE, easy to integrate in Domoticz.
NickHead
Posts: 83
Joined: Tuesday 29 October 2013 18:30
Target OS: Linux
Domoticz version:
Location: North East Coast of the UK
Contact:

Re: How to get domoticz data from ESP8266??

Post by NickHead »

This is what I have up to now.

Controlled by my Arduino Mega 2560 but I am now going over to a Raspberry Pi 3 as I am running out of memory.

https://youtu.be/kCHKv4FhWiQ
A lot of stuff that is doing my head in.
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: How to get domoticz data from ESP8266??

Post by Derik »

mmm
Perhaps espeasy?
http://www.letscontrolit.com/wiki/index.php/ESPEasy
Works stable with domoticz
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: How to get domoticz data from ESP8266??

Post by Derik »

NickHead wrote:This is what I have up to now.

Controlled by my Arduino Mega 2560 but I am now going over to a Raspberry Pi 3 as I am running out of memory.

https://youtu.be/kCHKv4FhWiQ
How did you make this?
Looking good..
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
ayasystems
Posts: 66
Joined: Tuesday 19 April 2016 23:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to get domoticz data from ESP8266??

Post by ayasystems »

Derik wrote:mmm
Perhaps espeasy?
http://www.letscontrolit.com/wiki/index.php/ESPEasy
Works stable with domoticz
Hi

I know ESPEasy... but i don't know how use it to read data from domoticz.....

I'm ussing ESPEasy to receive the data and then print it into Nextion but i'm searching the way to do all with ESP8266....

Read the domoticz json data and print into Nextion the relevant data... I don't know how i can manage/decode the Json domoticz output in my ESP8266.....

Regards!
NickHead
Posts: 83
Joined: Tuesday 29 October 2013 18:30
Target OS: Linux
Domoticz version:
Location: North East Coast of the UK
Contact:

Re: How to get domoticz data from ESP8266??

Post by NickHead »

Like I said, and you actually didn't answer.

Use MQTT, here is another one on the same network.

The first ever one I built to test. Not with Nextion though.

https://www.youtube.com/watch?v=nzR7XNeBIdw
A lot of stuff that is doing my head in.
NickHead
Posts: 83
Joined: Tuesday 29 October 2013 18:30
Target OS: Linux
Domoticz version:
Location: North East Coast of the UK
Contact:

Re: How to get domoticz data from ESP8266??

Post by NickHead »

Derik wrote:Looking good..
Thankz Derik, Just a Mega 2560, Nextion 2.8" and a Arduino Network Shield with a LOT of programming.

There is a Raspberry Pi as a MQTT Broker on my system taking the Data from another Rapberry Pi running Domoticz.

There are various ESP 8266's sending temperatures about the house.

As I said, There are memory issues now with the Nextion Display and Mega so I am thinking of using yet another Pi as they
have 1 Gig of memory. I may get a larger Enhanced Nextion, i feel I deserve one for Christmas :)
A lot of stuff that is doing my head in.
ayasystems
Posts: 66
Joined: Tuesday 19 April 2016 23:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to get domoticz data from ESP8266??

Post by ayasystems »

NickHead wrote:Like I said, and you actually didn't answer.

Use MQTT, here is another one on the same network.

The first ever one I built to test. Not with Nextion though.

https://www.youtube.com/watch?v=nzR7XNeBIdw

I'm sorry for don't replay you.

I'm not using MQTT...

I will try to send data using udp from python script to a udp client in esp8266....

Regards
NickHead
Posts: 83
Joined: Tuesday 29 October 2013 18:30
Target OS: Linux
Domoticz version:
Location: North East Coast of the UK
Contact:

Re: How to get domoticz data from ESP8266??

Post by NickHead »

no problem ayasystems,

I was just thinking of an easier route really, MQTT is already part of Domoticz with hardly any overheads like
with http and json commands. I know 'cos I have used it and on a system like mine it does drag the system down
to a point that lighting and control is delayed, hence MQTT route.

If you have never used MQTT I would advise you to take a look. I can have virtually unlinited ESP 8266 / oled displays
connected to Domoticz and not even see any change in speed. I can take whatever data I need and show it, in any order.

Horses for courses though, hope you get it sorted.
A lot of stuff that is doing my head in.
Toni
Posts: 66
Joined: Monday 20 July 2015 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to get domoticz data from ESP8266??

Post by Toni »

Domoticz MQTT & ESPEasy has one issue, though... The max. MQTT message size ESPEasy will handle by default is 128 bytes, and Domoticz is VERY verbose:

https://github.com/knolleary/pubsubclie ... ient.h#L26
https://github.com/ESP8266nu/ESPEasy/bl ... er.ino#L49

The Arduino IDE does not have global defines for projects, so you'd need to make a local edit into PubSubClient.h to increase the maximum incoming message size in PubSubClient. The next limit is 256 bytes in Controller.ino. I just programmed 87 Wemos D1 Mini boards over the weekend with the 256 byte limit, just to find out that I need to bump up the message size because of this Domoticz commit (adds the 'Description' field, and breaks my system by going over the limit):

https://github.com/domoticz/domoticz/co ... 9b560754b8
SweetPants

Re: How to get domoticz data from ESP8266??

Post by SweetPants »

The MQTT specs tell me that the payload size could be up to 268,435,456 bytes.
I use 1024 bytes on input buffer for MQTT (not using Arduino, but native MQTT)
The description field is a VARCHAR(200), so max size is 200 bytes.
Toni
Posts: 66
Joined: Monday 20 July 2015 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to get domoticz data from ESP8266??

Post by Toni »

Yes, I'm not blaming you, but the Arduino software... The worst thing is that it's not that easy to fix it nicely if you are using the Arduino IDE. Platformio (see http://platformio.org/) has global defines, though, and is compatible with Arduino IDE projects. ESP8266 has enough RAM to not be limited to something silly like 128 bytes, right now I'm using 386 bytes limit on my build, this works nicely with the ESPEasy 'Domoticz MQTT helper' plugin, i.e. Domoticz dummy switches can control ESPEasy relays over MQTT.

I'd like to submit the Platformio build patch to ESPEasy, but I think they don't accept anything else than stabilization contributions right now.
User avatar
ledfreak3d
Posts: 98
Joined: Sunday 01 November 2015 15:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

Re: How to get domoticz data from ESP8266??

Post by ledfreak3d »

ayasystems wrote:
Derik wrote:mmm
Perhaps espeasy?
http://www.letscontrolit.com/wiki/index.php/ESPEasy
Works stable with domoticz
Hi

I know ESPEasy... but i don't know how use it to read data from domoticz.....

I'm ussing ESPEasy to receive the data and then print it into Nextion but i'm searching the way to do all with ESP8266....

Read the domoticz json data and print into Nextion the relevant data... I don't know how i can manage/decode the Json domoticz output in my ESP8266.....

Regards!
works ok with esp easy still figuring out how to get all the data
20161114_131702_resized.jpg
20161114_131702_resized.jpg (44.26 KiB) Viewed 9173 times
Unleashe the magic smoke ;)
NickHead
Posts: 83
Joined: Tuesday 29 October 2013 18:30
Target OS: Linux
Domoticz version:
Location: North East Coast of the UK
Contact:

Re: How to get domoticz data from ESP8266??

Post by NickHead »

I have just had a look at ESP Easy and I don't think it is possible to integrate the Nextion.

It looks as though it has standard routines for the devices. There is no way of managing the data
that is received and then putting it out to the Nextion.

It looks like it's fixed software, what is has in it is what is available.

Another way I was looking at is to re-flash the 8266 with routines made with the Arduino - IDE then you can
do whatever is required and not limited to the ESPEasy software.

I am not proficient in programming and I may talk a load of rubbish so take this with a pinch of salt but this is
how I see it.

If anyone thinks it is rubbish, keep calm, ignore it and carry on. :)
A lot of stuff that is doing my head in.
User avatar
ledfreak3d
Posts: 98
Joined: Sunday 01 November 2015 15:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

Re: How to get domoticz data from ESP8266??

Post by ledfreak3d »

there is already a nextion plugin for espeasy.
but you can also use the net2serial plugin to do the same thing
Unleashe the magic smoke ;)
NickHead
Posts: 83
Joined: Tuesday 29 October 2013 18:30
Target OS: Linux
Domoticz version:
Location: North East Coast of the UK
Contact:

Re: How to get domoticz data from ESP8266??

Post by NickHead »

I didn't know that led*, thanks , will look for it.

Hence when I said about the pinch of salt, I meant it :)
A lot of stuff that is doing my head in.
User avatar
ledfreak3d
Posts: 98
Joined: Sunday 01 November 2015 15:30
Target OS: Linux
Domoticz version: 3.8025
Location: Hoorn
Contact:

Re: How to get domoticz data from ESP8266??

Post by ledfreak3d »

no problem at all just trying to help out ;)
Unleashe the magic smoke ;)
ayasystems
Posts: 66
Joined: Tuesday 19 April 2016 23:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to get domoticz data from ESP8266??

Post by ayasystems »

I wrote a simple code to receive UDP package and send it to nextion. It is the best and simple solution for me.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests