GithubHelp home page GithubHelp logo

maccoylton / esp-homekit-multi-sensor Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 4.0 3.13 MB

Homekit muti sensor, motion, temperate, humidity and light with OTA

License: Apache License 2.0

Makefile 10.54% C 89.46%
esp8266 homekit sensor

esp-homekit-multi-sensor's People

Contributors

maccoylton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esp-homekit-multi-sensor's Issues

question

what esp board you using for esp-homekit-multi-sensor?

Led blink request

Hi,

Could you add led blink when it be pooling light?
For Esp12E on board led connected to gpio 2. So,

First: #define LED_GPIO 13 should change as #define LED_GPIO 2
Second: You can call a led_code function at the end of that task

void light_sensor_task(void *_args) {
    
    // thaks to https://github.com/peros550/esp-homekit-multiple-sensors/blob/master/examples/multiple_sensors/multiple_sensors.c
    
    int loop_count = 60;
    
    uint16_t analog_light_value;
    while (1) {
        analog_light_value = sdk_system_adc_read();
        //The below code does not produce accurate LUX readings which is what homekit expects. It only provides an indication of brightness on a scale between 0 to 1024
        //More work needs to be done so that accurate conversation to LUX scale can take place. However this is strongly dependent on the type of sensor used.
        //In my case I used a Photodiode Light Sensor
        currentAmbientLightLevel.value.float_value = (1024 - analog_light_value);
        homekit_characteristic_notify(&currentAmbientLightLevel, HOMEKIT_FLOAT((1024 - analog_light_value)));
        printf ("%s: Light level: %i\n", __func__, (1024 - analog_light_value));
        if (loop_count == 10){
            snprintf (post_string, 150, "sql=insert into homekit.lightsensorlog (LightSensorName, LightLevel) values ('%s', %f)", accessory_name, currentAmbientLightLevel.value.float_value);
            printf ("%s: Post String: %s\n", __func__, post_string);
            vTaskResume( http_post_tasks_handle );
            loop_count = 0;
        }
        vTaskDelay(5000 / portTICK_PERIOD_MS);

       // FOR EXAMPLE HERE //

        loop_count ++;
    }
}

I have designed a custom device with esp12e which is the most popular esp8266 module. I have put it in the box which I have designed as well. The box has transparent face and when the led of esp flickering, box look so nice. Indeed, sometimes, Esp crashes, I don't know why. So, It can help me to see If there is no led blink, I should do something for device.

P.s: Unfortunately, there is no any chance to connect a led to default pin, gpio 13. I can only use on board led of esp. That's why I want that you change it.

More information

Your projects are very nice but, Please give more information about for your whole projects.

Such as, for this project, Read me doesn't give these answers of questions at below.

  • Which light sensor did you use?
  • Wiring schematics?
  • Resistors, Capacitors, Inductor values?
  • Any Caution? or Suggestions? or Building instructions?

Thanks. โœ‹๐Ÿป

Adding library issue

Hello there. First of all, I apologize for my bad english. I am very new to Arduino and ESP8266 yet. When I try to add a library through the Arduino program, I get an error. I am attaching the link of the library I want to add. Maybe the file I'm trying to add isn't even a library. If this is not a library, how can I use files of this type?

https://github.com/maccoylton/esp-homekit-multi-sensor

Build problem

I am living same issue with that: maccoylton/esp-homekit-air-quality-sensor#9

I cloned it with that code: git clone --recursive https://github.com/maccoylton/esp-homekit-multi-sensor.git .

Then, entered src folder and tried to execute that code: make -C . test

Result:

vagrant@vagrant-ubuntu-trusty-64:~/esp-homekit-demo/examples/esp-homekit-multi-sensor/src$ make -C . test
make: Entering directory `/home/vagrant/esp-homekit-demo/examples/esp-homekit-multi-sensor/src'
/home/vagrant/esp-open-rtos/common.mk:223: /home/vagrant/esp-homekit-demo/examples/esp-homekit-multi-sensor/components/esp-homekit/component.mk: No such file or directory
make: *** No rule to make target `/home/vagrant/esp-homekit-demo/examples/esp-homekit-multi-sensor/components/esp-homekit/component.mk'.  Stop.
make: Leaving directory `/home/vagrant/esp-homekit-demo/examples/esp-homekit-multi-sensor/src'
vagrant@vagrant-ubuntu-trusty-64:~/esp-homekit-demo/examples/esp-homekit-multi-sensor/src$

Light sensor pooling time

Hi,

I did your project via OTA programming way at my home and It worked very well but I think, light sensor pooling time is too high. It reads around every 30 seconds.

Why is it too high? Is there any way to decrease it around 5 sec. or more less? And if you update it on your GitHub page, my device automatically update itself?

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.