Comments (25)
@bramstrokersorry, was a bit busy with other stuff, will have a look tomorrow morning and post here...
from homeassistant-powercalc.
Thanks for the useful information. Pretty sure I will be able to reproduce this now.
Not sure when I can have another look. Maybe I can find some time tomorrow. Will keep you updated.
from homeassistant-powercalc.
see #108. please try my suggestion and see if this helps. I think this lines can be safely removed, but I need to do some further testing.
from homeassistant-powercalc.
Unfortunately I am unable to reproduce this issue.
I have setup a input boolean, and customized the friendly name:
sensor:
- platform: powercalc
entity_id: input_boolean.friendlyname_test
fixed:
power: 50
input_boolean:
friendlyname_test:
name: friendlyname test
homeassistant:
customize:
input_boolean.friendlyname_test:
friendly_name: "My friendly name"
Created entities look correct to me:
See the powercalc energy entity in this screenshot on the bottom:
from homeassistant-powercalc.
@bramstroker this is exactly what I mean.
With this config you would expect that "friendlyname test energy" is called "My friendly name energy"
This is the case if you don't have a global "powercalc:" section in the config, with it you get this behavior.
At least that's what I see here, I maybe have overlooked something obvious though.
Btw it would also be nice if the global naming template "Verbruik {}" would work on friendly name instead of raw device name.
from homeassistant-powercalc.
See #116 for the work in progress. Not sure if this changes has unwanted side effects. So need extensive testing before releasing to the public.
from homeassistant-powercalc.
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.
Yes will do and let you know, thanks!
from homeassistant-powercalc.
@cyberjunky Were you already able to do some testing?
from homeassistant-powercalc.
I don't think it fixes this problem.
It worked one time, but not consistent, no idea what is going on yet.
So with a global section powercalc: with only refresh rate you look friendly names of all sensors
Also entity_naming "{} verbruik" works
But "Verbruik {}" is not allowed (invalid config)
from homeassistant-powercalc.
@cyberjunky
I need some more information to get a grip of what's going on.
Which exact version of powercalc are you testing now?
There should be no difference when you have global section powercalc enabled or not.
Could you please enable debug logging?
Than share you configuration, the logs after starting home assistant and maybe a screenshot of the entities created by Powercalc.
It will also make things easier when you comment out all powercalc sensors except one.
from homeassistant-powercalc.
yeah I know, and will do, I write components myself and know how frustrating it is hen people don't give info, this was just a heads up that something strange is going on.
But I can 100% reproduce the powercalc: issue if you only specify the scan_interval.
from homeassistant-powercalc.
I'm running 0.5.0-beta2
Unpacked the zip inside custom_components/powercalc/
Scenario #1
This config:
homeassistant:
customize:
sensor.system_fritzrepeater:
friendly_name: "FRITZ!Repeater"
icon: mdi:router-wireless
sensor:
- platform: powercalc
entity_id: sensor.system_fritzrepeater
fixed:
power: 5.5
Developer view sensor.system_fritzrepeater attributes:
state_class: measurement
last_reset: '2021-08-23T08:36:50.587227+00:00'
source: sensor.fritz_repeater_power
source_entity: sensor.system_fritzrepeater
source_domain: sensor
unit_of_measurement: kWh
friendly_name: FRITZ!Repeater energy
icon: mdi:lightning-bolt
device_class: energy
Log:
2021-08-28 14:17:15 DEBUG (MainThread) [custom_components.powercalc.sensor] Setting up power sensor. entity_id:sensor.system_fritzrepeater sensor_name:FRITZ!Repeater power strategy=FixedStrategy manufacturer= model= standby_usage=None
2021-08-28 14:17:15 DEBUG (MainThread) [custom_components.powercalc.sensor] Creating energy sensor: FRITZ!Repeater energy
...
2021-08-28 14:17:24 DEBUG (MainThread) [custom_components.powercalc.sensor] State changed to "Online" for entity "sensor.system_fritzrepeater". Power:5.5
So friendly_name is fine! All good.
Scenario #2:
This config (i want a scan_interval of 1min) rest same as above:
homeassistant:
customize:
sensor.system_fritzrepeater:
friendly_name: "FRITZ!Repeater"
icon: mdi:router-wireless
powercalc:
scan_interval: 00:01:00
sensor:
- platform: powercalc
entity_id: sensor.system_fritzrepeater
fixed:
power: 5.5
Developer view sensor.system_fritzrepeater attributes:
state_class: measurement
last_reset: '2021-08-23T09:32:38.588985+00:00'
source: sensor.system_fritzrepeater_power
source_entity: sensor.system_fritzrepeater
source_domain: sensor
unit_of_measurement: kWh
friendly_name: system fritzrepeater energy
icon: mdi:lightning-bolt
device_class: energy
Log:
2021-08-28 14:26:12 DEBUG (MainThread) [custom_components.powercalc.sensor] Setting up power sensor. entity_id:sensor.system_fritzrepeater sensor_name:system fritzrepeater power strategy=FixedStrategy manufacturer= model= standby_usage=None
2021-08-28 14:26:12 DEBUG (MainThread) [custom_components.powercalc.sensor] Creating energy sensor: system fritzrepeater energy
..
2021-08-28 14:26:16 DEBUG (MainThread) [custom_components.powercalc.sensor] State changed to "Online" for entity "sensor.system_fritzrepeater". Power:5.5
So you see it now creates the energy sensor without the friendly name.
You have to be able to reproduce this with this info.
I will address the energy_nameing config issue in a separate issue.
from homeassistant-powercalc.
@cyberjunky you are sure you are using the beta version 0.5.0-beta.1 of 0.5.0-beta.2?
Fixes are not in master yet.
from homeassistant-powercalc.
in custom_components
i did wget https://github.com/bramstroker/homeassistant-powercalc/releases/download/v0.5.0-beta.2/powercalc.zip
mkdir powercalc
cd powercalc
unzip ../powercalc.zip
and rebooted
from homeassistant-powercalc.
Unfortunately I am unable to reproduce yet.
The friendly name of the source entity sensor.system_fritzrepeated
is retrieved from the state machine of Home Assistant. In your case the state of the entity was not available and powercalc will fall back to extract the name from the entity_id.
When the integration which created sensor.system_fritzrepeated
was not loaded before powercalc plartform, the state can not be retrieved, so that would potentially be the problem.
Which integration did create sensor.system_fritzrepeated
?
from homeassistant-powercalc.
Wait, this could be the cause, those are template sensors from device_trackers to translate home/away to on/off or online/offline.
sensor:
- platform: template
sensors:
system_laptopwerk:
value_template: "{{ 'on' if is_state('device_tracker.laptopwerk', 'home') else 'off' }}"
system_printerlj3600:
value_template: "{{ 'on' if is_state('device_tracker.printerlj3600', 'home') else 'off' }}"
system_fritzbox:
value_template: "{{ 'Online' if is_state('device_tracker.fritzbox', 'home') else 'Offline' }}"
system_fritzrepeater:
value_template: "{{ 'Online' if is_state('device_tracker.fritzrepeater', 'home') else 'Offline' }}"
I read that you support device_trackers directly now I think correct?
from homeassistant-powercalc.
Yes device trackers are directly supported. Only in beta version yet.
For the template sensor to work could you please try adding template
to manifest.json dependencies
?
from homeassistant-powercalc.
Yes this fixed the issue, great!
from homeassistant-powercalc.
Yeah! I will incoorporate the fix in the next beta.
from homeassistant-powercalc.
Just released v0.5.0-beta.3. Could you do a final check if everything works for you in this version? Than we can close this issue.
from homeassistant-powercalc.
I downloaded the 0.5.0-beta3 zip
It doesn't work, it seems you forgot to insert the dependency for template?
from homeassistant-powercalc.
Made a mistake. Did create the beta releases from wrong branch master
. Removed the releases and created new one from beta
now v0.5.0-beta.3, which also includes the fix for #145
from homeassistant-powercalc.
Yes working like a charm, the regex and template issue solved, thanks alot, you save me code something like this!
from homeassistant-powercalc.
cool! Closing this issue now. all these changes will be available in v0.5.0
from homeassistant-powercalc.
Related Issues (20)
- Philips Hue Bloom LC001 HOT 6
- JSONDecodeError and not a valid ColorMode Error during startup since v1.12.12 HOT 15
- Error while dispatching HOT 9
- ability to enter power-on consumption for 'Sonof ZBmini01' via the configure GUI HOT 3
- Why is powercalc trying to reach the internet after installation and setup? HOT 11
- Thanks for the contribution, makes sense to add the alias as you also verified the power draw is similar. HOT 2
- cant delete entries on the integration HOT 9
- Energy sensor have mixed kWh or Wh as unit HOT 10
- light_setting.hue = int(hs[0] / 360 * 65535) ~~^^^ TypeError: 'NoneType' object is not subscriptable HOT 4
- Innr outdoor lights
- Adopt powercalc to change in device info HOT 1
- Add IKEA LED2104R3 GU10 bulb
- Support for multiple-outlet smart outlets and smart strips HOT 20
- Energy sum to retrieve untracked energy HOT 5
- Option flow cleanup HOT 1
- More than 130 powercalc light entities per room. Why? HOT 11
- Adding my autodectected TP-Link HS300 results in exception HOT 4
- A sensor grouping power sensors went crazy HOT 7
- Allow edit of disabled PowerCalc entry HOT 2
- Problem with group-type entities HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homeassistant-powercalc.