Comments (12)
I did some development last week to use state attributes for configuration of power usage. See #60
That allows you to do something like this:
- platform: powercalc
entity_id: media_player.playstation_4
fixed:
states_power:
media_content_type|gaming: 6
standby: 1.25
idle: 1.8
But I think we can also allow template sensors as the entity as you request. This is a small change, will do it this week.
from homeassistant-powercalc.
That sounds great! Using a Sensor. Works best for me as it is much more flexible. I have a few media players that will use different amounts of Power depending on the volume setting, so using a template sensor allows this complex logic to be created by the users.
from homeassistant-powercalc.
Just seen you have a pull request open to add in the sensor domain & also a couple other items suggested by others! Looking forward to your next release! :)
from homeassistant-powercalc.
Yes. Going to finish (and test) this soon. But quite busy the next days. So will be end of the weekend or beginning of next week.
from homeassistant-powercalc.
Let me know if you want me to do any testing for you :)
from homeassistant-powercalc.
This has been merged into master. Are you able to test with the master branch?
from homeassistant-powercalc.
Absolutely! Can update from HACS? or will i need to manually copy?
from homeassistant-powercalc.
You can from Hacs. Just go to the integration overview click on the 3 dots in the powercalc integration and than "reinstall"
from homeassistant-powercalc.
Okay, its installed, But it doent seem to work:
Here is my configuration for my sensor template:
playstation_4_state:
value_template: >-
{% if state_attr('media_player.playstation_4', 'media_content_type') == 'game' %}
gaming
{% elif states('media_player.playstation_4') == 'standby' %}
rest
{% elif states('media_player.playstation_4') == 'idle' %}
menu
{% else %}
off
{% endif %}
Here is the configuration of powercalc:
- platform: powercalc
name: playstation_4_power
entity_id: sensor.playstation_4_state
fixed:
states_power:
rest: 11
menu: 57
gaming: 93
standby_usage: 0.7
from homeassistant-powercalc.
Any errors in the logs? Could you also enable debug logs for the component. See the readme how to do that.
I don't have time the next two days, but will have a look when I'm back
from homeassistant-powercalc.
Ah! it seems that deleting the entity using that "Remove Entity" button then restarting HA has fixed it! Seems like changing the Entity that the PowerCalc was using caused it to break. Would it have cached its config.
I turned on debugging and no errors in the logs.
from homeassistant-powercalc.
Ok nice. So everything is working now? No Idea why you had to remove the entity first
from homeassistant-powercalc.
Related Issues (20)
- Utility reset HOT 1
- TS011F _TZ3000_w0qqde0g powerplug not yet supported HOT 1
- Measure Tool as Add-on HOT 1
- All Devices off, Powercalc not loading at starting HA, also not with the newest Update HOT 19
- "All standby power" / energy entities do not link back to Powercalc integration HOT 3
- 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
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.