schluggi / aiosense Goto Github PK
View Code? Open in Web Editor NEWESPHome based all-in-one sensor
Home Page: https://aiosense.readthedocs.io/en/latest/
License: MIT License
ESPHome based all-in-one sensor
Home Page: https://aiosense.readthedocs.io/en/latest/
License: MIT License
Category
Year of the Voice Chapter 4 introduces wakeonword. It would be great to take advantage of this with the INMP441 microphone in this project.
...
I have an INMP441 connected to a C3 Mini.
This is what I have so far as config as a starting point. Everything looks reasonable to my eyes, but I haven't been able to get this working yet.
i2s_audio:
id: i2s_in
# i2s_lrclk_pin: GPIO5 # WS pin D1 Mini
# i2s_bclk_pin: GPIO18 # SCK pin D1 Mini
i2s_lrclk_pin: A5 # WS pin C3 Mini
i2s_bclk_pin: A1 # SCK pin C3 Mini
microphone:
- platform: i2s_audio
i2s_din_pin: A0 # SD pin
adc_type: external
pdm: false
id: mic_i2s
i2s_audio_id: i2s_in
voice_assistant:
microphone: mic_i2s
on_start:
- light.turn_on:
id: led
blue: 100%
red: 0%
green: 0%
effect: none
on_end:
- delay: 1s
- light.turn_off: led
on_error:
- light.turn_on:
id: led
blue: 0%
red: 100%
green: 0%
effect: none
- delay: 1s
- light.turn_off: led
Would love to see some further docs re;
Also, i wanted to ask about PIR sensors and dirty power. I get a lot of false positives with my Panasonic PIR that I intend to use on this project - and read that its often a good idea to do something to avoid this. I wasn't sure if this is something that's covered in this project yet or not (or even if its required..).
Finally, THANK YOU for this! I can replace my hobbled together sensor with a decent PCB, finally. :0
Category
Whats your idea?
I want to order TO-5 3-pin socket
but the shipping is extremely expensive. I tried to look for it in aliexpress, but without luck. Can you please help out?
For EKMC1603111 i managed to find https://www.aliexpress.com/item/1005003203976549.html?spm=a2g0o.cart.0.0.7d1f38dapwtcSv&mp=1 but I can't verify it is reliable yet
Category
Whats your idea?
Now that i2s microphones are supported (starting 2023.5) and the new assist functionality that comes with it, this project became even more awesome! But it ia missing one thing - the ability to hear the response. Can you add support for a speaker as well?
...
I guys, I really want to help on this project !
Is there any discord server available for the community ?
As described here: https://esphome.github.io/bluetooth-proxies/
Category
Whats your idea?
I played around with these small and inexpensive OLED Displays (https://esphome.io/components/display/ssd1306) and thought they might be a great addition to AIOSense. I think it would be great to see some of the values of the sensors directly on the AIO Sense without having to set up extra devices with screens.
Some things you could display on the display
Here is a Picture of the screen showing Sensor Values from ESP Home
I know space is tight on the board. Maybe we can squeeze it onto the IO extensions and release an additional case Verison that can handle the screen on the bottom. That way we don't have to make the PCB bigger.
This is the test code for the display i used:
font:
# gfonts://family[@weight]
- file: "gfonts://Roboto"
id: roboto
size: 12
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
reset_pin: D0
address: 0x3C
lambda: |-
// %% - literal % sign
it.printf(0, 0, id(roboto), "Temperature: %.1f°C", id(temperature).state);
it.printf(0, 15, id(roboto), "Humidity: %.1f%%", id(humidity).state);
it.printf(0, 30, id(roboto), "Pressure: %.1fhPa", id(pressure).state);
The Sensor code also needs to be modified to have an id
Example for the BME280
sensor:
- platform: bme280
id: bme280_sensor
address: "${bmex80_address}"
update_interval: "${bmex80_update_interval}"
temperature:
name: "Temperature"
id: temperature
filters:
- offset: ${temperature_offset}
- lambda: "return x + id(temperature_offset_ui).state;"
humidity:
name: "Humidity"
id: humidity
filters:
- offset: ${humidity_offset}
- lambda: "return x + id(humidity_offset_ui).state;"
pressure:
name: "Pressure"
id: pressure
filters:
- offset: ${pressure_offset}
- lambda: "return x + id(pressure_offset_ui).state;"
Categories:
Description:
I want to submit the installation technique i used to bring AIOsense devices to my household because i think it blends in very good with the surroundings.
Method:
1. I took the .stl file for the AIOsense stand and created an easy M3 Mount out of it. The advantage of this is that it is usable with typical M3 camera statives and other M3 mounting rigs! For example, i used this aluminum wall mounting rig for security cameras:
(source: https://www.amazon.de/dp/B0B5Y4Z7KY?psc=1&ref=ppx_yo2ov_dt_b_product_details)
You can find the M3 Mount i designed and used together with some imagery showing an example installation from my home in the attached .zip file!
2. I also thought of a method to install AIOsense devices in a way that hides the cables neccessary for the voltage supply of the device. The final Installation (also using the M3 mount from 1.) looks like this:
This is what you need:
A finished Installation looks like this (well, the lamp construction is not so final yet... ;-)):
More pictures in the attached .zip!
Category
Whats your idea?
Hi, I'm a newbie to ESP32 & hardware in general (although I am a professional software dev, so I'm not completely naive).
I'm looking into building something like this, but I have a few unique requirements and I wondered if there was plans for anything similar with this project.
Thanks for creating this exciting project, I'm looking forward to hopefully using it as my springboard into building my own sensors & hardware to power my smart home! 🙇♂️
Category
Error during config-validation in ESPHome (looks like the "external component" does not get loaded ?!
ESPHome-Version: | v2023.2.4
INFO Reading configuration /config/esphome/esphome-mmwave-schlafzimmer.yaml...
Failed config
sensor.bme680_bsec: [source /config/esphome/esphome-mmwave-schlafzimmer.yaml:141]
Component sensor.bme680_bsec requires component bme680_bsec.
platform: bme680_bsec
temperature:
name: aiosense-c3-mini Temperature
sample_rate: lp
filters:
- median
pressure:
name: aiosense-c3-mini Pressure
sample_rate: lp
filters:
- median
humidity:
name: aiosense-c3-mini Humidity
sample_rate: lp
filters:
- median
iaq:
name: aiosense-c3-mini IAQ
id: iaq
filters:
- median
co2_equivalent:
name: aiosense-c3-mini CO2 Equivalent
filters:
- median
breath_voc_equivalent:
name: aiosense-c3-mini Breath VOC Equivalent
filters:
- median
text_sensor.bme680_bsec: [source /config/esphome/esphome-mmwave-schlafzimmer.yaml:172]
Component text_sensor.bme680_bsec requires component bme680_bsec.
platform: bme680_bsec
iaq_accuracy:
name: aiosense-c3-mini IAQ Accuracy
Category
What would you like to improve?
ESPHome has an package feature to easily import external packages. I'll create one for each ESP to cleanup the yaml files.
On the D1 mini the led is controlled by D4. At the moment this is also the pin for the motion sensor.
Category
Version of ESPHome / AIOsense
...
Describe the bug
it wont compile with s2 mini or c3 mini
INFO ESPHome 2023.7.0
INFO Reading configuration /config/esphome/s2-all.yaml...
Failed config
switch.template: [source /config/esphome/.esphome/packages/f7a0b76d/esphome/packages/sensors/sen0395.yaml:17]
platform: template
name: mmWave Sensor
id: mmwave_sensor
entity_category: config
optimistic: True
The restore_state option has been removed in 2023.7.0. Use the restore_mode option instead.
restore_state: True
assumed_state: True
turn_on_action:
- uart.write: sensorStart
- delay: 1s
turn_off_action:
- uart.write: sensorStop
- delay: 1s
switch.template: [source /config/esphome/.esphome/packages/f7a0b76d/esphome/packages/sensors/sen0395.yaml:31]
platform: template
name: mmWave LED
id: mmwave_led
entity_category: config
optimistic: True
The restore_state option has been removed in 2023.7.0. Use the restore_mode option instead.
restore_state: True
assumed_state: True
turn_on_action:
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: setLedMode 1 0
- delay: 1s
- uart.write: saveConfig
- delay: 3s
- switch.turn_on: mmwave_sensor
turn_off_action:
- switch.turn_off: mmwave_sensor
- delay: 1s
- uart.write: setLedMode 1 1
- delay: 1s
- uart.write: saveConfig
- delay: 3s
- switch.turn_on: mmwave_sensor
Category
Version of ESPHome / AIOsense
ESPHome version 2023.7.0
Project Schluggi.AIOsense version 2.0.0
AIOsense Configuration
Lolin ESP32-C3 Mini
BME 680
BH1750
LD2410 mmWave
PIR
PCB V2.0-RC4 02/23
Describe the bug
Relates to PR #45.
Flashed the CPU with the appropriate config mods to my esp32-c3-mini. See config below:
substitutions:
name: "aio-garage" # lowercase only, have to be unique
friendly_name: "aio-garage" # device name and entity prefix
version: "2.0.0" # your AIOsense version
bh1750_update_interval: 5s
bmex80_address: "0x77" # for some modules you have to change it to 0x77
# bmex80_offset_humidity: "0"
# bmex80_offset_temperature: "0"
# bmex80_update_interval: 30s
# bme680_bsec_sample_rate: lp # lp -> 3s, ulp ->5min
# bme680_bsec_temperature_offset: "0"
ld2410_max_distance_move: 4.5m
ld2410_max_distance_still: 4.5m
ld2410_timeout: 5s
pir_delayed_off: 1s
pir_delayed_on: 0s
packages:
remote_package:
url: https://github.com/schluggi/AIOsense
ref: main
refresh: 1d
files:
- esphome/packages/config/base.yaml
# --- select your board ---
- esphome/packages/config/esp32-c3-mini.yaml
# - esphome/packages/config/esp32-d1-mini.yaml
# - esphome/packages/config/esp32-s2-mini.yaml
# - esphome/packages/config/esp8266-d1-mini.yaml
# --- select your sensors ---
- esphome/packages/sensors/bh1750.yaml
# - esphome/packages/sensors/buzzer.yaml # AIOsense >= 2.1.x only
# - esphome/packages/sensors/bme280.yaml # enable for bme280
- esphome/packages/sensors/bme680.yaml # disable for bme280
# - esphome/packages/sensors/bme680_bsec.yaml # does not work yet
- esphome/packages/sensors/occupancy.yaml # only if pir & mmWave are on
- esphome/packages/sensors/pir.yaml
- esphome/packages/sensors/rgb_led.yaml # esp32-c3-mini only
# - esphome/packages/sensors/led.yaml # d1-mini only
# --- select your radar sensor ---
- esphome/packages/sensors/ld2410.yaml
# - esphome/packages/sensors/sen0395.yaml
# Enable Home Assistant API
api:
encryption:
key: !secret aio_garage_api
ota:
password: !secret aio_garage_ota
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# manual_ip:
# static_ip: 192.168.1.111
# subnet: 255.255.255.0
# gateway: 192.168.1.1
# bluetooth_proxy:
Upload was successful. All sensors worked except LD2410 as shown below with the "Unknown" status indicators:
Recommended Solution
Change the following uart config in packages/sensor/ld2410.yaml from this:
uart:
# switching rx & tx is not a mistake but necessary
tx_pin: "${uart_rx_pin}"
rx_pin: "${uart_tx_pin}"
baud_rate: 256000
parity: NONE
stop_bits: 1
To this:
uart:
# enable for all cpu's but esp32-c3-mini
# rx_pin: "${uart_tx_pin}"
# tx_pin: "${uart_rx_pin}"
# enable for esp32-c3-mini
rx_pin: "${uart_rx_pin}"
tx_pin: "${uart_tx_pin}"
baud_rate: 256000
parity: NONE
stop_bits: 1
My disclaimer is that I don't have any of the other cpu's so I can not confirm when you must swap the uart pins to enable coms with the LD2410. This does work with the esp32-c3-mini though.
Hi Schluggi,
I suggest to redesign the power input to not use a "Male PIN-Header" but a "wire-to-board-terminal-block" like this one --> WUERTH Terminal-block
At least on the ESP32, the USB port is on the top. I'm not sure if the ESP8266 has it on the bottom, like your 3D model. Since you won't be supporting the 8266 anymore anyway, it would at least be worth considering, because with a terminal block you might have more strain relief
Cheers Flo
I found a low cost mmWave Sensor on Ali Express, https://de.aliexpress.com/item/1005004786874722.html
Datasheet
I haven't tried it yet, but if it works, it might be worth to add pin headers for it, for being able to produce a low cost version of the AIOsense
Category
Version of ESPHome / AIOsense
ESPHome 2023.3.2 / 2.0.0 board
Describe the bug
The esp8266 (D1 Mini) PIR pins are configured incorrectly as reported by esphome, GPIO13 does not have an internal pulldown
Failed config
binary_sensor.gpio: [source /config/esphome/.esphome/packages/6d7fe4d6/esphome/packages/sensors/pir.yaml:6]
platform: gpio
name: PIR
id: motion_pir
pin:
number: GPIO13
Only GPIO16 supports pulldown.
mode: INPUT_PULLDOWN
device_class: motion
filters:
- delayed_on: 0s
- delayed_off: 1s
I managed to fix 2 other small bugs for the esp8266 (D1 Mini), I don't know if i should send a PR.
How can I fix the PIR sensor? I don't know much about electronics, I just know enough about ESPHome
First of all thank you for making this project available, it's exactly what I was looking for.
I got a bit excited and ordered the version 1 pcb without reading the warning, is there somewhere that lists out the things that don't work on v1?
To the point, when testing the EKMC1603111 PIR it's not responding to motion when attached to the v1 pcb. I have 2 test pcbs, one is fully soldered with all components/female headers, the other just the dev board and PIR socket (assuming that's the bare minimum requirements).
If I attach the sensor directly with a nodeMCU or Wemos D1 mini ESP32 it works perfectly, attached to an Olimex POE ISO I have to use a pull down resistor from ground to out. I have still not been able to get the Wemos D1 mini ESP8266 to work, which behaves the same as when connected to the pcb.
Any help would be amazing!
Category
Whats your idea?
...
691210910002 << what is this part used for?
I am trying to build the sensor with these components.
ESP32-C3 mini (PCB)
BME280(PCB)
HLK-LD2410C (PCB)
GY-302-BH1750 (PCB)
im going to skip pir sensor, and i am in middle of ordering other parts. i was wondering what 691210910002 terminal block 2pos is intended for.
Thank you in advance.
Category
Description
I realized that I forgot to include the LCSC number for the capacitor parts. While searching for the missing components on the LCSC website, I noticed that there are various versions available for this part. As my electronics knowledge is a little rusty, do you have any additional information about this part?
I assume that it is a Multilayer Ceramic Capacitor, but I'm not sure whether it is leaded or non-leaded. Also, what voltage rating should I use? On the LCSC website, I can see that there are several options available for the same capacitance - 50V, 100V, and 250V. Can you advise me on which voltage rating to choose?
I will update the documentation accordingly OF😄
We just bought some AIOsense v2.0-rc2.
They will arrive late January.
Things we have to test:
Category
What would you like to improve?
I would suggest to use the "own" integrated ESPHome feature for driving the sen0395 sensor so no specific effort is needed to take care on an own integration.
Cheers
Category
There should be an info that the two resistors R1/R2 must not be populated when using the I²C modules BME280/BME680. I got quite bad readings because I soldered them on the board in the beginning - sometimes no values were entered at all at startup - I had to do several restarts.
Maybe I'm missing something or misinterpreting something - but since I removed the two resistors, everything works fine.
Cheers
Add templates for:
Category
Whats your idea?
...
it seems that in ld2410 yaml, a substitution is declared for
ld2410_max_distance_move: 4.5m
ld2410_max_distance_still: 4.5m
but can not find anywhere it is used for. can i change this value to change the detection range?
Category
Whats your idea?
LD2450 seems to be the new kid on the block, its a new mmWave sensor with the ability to track up to 3 people at once. Screek just released a new product the 2A which utilizes this new sensor and is using esphome with it.
Both resistors and the capacitor are only for the BME chips. These chips can only soldered by using a heatgun or a heating plate.
So everyone who hasn't access to this kind of equipment will use a BME module instead and does not need to solder these parts.
So there is no need to make this parts consumer friendly (alias THT).
Category
Version of ESPHome / AIOsense
ESPHome: 2023.3.2
AIOsense: latest
Describe the bug
I get an error with the bme680 initialization. It wants me to append "_m" to several variables in the cpp file. I searched to find this error but couldn't come up with anything. I apologize if there is already a solution. See the link for my logs.
Hello,
This project looks great, thanks for sharing!
I'm really interested in it but I was wondering if it is possible to simplify the pcb board, let me explain. I'm quite unexperienced in electronics and I found that soldering the BME280/680 sensor might be quite challenging, just soldering the pads on the bare sensor.
This might be a lot of work but, could it be possible to make a version using standard sensors, the same way the BH1750 is used? Or at least point me in the right direction to do it myself.
Thank you
Category
Describe the bug
Apologies this doesn't appear straightforward!
When booting the board with a Panasonic PIR attached (EKMC1603111) the reading for Motion in Home Assistant is constantly Detected. In ESPHome logs the sensor appears unresponsive.
Initially when setting up the board everything was fine for about a week, then the behaviour started so I replaced the PIR which fixed the issue; around a week later the same issue occurred :-( I question whether this was actually triggered by an outlet change.
The testing setup I now have:
If I switch the ESP32 boards over on 1 and 2 then both report detected, switching them back and it appears board 2 has now broken 😮💨 Update changing power source and board 2 is working again, board 1 started working again after 7+ days of detected no change to PSU.
In the above scenario 1-3 are on a shared extension brick whilst 4 is on a separate outlet, the reason I mention is that the breadboard also displayed this behaviour but only on the shared extension brick and not when connected to my laptop or the separate outlet.
If anyone can think of anything, wants me to try anything then by all means let me know.
Category
Version of ESPHome / AIOsense
2.0 RC4
Describe the bug
The PCB sensor pin orientation forces the sensor boards to be mounted upside down. This means the sensor chips themselves end up facing down / toward the PCB - rather than up. Secondarily, it means the pins on the sensor boards need to be soldered in an uncommon way (upside down..) which in turn means soldering is a bit more difficult.
This runs true with the sensor boards linked in the documentation.
Would it make more sense to have these pin holes swapped around?
Image above represents the same sensor board with pins soldered each way to help illustrate the problem. The top sensor board is how you would normally solder the pins, however - this causes the board to extend outside of the main PCB. The bottom sensor board is pinned in reverse in order to have it oriented correctly.
Category
What would you like to improve?
Include a similar LED for the ESP32 D1 Mini board as is included on the Lolin C3 Mini, useful if trying to identify which board is in front of you and whether the boarding is booting.
There is a new version of LD2410 called LD2410C link: https://de.aliexpress.com/item/1005005047841163.html
It has 0.1" pins so it could be easier to mount/solder. Can you make make PCB for that?
Category
Whats your idea?
Adding a feature that allows to exclude specific regions in the fov of the mmwave sensor to be prohibited from occupation detection.
Example:
If AIOsense is mounted in the bedroom, it would be useful to remove the bed from occupation detection, so the light in the room will turn off if i lie in bed.
With zones, it could turn on the bedside lamp and turn off the ceiling lamp.
The aquara FP2 sensor for example can do something like that, but a little more advanced.
Category
Version of ESPHome / AIOsense
2.0 RC-4
Describe the bug
The PIR sensor interferes with the mmWave sensor. Accordingly - the PIR doesn't fully seat into the socket.
The socket is fully seated, it's designed to sit a couple of mm above the board, as per the spec here. Note this is the spec'd TO-5 socket from the documentation.
The PIR sensor itself can't be fully seated due to its pin length (you could of course cut these down if required..) however, in its default state the PIR sensor interferes with the soldered pins on the DFRobot mmWave sensor.
Secondarily, the current printable case doesn't work at all with this configuration because its cutout sits far too high to even seat into the socket at all. I assume the case would have an update to resolve this we haven't seen yet.
You'd either need a TO-5 socket that sits higher, or would need to adjust the position of the PIR sensor to resolve this.
ESPHome does not support I²S input yet but to be prepared for the future, this would be nice.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
docs/requirements.txt
alabaster ==0.7.13
Babel ==2.12.1
bracex ==2.3.post1
certifi ==2022.12.7
charset-normalizer ==3.1.0
click ==8.1.3
colorama ==0.4.6
docutils ==0.19
ghp-import ==2.1.0
idna ==3.4
imagesize ==1.4.1
importlib-metadata ==6.0.0
Jinja2 ==3.1.2
Markdown ==3.4.1
markdown-include ==0.8.1
markdown-it-py ==2.2.0
MarkupSafe ==2.1.2
mdit-py-plugins ==0.3.5
mdurl ==0.1.2
mergedeep ==1.3.4
mkdocs ==1.4.2
mkdocs-autorefs ==0.4.1
mkdocs-awesome-pages-plugin ==2.8.0
mkdocstrings ==0.20.0
myst-parser ==1.0.0
natsort ==8.3.1
packaging ==23.0
Pygments ==2.14.0
pymdown-extensions ==9.10
python-dateutil ==2.8.2
PyYAML ==6.0
pyyaml_env_tag ==0.1
requests ==2.28.2
six ==1.16.0
snowballstemmer ==2.2.0
Sphinx ==6.1.3
sphinxcontrib-applehelp ==1.0.4
sphinxcontrib-devhelp ==1.0.2
sphinxcontrib-htmlhelp ==2.0.1
sphinxcontrib-jsmath ==1.0.1
sphinxcontrib-qthelp ==1.0.3
sphinxcontrib-serializinghtml ==1.1.5
urllib3 ==1.26.14
watchdog ==2.3.1
wcmatch ==8.4.1
zipp ==3.15.0
I am currently having issues with the mmwave GPIO pin on the ESP32-S2. Sometimes when the pin i high, it isn't detected by the ESP. I checked the connection, which seems to be okay. Maybe the issue is the internal pulldown.
Anyways I was searching for other solutions. I found out that the mmwave sensor is also sending the value over UART so i tried to write a custom binary sensor component for that, but haven't gotten far due to my horrible C skills.
But i now also found that someone else might have already done the work: esphome/esphome#4203
We could evaluate this solution and maybe save a gpio pin, which can then be used for something else, like audio output.
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.