smrtnt / open-home-automation Goto Github PK
View Code? Open in Web Editor NEWOpen Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
License: MIT License
Open Home Automation with Home Assistant, ESP8266/ESP32 and MQTT
License: MIT License
Hello!
very nice sensor (less than a buck). Would be nice to see it working in the multisensor sketch =)
Hello everybody!
Would be awesome if the radar sensor RCWL 0516 could be supported. It can detect human bodies in 360° within 5 meters. It can also sense thru thin walls, plastic, wood etc. It's a nice motion sensor but cheaper and more capable.
Looking forward to test it 👍
couldn't find an alternative way to contact you.
Love all your examples. I was wondering if there was a way to add more LEDs to the same file? I have tried altering your files but to no avail
any help you can give would be appreciated
thanks
Sam
Hello,
i just switched over from using the binary sensor door (ha_mqtt_binary_sensor_door) over to use the multisensor (ha_mqtt_multisensor) for the same propose plus more (pir sensor)
I found some difference:
magnet/reed/door sensor with the same wiring (d1 and ground) results:
button with same wiring (wemos button shield on d3 and ground) without any resistor:
And the pir/motion sensor on the multi sensor sketch also works like a charm.
Beside that I like the "online" state information from the multi sensor! Very nice feature!
Would be awesome to "tune" the multisensor sketch that it's possible to use more/different types of sensor. For example:
Any idea how I can correct my open/closed problem with the my door sensor? Thank's!
Hello! Thank you for your work! Could you ask me, how to change D0 pin to other?
D0/GPIO16 - RST (wake-up purpose)
I cant find in sketch...
After getting your assistance with the upload to my NodeMCU, I am very appreciative.
However, it seems I'm not getting any output to my MQTT broker from the setup. The only difference between mine and yours is I'm using a DHT11 sensor not a DHT22.
Other then the one place you directly mention it (and which I amended it to 11 from 22) is there anything else I might need to change to make this work or do you think I might have issues with the DB or sensor themselves.
Jonathan
I'm using Arduino 1.8.2
and get the following output (did already a second git clone and a manual grab just to be sure no files were corrupted over the air)
Error text is the following one (files untouched just renamed the example to config.h)
In file included from sketch/MultiSensor.h:5:0,
from sketch/MultiSensor.cpp:2:
sketch/MultiSensor.cpp: In member function 'void MultiSensor::init()':
sketch/config.h:5:41: error: 'D3' was not declared in this scope
#define DOOR_SENSOR D3
^
sketch/MultiSensor.cpp:55:11: note: in expansion of macro 'DOOR_SENSOR'
pinMode(DOOR_SENSOR, INPUT_PULLUP);
^
sketch/config.h:16:44: error: 'D7' was not declared in this scope
#define MOTION_SENSOR_PIN D7
^
sketch/MultiSensor.cpp:60:11: note: in expansion of macro 'MOTION_SENSOR_PIN'
pinMode(MOTION_SENSOR_PIN, INPUT_PULLUP);
^
sketch/config.h:56:39: error: 'D2' was not declared in this scope
#define SHT_SCL_PIN D2
^
sketch/MultiSensor.cpp:75:14: note: in expansion of macro 'SHT_SCL_PIN'
Wire.begin(SHT_SCL_PIN, SHT_SDA_PIN);
^
sketch/config.h:60:41: error: 'D1' was not declared in this scope
#define BUTTON_SENSOR D1
^
sketch/MultiSensor.cpp:82:11: note: in expansion of macro 'BUTTON_SENSOR'
pinMode(BUTTON_SENSOR, INPUT);
^
sketch/MultiSensor.cpp: In member function 'void MultiSensor::handleEvt()':
sketch/config.h:16:44: error: 'D7' was not declared in this scope
#define MOTION_SENSOR_PIN D7
^
sketch/MultiSensor.cpp:102:23: note: in expansion of macro 'MOTION_SENSOR_PIN'
if (digitalRead(MOTION_SENSOR_PIN) != this->_motionState) {
^
sketch/MultiSensor.cpp: In member function 'bool MultiSensor::_readDoorState()':
sketch/config.h:5:41: error: 'D3' was not declared in this scope
#define DOOR_SENSOR D3
^
sketch/MultiSensor.cpp:223:22: note: in expansion of macro 'DOOR_SENSOR'
return digitalRead(DOOR_SENSOR);
^
exit status 1
An older version worked with my setup out of the box?
Thanks a lot for such great Open-Home-Automation projects. But I ran into such a problem: I have 4 motion sensors from which the signal comes to Home Assistant and after creating automation with Home Assistant they control one ESP8266 module and from this module to 4 relays. Those. 1 motion sensor controls one relay, but there are 4 relays on one ESP8266 module. I'm still just learning. Thank you very much for your understanding and help.
Hey,
this one is also great, small and more precise than dht22. And it has a wemos shield as well: https://wiki.wemos.cc/products:d1_mini_shields:sht30_shield
Notes:
Wemos' provided library is hinky and not recommended.
This firmware uses ClosedCube's library instead: https://github.com/closedcube/ClosedCube_SHT31D_Arduino (not closed at all!)
Source: https://github.com/boneskull/shtshow
I have your sketch running to power some white led strips. When I plug them directly in the power source they are much brighter then when they run through the PWM of the NodeMCU.
I found here that the brightness level should be adjusted from 255 to 1023 for the ESP8266. Read about it in his Update here:
https://eryk.io/2015/10/esp8266-based-wifi-rgb-controller-h801/
Can you tell me if that is possible with this Sketch. I tried but it does not work.
I'm finding these examples very helpful. However, I did run into one issue that I believe I solved.
In the setup() {}
function I believe you need to include WiFi.mode(WIFI_STA)
to prevent the ESP from broadcasting an SSID. I believe this was causing my 2.4 GHz network from having poor performance.
For example:
void setup() {
...
WiFi.mode(WIFI_STA);
...
}
Hi Sam,
as always i still love what you've done. it basically all runs my house. i was wondering whether you could point me in the right direction with altering the PIR file?
any little bit of help would be greatly appreciated
Thanks,
Sam
I am working on it will test it before 14/02/2019
Yes!
Awesome little thing again. Can be catched for around US $ 3.00 with shipping on a breakout board with pins. See here: https://www.aliexpress.com/item/BME280-Digital-Sensor-Temperature-Humidity-Barometric-Pressure-Sensor-Module-I2C-SPI-1-8-5V-GY-BME280/32848964559.html
Would be awesome to get in. Specially into the multi sensor!
compiling ha_mqtt_sensor_dht22.ino lately gives an error saying the code needs to be migrated from ArduinoJson 5 to ArduinoJson 6.
the following link to a website is given, and i could solve the topic by watching just the video at second example given, see https://arduinojson.org/v6/doc/upgrade/
In short:
Hi
I am new on github and with home assistant. I was trying your led example. I was not able to turn on led with the provided code. Esp8266 is working properly i checked serial monitor wifi and mqtt connection was successful. Just to ensure my esp8266 works properly i have tried some other examples from github with dht22 sensor that was successful.
I have checked mqtt log file in raspberry pi. I can see successful connections with esp6288.
Adding to that when i turn on led button from home-assistant screen it turns off by itself after 1 sec.
Am i missing something ?
Thanks
First I would like to thank you for this sketch, just what I been looking for.
This is my first go at using MQTT in HA and trying to upload the sketch to the ESP8266 so please be understanding of my ignorance.
Made the minor adjustments to your ino file for my wifi network and MQTT details. Plus the topic name and the sketch verifies perfectly.
When I hook up the NodeMCU board to the pc to upload I get a rather long error file (below). Any advice would be greatly appreciated.
Arduino: 1.8.4 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 1M (144K SPIFFS), ck, Disabled, None"
Archiving built core (caching) in: C:\Users\ADMINI1.ASU\AppData\Local\Temp\arduino_cache_134493\core\core_esp8266_esp8266_generic_CpuFrequency_80,FlashFreq_40,FlashMode_dio,UploadSpeed_115200,FlashSize_1M144,ResetMethod_ck,Debug_Disabled,DebugLevel_None_____7246470ddf479558ce5125d1daf92f35.a1.ASU\AppData\Local\Temp\arduino_build_821035/sketch_sep07a.ino.bin
Sketch uses 240089 bytes (27%) of program storage space. Maximum is 876528 bytes.
Global variables use 33296 bytes (40%) of dynamic memory, leaving 48624 bytes for local variables. Maximum is 81920 bytes.
C:\Users\Administrator.ASU-HP7900-DS\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9/esptool.exe -vv -cd ck -cb 115200 -cp COM3 -ca 0x00000 -cf C:\Users\ADMINI
esptool v0.4.9 - (c) 2014 Ch. Klippel [email protected]
setting board to ck
setting baudrate from 115200 to 115200
setting port from COM1 to COM3
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
resetting board
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
trying to connect
flush start
setting serial port timeouts to 1 ms
setting serial port timeouts to 1000 ms
flush complete
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2013 bytes of data
read 0, requested 1
error: failed reading byte
warning: espcomm_send_command: cant receive slip payload data
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I new in arduino world. It's possible to change yours lib/programs from ESP8266 to Arduino with ethernet shield ? I'm very interested update the firmware over-the-air.
hey first nice code
my problem is as soon as I switch on from my Home assistant the led is normal an after 3 sec. it turn green (also disconecting from the pc) somtimes I can turn it on and of but after a smale time it is Green again
LG Simon
I tried flashing an Arilux led controller with this firmware and it set the wifi ssid and pwd in the config.h, but it does not connect to my wifi. The flashing completed without any problems. There is an ESP8285 on my controller instead of an ESP8266, can that have anything to do with it not connecting?
Also are there any certain versions of the libraries i should use or just use the newest available?
Thank You Very Much for all your sources. I was looking this stuff all over internet but did not get this kind.
I need one help if you have time.
I'm using you sonoff.ino where we can manage one relay is there way we can add few more relay? cause I'm using this for something else where I have 8ch relay so want to add that on it. with web configuration with mitt port, server, and topic for each 8relay?
Hi,
First of all thanks, about this so detail manual about how to begin from 0 to install and configuring all in raspberry pi.
After reading and watching video, i have a doubt about the nodemcu and how you put in homekit, because in my case i also have few nodemcus on my network, but well i intall on configure homebridge for home assistant, my nodemcu not apprears on homekit.
How did you configure this nodemcu on HA? like sensors? like binary sensor? and only you installed homebridge-home-assistant package? and after all then appeared automatically on homekit?
I think, that also is possible to do it with sonoff or wemos (both are esp8266), really?
thanks
I run the whole time against the problem that my 7 bytes NFC tags are not recognized, I do not know better than that I have correctly noted the UID in the config file.
problem I have with all my mifare ultralight tags
Love the PIR setup. I got mine up and running without a hitch in under 5 minutes. Thanks for the sketch (as well as all the others).
I'm trying to position this one in a place I cannot easily access mains power or the sensor itself for obvious reasons. Tried running it through a powerbank but only got 3 days before that went flat. It's in a high traffic area for my family's normal day to day movements.
Any suggestions on how to either reduce power consumption or extend battery life?
Conversely, is there a way HA could tell the sensor, through MQTT, when to be actively working or not?
Cheers,
Jonathan
how can i control many lights using mqtt light.ino file, ive tried many ways of modifying the code but it didnt work... please help me to fix..
boolean m_light1_state = false;
boolean m_light2_state = false;
or how to do it correct?
Hi,
I managed to run your script dht22 with success, however, im confused with the following line:
ESP.deepSleep(SLEEPING_TIME_IN_SECONDS * 1000000, WAKE_RF_DEFAULT);
Sorry if this is a dumb question but how many time i will sleep before running all over again? I see you define a default value of 600 seconds as sleeping time, so the final time ESP will sleep it is really 600 (seconds) *(times) 1000000 (hardcoded value) = 600000000 (seconds)?
Hi,
i flashed your Sketch, and it seems to work.
After my setup in Home Assistant, humidity keeps saying unknow.
Heres the Output from the IDE-Serial Monitor:
.........
INFO: WiFi connected
INFO: IP address:
192.168.0.59
INFO: Attempting MQTT connection...INFO: connected
{
"temperature": "22.80",
"humidity": "34.10"
}
INFO: Closing the MQTT connection
INFO: Closing the Wifi connection
Temperature works fine.
Thanks for help
BR
Lukas
This one is also nice. Mostly because there is a waterproof probe version of it. So it's possible to measure temperate in a tank, pool or whatever liquid!
Can get it shipped from ali for around US$ 1
Hello!
Two thoughts:
Would be nice to be able to handle more than one button on a (multisensor) sketch 👍
And it would be cool to be able to define something like a 'double' or 'tripple' push 👍
I see in your table that you have not appointed the IRQ
and RSTO
, from the PN532. But on your photo I see that you have connected to (presumed) D3
and D4
.
How is this exactly?
Hy
I want to ask you if i can change %brightness to number brightness. (ex: 234 lux) for photocell.
Thx a lot
Hello!
Is it possible to add the rgb led to the multi sensor sketch?
Would be awesome!
Thank's
I wish to control multiple lights on the same board. Could someone give me an example of the edits for this sketch (mostly how to set topics for publish and subscribe). I am very new to mqtt and hassio so any help would be greatly appreciated. I was able to get this example working for the single control and have tried to edit sketch for two lights. Thanks in advance..
I believe line 95 should read:
uint8_t brightness = map(m_rgb_brightness, 0, 100, 0, 255);
i.e. the 1023 should be 255. I correct this and it made the brightness function correctly.
Many thanks for a great project.
Matt.
Hi
First i want to say , that im new to this , so please be patient with me :)
I want to make a nfc scanner and have bought :
PN532 NFC RFID (Elechouse module v3)
ESP8266 (NodeMCU v3.0)
https://www.ebay.com/itm/NodeMcu-Lua-WIFI-Internet-Things-development-board-based-ESP8266-CP2102-module/201542946669?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
and have printed the case in 3D.
Soo my issue is that i have 3 tags i want to play aroung with :
#define NUM_ACCEPTED_UIDS 3 //<-----------------CHANGE THIS IF ADDING CARDS!!
NFCTag NFCTags[NUM_ACCEPTED_UIDS] = {
// It is neccessary to account for UID length since a 7 byte ID could contain a 4 byte ID, which would cause a misfire
// #0 #1 #2 #3 #4 #5 #6 #Tagname
// {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, "Tag1", false, 0, false, {0}},
{{0xA, 0xE0, 0x39, 0x16}, "ChipO", false, 0, false, {0}},
{{0xAB, 0x55, 0xE, 0x1C}, "CardO", false, 0, false, {0}},
{{0x4, 0x4A, 0xCD, 0xB2, 0x2F, 0x66, 0x81}, "TAGO", false, 0, false, {0}},
};
BUT it seems no matter what i do , its only the first one that will be recognise?
any idea why?
thanks in advise
Hey mertenats,
Is it possible to make this code present the "Flashing" effect in HomeAssistant?
I saw somewhere that off-the-shelf rgb lights that are connected to HomeAssistant can show "Effects" drop-down menu where you can choose effects like Flash, Fader, etc. and I was thinking if it could be possible to do something like that with your code and ESP8266? I'm inexperienced with Arduino/ESP8266 programming, but I'd be willing to help you as much as I possibly can to make this happen.
P.S. I've been using those shitty IR remote RGB LED controllers from eBay. I then discovered your code and decided to get a few ESP8266s and upload your code to it. God damn if this isn't the best thing ever. Thank you so much for this, seriously.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.