Code Monkey home page Code Monkey logo

Comments (6)

timoschilling avatar timoschilling commented on July 20, 2024 2

I think deepsleep and this SDK aren't compatible. If your esp goes into deepsleep the sensor will be shown as unavailable in the Home app. For that what you want to do you need BLE, but BLE isn't implemented at the moment.

Hint: Build a Hub for example with homebridge or something like that which stores the sensor values of the esp and is always available to HomeKit.

from esp-homekit-sdk.

AramVartanyan avatar AramVartanyan commented on July 20, 2024 2

Actually it is very compatible with esp32.
There is just slight difference in the GPIO initialization and the GPIO range in Kconfig.
Everything else is originally done for esp32, including the DHT22.
I have test it on both platforms.

from esp-homekit-sdk.

AramVartanyan avatar AramVartanyan commented on July 20, 2024 1

@maxiiiiiiii, this example could be helpful to you as a starting point:
Watering + DHT22 on Battery and Solar

from esp-homekit-sdk.

maxiiiiiiii avatar maxiiiiiiii commented on July 20, 2024 1

I think deepsleep and this SDK aren't compatible. If your esp goes into deepsleep the sensor will be shown as unavailable in the Home app. For that what you want to do you need BLE, but BLE isn't implemented at the moment.

Thank you. After long hours of trying and comparing code i finally was able to build a homekit temperature and humidity sensor.

As timoschilling already anticipated, deepsleep is not an option for a homekit sensor, because the Wi-Fi has to be turned on all the time.
My idea now: I will use one esp32 as a kind of bridge that is always turned on and holds up all the sensor-data for eventual homekit-requests. It runs the homkit-sensor program I just finished, only the sensor-read gets sourced out.
A second esp32, equipped with a DHT22-sensor-unit will provide its data over ESP-NOW every now and then and run on lithium-battery.

Unluckily the only ESP-NOW example provided by espressif in the example section of its ESP-IDF-github (link below), is overcomplicated and hard to understand. I only need to send on one esp and receive on the other esp. All the other ESP-NOW examples I found on Google were written for Arduino.

https://github.com/espressif/esp-idf/tree/master/examples/wifi/espnow

from esp-homekit-sdk.

mbuckaway avatar mbuckaway commented on July 20, 2024 1

@maxiiiiiiii:

Here is an example I created to read the DH22 and connect to Homekit: ESP32-homekit-temp. It also supports reading the battery level on supported boards. The code supports the ESP32 IDF. The code is mostly complete and I had it working on a device with a battery. Of course, the 1800ma/h battery only lasted about two days.

Be careful implementing a weather station for homekit. Some of the limits attached to "standard" homekit devices are outside of normal sensor ranges, which will cause the device to fail to connect to the Home App. For example, the CURRENT_TEMPERATURE device has a limit from 0 to 100C and requires a custom device (or custom implementation with different limits) to go beyond this range.

My solution to the battery problem (I wanted a homekit outside temperature sensor) was to setup a modbus temperature sensor outside, and run a wire to the ESP32 inside which is plugged into a USB power supply. At some point, the battery would have to be charged anyways, and this eliminates that need. There are lots of modbus weather sensors on Aliexpress anyways for wind, temperature, etc. so one ESP32 can run everything.

from esp-homekit-sdk.

maxiiiiiiii avatar maxiiiiiiii commented on July 20, 2024

@maxiiiiiiii, this example could be helpful to you as a starting point:
Watering + DHT22 on Battery and Solar

Thank you very much for the fast reply.

Unfortunately your program is written for the ESP8266, so i was not able to flash it directly onto my ESP32.

Is it possible to use parts of your code and paste them into one of the examples made for the ESP32? Or is it somehow possible to convert the esp8266-code to fit esp32?

from esp-homekit-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.