Giter VIP home page Giter VIP logo

nuttytree / esphome-devices Goto Github PK

View Code? Open in Web Editor NEW
98.0 12.0 13.0 23.09 MB

A collection of ESPHome custom components, configuration files, and custom code for my various ESP8266/ESP32 devices that integrate with Home Assistant.

License: MIT License

C++ 77.87% Python 19.49% PowerShell 2.64%
esphome esphome-config esphomeyaml home-automation homeassistant esp8266 esp32 tuya treo feit

esphome-devices's People

Contributors

deepsource-io[bot] avatar nuttytree avatar

Stargazers

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

Watchers

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

esphome-devices's Issues

Incorrect brightness value retrieved for gosund dimmer switch

Just a quick note, I've been trying out your yaml for the Tuya and Gosund dimmers and quite liking them but found an issue with the value that is retrieved form the LightState class specifically the current_values_as_brightness. This value gets gamma corrected before being returned (a power factor of 2.8 by default I believe) which does not give the correct percentage value expected by serial output. Setting the gamma_correct value as 1 in the light section of your yaml ie lights will correct this value. Alternatively you could use a different class call to get the correct value but this was the easiest way to accomplish this at this time. This is noticeble if you turn off the switch manually at one level, it will turn back on at a lower level because of the descrepency.

  • id: gosund_light
    name: ${device_name}
    default_transition_length: 0s
    gamma_correct: 1.0

Default level not working

I have discovered that my latest code broke the default level feature on the Tuya dimmers. I have a partial fix that works if you don't have double tap enabled that I will be pushing shortly. Still hoping to find a fix when using double tap.

Scripture Of the Day Display Error

First off, I'm using the ESP32-WROOM-32D board and the same display as you had in your sample.
I'm trying to use your code to create a Quote of the Day display and I keep having my device crash. I believe I have narrowed it down ScriptureOfTheDay::display_scripture(). If I take out the following code:

  for (int i = 0; i < verseLineCount; i++)
  {
    display_->print(400, currentPosition, verse_font_, TextAlign::CENTER, scripture_[i].c_str());
    currentPosition += SPACE_BETWEEN_LINES;
  }
  display_->print(760, currentPosition, reference_font_, TextAlign::CENTER_RIGHT, scripture_[verseLineCount].c_str());

Here is the crash dump

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x400dcfcb  PS      : 0x00060230  A0      : 0x800dd00f  A1      : 0x3ffb1c60  
A2      : 0x00000000  A3      : 0x000000ff  A4      : 0x0000bb80  A5      : 0x3ffc6f0c  
A6      : 0x3f401960  A7      : 0x00000000  A8      : 0x00060023  A9      : 0x3ffb8098  
A10     : 0x00000000  A11     : 0x00000000  A12     : 0x80089e3c  A13     : 0x3ffb1b60  
A14     : 0x00000000  A15     : 0x3ffb0060  SAR     : 0x00000010  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x000000bc  LBEG    : 0x4000c28c  LEND    : 0x4000c296  LCOUNT  : 0x00000000  

ELF file SHA256: 0000000000000000

Backtrace: 0x400dcfcb:0x3ffb1c60 0x400dd00c:0x3ffb1c80 0x400d256f:0x3ffb1ca0 0x400d2596:0x3ffb1cc0 0x400d62e6:0x3ffb1ce0 0x400ddd85:0x3ffb1d00 0x400dde1f:0x3ffb1e30 0x400dcdd9:0x3ffb1e50 0x401a815b:0x3ffb1e70 0x401a7c03:0x3ffb1e90 0x400d5f33:0x3ffb1eb0 0x400d4fc1:0x3ffb1ed0 0x401a7f85:0x3ffb1f20 0x401a8061:0x3ffb1f40 0x400dac6e:0x3ffb1f60 0x400dd01a:0x3ffb1f90 0x400ec215:0x3ffb1fb0 0x40089c2a:0x3ffb1fd0

It will not crash. I have zero experience with C++ and have been trying to troubleshoot the best I can.

Also in the follow code I'm have problems with the http_request_->send();

std::vector<std::string> ScriptureOfTheDay::get_scripture()
{
  http_request_->set_url(SCRIPTURE_URL);
  http_request_->set_method("GET");
  
  http_request_->send();
  if (http_request_->status_has_warning())
  {
    // If the request failed we shutdown and try again in 15 minutes
    shutdown(15 * 60);
  }
  const char *json = http_request_->get_string();
  
  DynamicJsonBuffer jsonBuffer(JSON_BUFFER_SIZE);
  JsonObject& scripture = jsonBuffer.parseObject(json);
  
  http_request_->close();

  std::vector<std::string> formattedScripture = split_verse_into_lines(std::string(scripture["verse"]["details"]["text"].as<char*>()));
  formattedScripture.push_back(std::string(scripture["verse"]["details"]["reference"].as<char*>()));

  return formattedScripture;
}

The error is below

In file included from src/main.cpp:37:0:
src/random_quote.h: In member function 'std::vector<std::__cxx11::basic_string<char> > ScriptureOfTheDay::get_scripture()':
src/random_quote.h:85:23: error: no matching function for call to 'esphome::http_request::HttpRequestComponent::send()'
   http_request_->send();
                       ^
In file included from src/esphome.h:12:0,
                 from src/main.cpp:3:
src/esphome/components/http_request/http_request.h:47:8: note: candidate: void esphome::http_request::HttpRequestComponent::send(const std::vector<esphome::http_request::HttpRequestResponseTrigger*>&)
   void send(const std::vector<HttpRequestResponseTrigger *> &response_triggers);
        ^
src/esphome/components/http_request/http_request.h:47:8: note:   candidate expects 1 argument, 0 provided

I have managed to update the ArduinoJson to 6.18.5. I am running ESPHome V2022.3.2.
This is my first time creating an issue, sorry if it doesn't contain everything needed or if the formatting if off.
Any help or pointers would be much appreciated. Thank you!

Availability of Feit Dimmers

I got 6 through Costco, they are still available. I got two 3-packs for $39 each. I saw 2-packs in the store a few months ago. The 3-packs are available online from Costco for $45. , so they have gone from $13/each to $15/each.

They are $18 through Amazon, and there is an affiliate that has them for $16. The advantage here is that you can buy just one versus the Costco tactic of forcing you to buy 2 or 3 at a time. I don't know which is the greater evil, Costco or Amazon. :-)

I will be disassembling mine to reprogram them, they do not work with Tuya-Convert. This means taking them out of the wall, sigh. They work fine as Tuya devices but they will be so much better!

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.