Interesting ESP8266 WiFi Module Topic is solved
Moderators: leecollings, remb0
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Interesting WiFi Module
Anyone did something interesting in the meantime? I am still waiting for the power meter i ordered on eBay to arrive.
I want to build this: http://gizmosnack.blogspot.nl/2014/11/p ... eless.html but then with an ESP8266 that directly updates the value of a virtual Domoticz sensor.
Best would be to create some kind of sketch that mimicks a Youless device, as that one is already supported in Domoticz. Does anyone know how Domoticz reads the data from the Youless? As there is a webinterface for the Youless, but also some JSON output possible.
http://wiki.td-er.nl/index.php?title=YouLess
Edit: Awesome! I managed to get a DS18B20 connected to an Arduino to put its value into a virtual temperature sensor of Domoticz, wireless over my WiFi connection In theory it can be done without the Arduino, but i am not that skilled enough.
I based it on: http://www.instructables.com/id/ESP8266 ... /?ALLSTEPS (i used the first code part (with debugging).
You can find my working code for Domoticz here: http://pastebin.com/CJcbALjN
Be sure to create a virtual temperature sensore (see wiki: http://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s )
Now the wireless electricity meter can't be that hard but unfortunately it is still somewhere between China and The Netherlands
I want to build this: http://gizmosnack.blogspot.nl/2014/11/p ... eless.html but then with an ESP8266 that directly updates the value of a virtual Domoticz sensor.
Best would be to create some kind of sketch that mimicks a Youless device, as that one is already supported in Domoticz. Does anyone know how Domoticz reads the data from the Youless? As there is a webinterface for the Youless, but also some JSON output possible.
http://wiki.td-er.nl/index.php?title=YouLess
Edit: Awesome! I managed to get a DS18B20 connected to an Arduino to put its value into a virtual temperature sensor of Domoticz, wireless over my WiFi connection In theory it can be done without the Arduino, but i am not that skilled enough.
I based it on: http://www.instructables.com/id/ESP8266 ... /?ALLSTEPS (i used the first code part (with debugging).
You can find my working code for Domoticz here: http://pastebin.com/CJcbALjN
Be sure to create a virtual temperature sensore (see wiki: http://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s )
Now the wireless electricity meter can't be that hard but unfortunately it is still somewhere between China and The Netherlands
I am not active on this forum anymore.
- Keptenkurk
- Posts: 103
- Joined: Wednesday 21 August 2013 17:24
- Target OS: -
- Domoticz version:
- Location: Waalre, The Netherlands
- Contact:
Re: Interesting WiFi Module
I made some progress on my ESP-03.
Found a very usefull quickstart, and was able to flash NodeMCU firmware into the unit (tuanpmt's version with MQTT support)
Next step is trying to program a Lua script which senses an ESP-03 GPIO input and posts the result by a json string to Domoticz. But that requires some more time and Lua skills.
The tiny board can see AP's two doors away, amazing! The supply is taken from the FT232RL USB interface buffered by a capacitor (470uF) to provide more current at peaks. Not really advised but works for the time being...
To be continued... (progress also blogged at keptenkurk)
/paul
Found a very usefull quickstart, and was able to flash NodeMCU firmware into the unit (tuanpmt's version with MQTT support)
Next step is trying to program a Lua script which senses an ESP-03 GPIO input and posts the result by a json string to Domoticz. But that requires some more time and Lua skills.
The tiny board can see AP's two doors away, amazing! The supply is taken from the FT232RL USB interface buffered by a capacitor (470uF) to provide more current at peaks. Not really advised but works for the time being...
To be continued... (progress also blogged at keptenkurk)
/paul
Re: Interesting WiFi Module
Paul,
I'm experimenting with NodeMCU also, and so far it works great. Take a look at http://www.esp8266.com/viewtopic.php?f=22&t=747 The LuaUploader makes development a lot easier, you can easly upload you LUA scripts and test them. I currently run NodeMCU/SDK 0.9.5 on my ESP-1 and it works great.
/harry
I'm experimenting with NodeMCU also, and so far it works great. Take a look at http://www.esp8266.com/viewtopic.php?f=22&t=747 The LuaUploader makes development a lot easier, you can easly upload you LUA scripts and test them. I currently run NodeMCU/SDK 0.9.5 on my ESP-1 and it works great.
/harry
- Keptenkurk
- Posts: 103
- Joined: Wednesday 21 August 2013 17:24
- Target OS: -
- Domoticz version:
- Location: Waalre, The Netherlands
- Contact:
Re: Interesting WiFi Module
@Harry
Tried the Lua Uploader which indeed makes programming the ESP real easy! A must have and i really love it. Thanks for sharing the link.
Now let's see how to push a value or status to Domoticz. Please post useful Lua scripts for the ESP here!
/paul
Tried the Lua Uploader which indeed makes programming the ESP real easy! A must have and i really love it. Thanks for sharing the link.
Now let's see how to push a value or status to Domoticz. Please post useful Lua scripts for the ESP here!
/paul
Re: Interesting WiFi Module
init.luaKeptenkurk wrote:Please post useful Lua scripts for the ESP here!/paul
-- One time ESP Setup --
wifi.setmode(wifi.STATION)
wifi.sta.config ( "<your ssid>" , "<your password>" )
-- Get IP Address (DHCP)
print(wifi.sta.getip())
At this time you need to know your IP addres from your DHCP server because we run in STA (client) mode. I fixed that by using IP based on MAC address.
Then create a virtual device (ie a energy sensor), write down the index and execute the next LUA script
conn=net.createConnection(net.TCP, false)
conn:on("receive", function(conn, pl) print(pl) end)
conn:connect(8080,"<your ip address>")
conn:send("GET /json.htm?type=command¶m=udevice&idx=279&nvalue=0&svalue=450;2.0 HTTP/1.1\r\nHost: <your ip address>:8080\r\n"
.."Connection: keep-alive\r\nAccept: */*\r\n\r\n")
and the values show up in the domoticz energy sensor regards, Harry
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Interesting WiFi Module
Did you really make something to monitor your fridge? Or is it just to have an example
I want to build this: http://gizmosnack.blogspot.nl/2014/10/p ... -hack.html but then with an ESP8266 to put the consumption data directly into Domoticz.
I have ordered that power meter he is talking about. The power meter should have arrived previous week, but unfortunately i didn't spot the mail man. Maybe next week...
Oh and i found this: https://github.com/beckdac/ESP8266-transparent-bridge
Something to try soon
I want to build this: http://gizmosnack.blogspot.nl/2014/10/p ... -hack.html but then with an ESP8266 to put the consumption data directly into Domoticz.
I have ordered that power meter he is talking about. The power meter should have arrived previous week, but unfortunately i didn't spot the mail man. Maybe next week...
Oh and i found this: https://github.com/beckdac/ESP8266-transparent-bridge
I think when i connect the ESP8266 to my smartmeter' P1-port, i can install something like ser2net and have a wireless smart meter ?This is really basic firmware for the ESP that creates a totally transparent TCP socket to ESP UART0 bridge. Characters come in on one interface and go out the other.
Do you already have a serial project to which you just want to add WiFi? This is your ticket. No more dealing with the AT command set.
Something to try soon
I am not active on this forum anymore.
-
- Posts: 6
- Joined: Monday 27 October 2014 12:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: South East England
- Contact:
Re: Interesting WiFi Module
ThinkPad can i ask where you purchased the ESP8266 and the LDR module from and how are they connected or does the ESP8266 come with an LDR as an option?ESP8266 with LDR photo resistance module
I have one of these modules, and with the trimpot you can configure the light intensity level where it should trigger. If it is light it returns a high signal (5V or 3V3, depending on supply voltage), when under set level it is low (0V).
Combined with an ESP8266 and a small phone charger, this could be a cheap way to create a dusk/dawn sensor
Raspberry Pi + Domoticz + RFXtrx, LightwaveRF (dimmers, sockets, PIR's) Owl CM113, Oregon Scientific Temp / Humidity Sensors, Huacam CCTV Cameras, MySensors Lux and CO, ESP8266 NodeMCU temperature sensors
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Interesting WiFi Module
I am sorry, the description about it is not something i already made, it is just something that popped up in my mind.Emerson wrote:ThinkPad can i ask where you purchased the ESP8266 and the LDR module from and how are they connected or does the ESP8266 come with an LDR as an option?ESP8266 with LDR photo resistance module
I have one of these modules, and with the trimpot you can configure the light intensity level where it should trigger. If it is light it returns a high signal (5V or 3V3, depending on supply voltage), when under set level it is low (0V).
Combined with an ESP8266 and a small phone charger, this could be a cheap way to create a dusk/dawn sensor
I buy most of my hardware from eBay in China.
LDR module: http://www.ebay.com/itm/Photosensitive- ... 51c9c71646
ESP8266: http://www.ebay.com/itm/ESP8266-Serial- ... 259c25e960
I am not active on this forum anymore.
- Keptenkurk
- Posts: 103
- Joined: Wednesday 21 August 2013 17:24
- Target OS: -
- Domoticz version:
- Location: Waalre, The Netherlands
- Contact:
Re: Interesting WiFi Module
Yes! That works... sort of .Then create a virtual device (ie a energy sensor), write down the index and execute the next LUA script
Tried this script to set/reset a dummy switch:
Code: Select all
print('jsonpost.lua started')
conn = nil
conn=net.createConnection(net.TCP, 0)
conn:on("receive", function(conn, payload) print(payload) end )
conn:connect(8080,"192.168.xxx.xxx")
conn:send("GET /json.htm?type=command¶m=switchlight&idx=120&switchcmd=On&level=0 HTTP/1.1\r\nHost: 192.168.xxx.xxx:8080\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
/paul
Re: Interesting WiFi Module
HTTP is connection oriented, so after every send, the connection is closed (i presume). Maybe that's the reason why you have to create a new session to the Domoticz web server. I will try to make a packet trace to verify this behaviour and let you know. Regards, HArry
Re: Interesting WiFi Module
Just verfied that after receiving the HTTP/1.0 200 OK, the webserver closes the connection. This looks like normal behaviour.SweetPants wrote: I will try to make a packet trace to verify this behaviour and let you know. Regards, HArry
So every time you want to send something you need to setup a connection first. That is maybe why ther is no 'close'?
Re: Interesting WiFi Module
@Paul Take a look at https://github.com/Manawyrm/ESP8266-HTTP for some nice HTTP functions
-
- Posts: 24
- Joined: Saturday 31 January 2015 19:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Interesting WiFi Module
This little device is really easy to implement. Using the LUA firmware with this script:
and an Arduino Mini Pro to set t="xx.yy" through serial is all i needed to get a custom sensor shown in Domoticz.
Code: Select all
if(t==nil) then
t=0
end
tmr.alarm(0,30000, 1, function()
conn=net.createConnection(net.TCP, 0)
conn:on("receive", function(conn, payload) print(payload) end )
conn:connect(8080,"192.168.0.8")
conn:send("GET /json.htm?type=command¶m=udevice&idx=9&nvalue=0&svalue=" .. t .. " HTTP/1.1\r\nHost: www.local.home\r\n"
.."Connection: keep-alive\r\nAccept: */*\r\n\r\n")
end)
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Interesting WiFi Module
Found this: http://vaasa.hacklab.fi/2015/01/12/esp8 ... k-nodemcu/
Lua scripting to connect DS18B20 directly to ESP8266 and upload data via GET-request. Replace ThingSpeak URL with a JSON one from Domoticz and presto
Lua scripting to connect DS18B20 directly to ESP8266 and upload data via GET-request. Replace ThingSpeak URL with a JSON one from Domoticz and presto
I am not active on this forum anymore.
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Interesting ESP8266 WiFi Module
I wonder if these two batteries last long. I've read that the ESP takes about 200+mA to operate.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
-
- Posts: 25
- Joined: Thursday 19 February 2015 11:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Interesting ESP8266 WiFi Module
I found another example already with domoticz example:
http://blog.quindorian.org/2014/12/esp8 ... -x_30.html
wich create 2 dimable ledsstrip with wifi
http://blog.quindorian.org/2014/12/esp8 ... -x_30.html
wich create 2 dimable ledsstrip with wifi
-
- Posts: 116
- Joined: Saturday 13 July 2013 13:28
- Target OS: Linux
- Domoticz version: Latest
- Location: Hilversum, The Netherlands
- Contact:
Re: Interesting ESP8266 WiFi Module
half a day max.dannybloe wrote:I wonder if these two batteries last long. I've read that the ESP takes about 200+mA to operate.
Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433XL+P1, RFXtrx868, TE923 display, SolarEdge API
Cubietruck 2: Aeotec Z-Wave, Voltcraft CO-20
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433XL+P1, RFXtrx868, TE923 display, SolarEdge API
Cubietruck 2: Aeotec Z-Wave, Voltcraft CO-20
Re: Interesting ESP8266 WiFi Module
That is when it is transmitting, you can set it to 'deep sleep' mode http://hackaday.com/2015/02/08/hack-all ... eep-sleep/antwan wrote:half a day max.dannybloe wrote:I wonder if these two batteries last long. I've read that the ESP takes about 200+mA to operate.
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Interesting ESP8266 WiFi Module
I'm intending to make a multi-sensor with temp,hum,motion,lux and smoke detection (with alarm) all in one. I guess that for smoke and motion detection you don't want deep-sleep. I just got 5 ESPs from China. See if that will do or that I will go for mysensors with an Arduino instead. We'll see )
Looking forward to some experimentation work.
Looking forward to some experimentation work.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Re: Interesting WiFi Module
Hi,SweetPants wrote:init.luaKeptenkurk wrote:Please post useful Lua scripts for the ESP here!/paul
-- One time ESP Setup --
wifi.setmode(wifi.STATION)
wifi.sta.config ( "<your ssid>" , "<your password>" )
-- Get IP Address (DHCP)
print(wifi.sta.getip())
At this time you need to know your IP addres from your DHCP server because we run in STA (client) mode. I fixed that by using IP based on MAC address.
Then create a virtual device (ie a energy sensor), write down the index and execute the next LUA script
conn=net.createConnection(net.TCP, false)
conn:on("receive", function(conn, pl) print(pl) end)
conn:connect(8080,"<your ip address>")
conn:send("GET /json.htm?type=command¶m=udevice&idx=279&nvalue=0&svalue=450;2.0 HTTP/1.1\r\nHost: <your ip address>:8080\r\n"
.."Connection: keep-alive\r\nAccept: */*\r\n\r\n")
and the values show up in the domoticz energy sensor regards, Harry
First thank you for your message, with it I'm finally able to send information from my esp-12 to domoticz after hours of search.
I might haven't understand entirely the concept behind counter with domoticz, here is my setup :
Raspberry with domoticz 2.2283
Nodemcu devkit (esp-12) wired to an Velleman EMDIN01 (kWh counter with lcd display and pulse output with 1 pulse = 1 Wh)
I've read the wiki about json and electric counter but I'm not sure which one to choose between Electric and Counter.
What I want is my overall and daily consumption, with graph as domoticz generate itself but I'm not sure what value send to domoticz :
- each impulsion (easy but not optimized)
- x min consumption
and should I send it as nvalue , svalue COUNTER or ENERGY, I don't understand the difference in the wiki.
Who is online
Users browsing this forum: No registered users and 1 guest