Giter Site home page Giter Site logo

Comments (11)

bramstroker avatar bramstroker commented on September 17, 2024

Thanks for reporting.
Could you try commenting lines (147, 148, 151 and 152) in sensor.py please in you installation and see if this helps?

https://github.com/bramstroker/homeassistant-powercalc/blob/master/custom_components/powercalc/sensor.py#L147

from homeassistant-powercalc.

pejotigrek avatar pejotigrek commented on September 17, 2024

Thanks for reporting.
Could you try commenting lines (147, 148, 151 and 152) in sensor.py please in you installation and see if this helps?

https://github.com/bramstroker/homeassistant-powercalc/blob/master/custom_components/powercalc/sensor.py#L147

tried that few minutes ago - no sensor created at all :( [strange?]

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

Ah ok that sucks. Will have to do some further testing / debugging to reproduce this issue and solve it.
Will be able to in a few days.

from homeassistant-powercalc.

pejotigrek avatar pejotigrek commented on September 17, 2024

no problem, I can test it further then if you'll want - just need information what to do :)

from homeassistant-powercalc.

pejotigrek avatar pejotigrek commented on September 17, 2024

ok, so first of all: I have no idea what I'm doing (being more like a copy-n-paste-programmer that barely understands python), and I don't know if it makes any sense, but I was staring at your code & comparing some powercalc created entities with those in my Home Assistant.

there are lines in sensor.py that call entity_entry.entity_id (like L298) - I guess that it's printing the "original" HomeAssistant sensor/light/etc. entity_id in the log for debugging purposes. and looking at lines 147-152 that you've mentioned, there's no sign of entity_entry.entity_id, just unique_id = entity_entry.unique_id (I understand that entity_entry is an object that stores all data about given entity).

I might be totally wrong, and yet don't want to blow up my working installation by messing up the code ;) but shouldn't that be something like unique_id = entity_entry.entity_id.replace("", source_entity_domain)? I'm sure my "code" is wrong but you know what I mean :) (also: if this unique_id is exactly that you can forget about my comment here ;))

from homeassistant-powercalc.

pejotigrek avatar pejotigrek commented on September 17, 2024

additional reports below

KODI instance on RaspberryPi3

  • entity_id: media_player.1_living_kodi
  • powercalc entities: sensor.none_energy, sensor.none_power
  • I've checked in the integration dashboard - KODI model is listed as "unknown"

my Samsung TV:

  • entity_id: media_player.1_living_tv
  • power calc entities: sensor.ue50f6400_energy, sensor.ue50f6400_power
  • I've checked in the integration dashboard - TV model is listed as "UE50F6400"

so it clearly takes the model name and builds entities based on this

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

Yes currently it takes name of the original entity to construct the power and energy sensor name. And from this name the entity_id is generated.
I did some changes in #116 to use entity_id as a base, but this is a major change and complex (I am not sure this has no side effects for other users), because when the entity_id changes they could loose historic data.
Will first do some extensive testing myself.

from homeassistant-powercalc.

pejotigrek avatar pejotigrek commented on September 17, 2024

I did some changes in #116 to use entity_id as a base, but this is a major change and complex (I am not sure this has no side effects for other users), because when the entity_id changes they could loose historic data.

understood, but I guess that entity_id is nothing you'll change too often [probably only few times at the start of the config] yet it is something that people are using to identify entities so IMHO it is more logical to use this than the original entity or even model name, which are somewhere deep inside dashboard.

Will first do some extensive testing myself.

sure, if I can help somehow with testing - feel free to ask! :)

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

Just did a lot of cleanups and refactoring and issued first beta. v0.5.0-beta.1.
Are you able to test with this version and let me know your findings?

from homeassistant-powercalc.

pejotigrek avatar pejotigrek commented on September 17, 2024

Just did a lot of cleanups and refactoring and issued first beta. v0.5.0-beta.1.
Are you able to test with this version and let me know your findings?

removed all powercalc sensors, installed v0.5.0-beta.1, re-added all entities and... so far, so good! looks like all powercalc entity_ids are created from corresponding homeassistant's entity_ids. above mentioned issues with computer, tv and kodi - are gone! 👍 other things seems to work like earlier 👍

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on September 17, 2024

Feature is released

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.