Giter Site home page Giter Site logo

Comments (8)

hairychris avatar hairychris commented on June 14, 2024 2

I understand but just as a point of note if you look at this sample code you will see it is quite clearly possible to count pulses whilst in ULP. You are right that this would likely need to be done at the ESPHome level. I'm going to try and raise this over there and then see if we can revisit this.

https://github.com/espressif/esp-idf/tree/master/examples/system/ulp_fsm/ulp

from home-assistant-glow.

klaasnicolaas avatar klaasnicolaas commented on June 14, 2024

I don't think this is the right place to ask this question, what you want is far from what Glow is made for. Or certain features that are more suitable for the ESPHome repository.

from home-assistant-glow.

hairychris avatar hairychris commented on June 14, 2024

I guess it depends on how you look at what glow is.

If it is a one stop solution for people using home assistant to monitor their non P1 meter then I disagree. There will be many others attempting to use this with battery power as they lack the knowledge or experience to wire a plug in their meter cupboard. This issue might require an upstream issue to be opened with ESPHome but it is still relevant.

If glow is just an example of what can be done on ESPHome then it is different.

I'd hoped the glow project could become a meeting place for the many people using similar solutions so we can work on a better solution together. To me a power meter that uses less power is a good thing.

from home-assistant-glow.

hairychris avatar hairychris commented on June 14, 2024

This is already implemented in ESPHome if I'm not mistaken:

https://esphome.io/components/deep_sleep.html

We could use something like:

deep_sleep:
  run_duration: 10s
  sleep_duration: 10min
  wakeup_pin: # set to same PIN as pulse detector
  wakeup_pin_mode: KEEP_AWAKE

That could mess with OTA updates though probably as it would be hard to catch the device when it is on. Work around detailed if you follow the above link.

from home-assistant-glow.

klaasnicolaas avatar klaasnicolaas commented on June 14, 2024

You do have a good point there, I'm going to try to get something working with deep sleep. For those who do not have a socket and do not have a P1 port, this can be a solution. If you already have something working in the meantime, please open a PR πŸ˜‰

from home-assistant-glow.

hairychris avatar hairychris commented on June 14, 2024

Thanks. Unfortunately I do not have something working. Deep sleep wasn't implemented in ESPHome last time I tried.

I've got an ESP32 on order (I went for Firebeetle as they seem to be low power ish) so I'm happy to help where I can when that arrives. I don't understand if the pulse counter will increment if its using the same pin as the deep sleep wake up pin and that pin goes high. Perhaps it will depend on how long the pin is high for?

https://diyi0t.com/reduce-the-esp32-power-consumption/

from home-assistant-glow.

hairychris avatar hairychris commented on June 14, 2024

If we weren't using ESPHome this is how we would do it:

https://github.com/espressif/esp-idf/tree/master/examples/system/ulp_fsm/ulp

from home-assistant-glow.

klaasnicolaas avatar klaasnicolaas commented on June 14, 2024

We talked about it internally and we actually still have our doubts whether this will really work. During sleep nothing will be counted and continuously coming out of sleep also costs power.

Ideally you would like it to keep counting, but send an update once every X time. That's not something I can realize and is more with ESPHome than in this repository.

But if you have the stuff, go ahead and test it. For now I'm closing the issue.

from home-assistant-glow.

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.