Giter Site home page Giter Site logo

Comments (15)

bramstroker avatar bramstroker commented on September 17, 2024

Yes I think support for that can be added

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

I did have a look but cannot reproduce this.

Did test this with a Denon Heos speaker and set the speaker to playing or paused, but it is displaying the power which I specified.

This is my config:

- platform: powercalc
    entity_id: media_player.terras
    fixed:
      power: 34.5

In both cases the power sensor value is 34.5 both for playing and paused. Which is correct imo.
I have added some extra debug logging so I could monitor all the state changes from the mediaplayer.

2021-06-28 20:53:26 DEBUG (MainThread) [custom_components.powercalc.sensor] State changed to "paused" for entity "media_player.terras". Power:34.5
2021-06-28 20:57:52 DEBUG (MainThread) [custom_components.powercalc.sensor] State changed to "playing" for entity "media_player.terras". Power:34.5

I have no clue why this is not working for your case.
This debug logging has been added to the master branch. Could you try with the master version and enable debug logging (see the readme)?
Hope we have some more information why it not works for you.

from homeassistant-powercalc.

eddysteurs avatar eddysteurs commented on September 17, 2024

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

You have the same behaviour as me, and that's actually expected.
There is no difference in power consumption between playing/paused states. In both cases the device is actually on and the component will show the defined power. When the sonos is paused it will still draw power, I assume quite similar to when it is actively playing a song. Right now it's not possible yet to specify power per state.

But maybe I can add something like this.

sensor
  - platform: powercalc
     entity_id: media_player.bureau
     fixed:
       states_power:
         playing: 8.8
         paused: 2.3

from homeassistant-powercalc.

eddysteurs avatar eddysteurs commented on September 17, 2024

from homeassistant-powercalc.

eddysteurs avatar eddysteurs commented on September 17, 2024

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

Resolved by #44

from homeassistant-powercalc.

eddysteurs avatar eddysteurs commented on September 17, 2024

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

I have just released version 0.2.3, that includes the new feature. Let me know if this works for you.

from homeassistant-powercalc.

eddysteurs avatar eddysteurs commented on September 17, 2024

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

Yes, I'm sorry I found the problem.
Could you update to 0.2.4?

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

This has to do with python versions. I am running a more recent version of python on my development instance than home assistant OS. That's why I don't see this error on my development instance. Will see if I can downgrade my python version or add some tests / checks in CI to prevent this error in the future.

from homeassistant-powercalc.

eddysteurs avatar eddysteurs commented on September 17, 2024

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

Top ;-)

The right example is in the Readme, but you figured it out already

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

Ah, I see the readme is incorrect. Will update

from homeassistant-powercalc.

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.