Page 1 of 1
How to get domoticz data from ESP8266??
Posted: Tuesday 08 November 2016 21:36
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!
Re: How to get domoticz data from ESP8266??
Posted: Sunday 13 November 2016 13:38
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 .
Re: How to get domoticz data from ESP8266??
Posted: Sunday 13 November 2016 13:58
by djdehaan
I use mySensors. ESP8266 programmed with Arduino IDE, easy to integrate in Domoticz.
Re: How to get domoticz data from ESP8266??
Posted: Sunday 13 November 2016 13:59
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
Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 7:26
by Derik
Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 7:27
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..
Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 10:00
by ayasystems
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!
Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 10:59
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
Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 11:09
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

Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 11:18
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
Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 11:28
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.
Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 13:13
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
Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 13:45
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.
Re: How to get domoticz data from ESP8266??
Posted: Monday 14 November 2016 14:20
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.
Re: How to get domoticz data from ESP8266??
Posted: Tuesday 15 November 2016 9:12
by ledfreak3d
ayasystems wrote:
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 (44.26 KiB) Viewed 9181 times
Re: How to get domoticz data from ESP8266??
Posted: Tuesday 15 November 2016 9:55
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.

Re: How to get domoticz data from ESP8266??
Posted: Tuesday 15 November 2016 10:18
by ledfreak3d
there is already a nextion plugin for espeasy.
but you can also use the net2serial plugin to do the same thing
Re: How to get domoticz data from ESP8266??
Posted: Tuesday 15 November 2016 10:42
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

Re: How to get domoticz data from ESP8266??
Posted: Tuesday 15 November 2016 11:02
by ledfreak3d
no problem at all just trying to help out

Re: How to get domoticz data from ESP8266??
Posted: Sunday 20 November 2016 21:44
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.