Powercalc - Virtual power sensors

Ahh that makes some sense. So if I create a template sensor to have the watts/power as an entity, I could then use this entity as the power sensor ID.

My goal is to just add my smart plugs into power calc, as that will auto create the utility meters. But also easily allows me to group plugs together, without having to add anything to the config yaml.

A correction on my last post, the plugs only provide a switch entity. I then have a template sensor to pull out the watts, amps, and volts as separate entities. But thereā€™s no energy sensor - which is what I was hoping powercalc would auto create rather than needing to set it up in the config.yaml.

Donā€™t get it. Do you have an entity which is holding the Watts, yes or no? If yes, use this as power_sensor_id. And switch on create_energy_sensor. And if needed/wanted create_utility_meters. See docs.

Hi,

Iā€™ve successfully used the ā€œstates_power:ā€ notation for the hvac_action attribute, however I realized that in my setup, my Ecobee thermostat controls both my HVAC furnace and thermopump.

So, in addition to hvac_action, there are other attributes that can be toggled by the thermostat. For instance, if outside temp drops below -10C, the thermostat switches from the thermopump to the furnace (aux_heat).
Would it be as simple as:

  - platform: powercalc
    entity_id: climate.my_ecobee
    fixed:
      states_power:
        hvac_action|heating: 1810
        hvac_action|cool: 1970
        hvac_action|idle: 0
        hvac_action|fan: 792
        aux_heat|on: 17760

If I write it like this, will there be a conflict because we can have a situation where hvac_action = heating and aux_heat = on? Will hvac_action take precedence over the other because itā€™s higher in the list?

Also, since part of the system uses a thermopump, the values I chose are the ā€œrating conditionsā€, however, the power consumed in heating and cooling are affected by the outside temperature. Is it possible to nest a linear mode within a fixed mode? Or create 2 powercalc sensors with the same climate entity, one for the thermopump (heating, cooling), and one for the furnace (aux_heat)?

Here are the attributes of the Ecobee:

hvac_modes: heat_cool, heat, cool, off
min_temp: 7
max_temp: 35
target_temp_step: 0.5
fan_modes: auto, on
preset_modes: Away, Sleep, Home, Off work
current_temperature: 21.7
temperature: 19.8
target_temp_high: null
target_temp_low: null
current_humidity: 62
fan_mode: auto
hvac_action: fan
preset_mode: away
aux_heat: off
fan: on
climate_mode: Home
equipment_running: 
fan_min_on_time: 5
friendly_name: My ecobee
supported_features: 91

Thanks!

Hi,
I use poweercalc to calculate energy consumption my lights bulbs that are controlled with smart switches . Itā€™s working except one thing. I configured it to calculate consumption on my android tv. It does work but every time I restart my ha instance my android tv entities are gone. I have to manual reload powercalc on my android tv settings and than all entities reappeared. This is only happening on tv settings.
This is somehow related to ha restart but I canā€™t figure this out.

states_power will return the first match from the list, so in this case yes hvac_action will take precedence.

Itā€™s not yet possible to nest fixed/linear strategies. Maybe I will implement something like that in the future.

When you want to do more complex things you can use fixed->power and define a template there, which allows you to do almost anything you want.

You can also create 2 powercalc sensors, one for the thermopump and one for the furnace, and optionally create a group which sums the sensors.

What do you mean with ā€œandroid tv entitiesā€. Powercalc has no control over entities of another integration.
Or do you mean the power / energy sensors created by powercalc?

I mean power / energy sensors created by powercalc.
They just disappeared for some reason but I donā€™t know why. When I reload it they reaper.

Hmm thatā€™s strange. Maybe similar issue as Reload every restart Ā· Issue #1153 Ā· bramstroker/homeassistant-powercalc Ā· GitHub.
I have no clue yet. You donā€™t see any errors in the logs?
Could you create a new issue on github?

Yes, this is very similar, maybe the same, issue to this reported on github. The strange thing is that it doesnt occur when you set up powercalc using smart switch entities. So I can conclude that this is somehow entities related.
I donā€™t have any errors related to powercalc but I didnā€™t enable debug mode.
Have an idea. Let me try to put this entities in configuration.yaml file and then restart ha.
Edit:
I tried to put this in configuration.yaml

  daily_energy_android_tv:
    source: sensor.daniel_tv_energy_daily
    cycle: daily
  monthly_energy_android_tv:
    source: sensor.daniel_tv_energy_monthly
    cycle: monthly

but the problem is the same. Entities just doesnā€™t reaper after ha restart.

Managed to get it to work, Thanks!!

I didnā€™t think of fixed power templateā€¦ thanks!

Iā€™ve noticed that the meter readings for my old style smartthings sockets read 0. I believe this is due a name clash. Smartthings adds an energy entity with postfix _energy_meter but does not populate this entity (Itā€™s populated for the newer style plugs)

My configuration does not specify an energy_sensor_id for these plugs so I hoped powercalc would use the power_sensor values and calculate the energy itā€™s self.

I tried changing the name of the energy sensor:

    - entity_id: switch.outlet_dining
      power_sensor_id: sensor.outlet_dining_power_meter
      energy_sensor_naming: "{}_pcalc_energy"

But this does not appear to do anything I still get outlet_dining_energy_meter_daily entities for powercalc:

How can I get powercalc to add the relevant energy entities without name clash and ignoring the energy sensor supplied by smartthings integration?

Powercalc tries to find a corresponding energy sensor on the same device when your define power_sensor_id. When you donā€™t want to use that one and powercalc create one, youā€™ll need to disable this energy sensor (in this case sensor.outlet_dining_energy_meter).

I find this automatic linking of powercalc sensors (power/ energy) with the upstream device which originally didnā€™t have power/ energy sensors a real benefit.

Can you talk a little more about how this gets setup and what users can do to make it work well?

Itā€™s coded in the integration. See here.

You can not do it manually. See some WTH wishes for his as well to be able to do it manually. And vote for it. :wink:

1 Like

Thanks for the link, although deciphering code isnā€™t my forte.

I do find it a bit hit and miss and would like to understand how I can ensure it works more consistently for me.

Iā€™ll track down the WTH.

Hi,

thank for the great AddOn.
Iā€™m working my way into PowerCalc a bit right now.
I was able to set up a normal consumption.
Can I also specify the make and model in the GUI?
Or does this currently only work via YAML?

How do I then set up, for example, a google Home mini as a consumer?

Thanks for a hint.
Greetings
Herbert

Hi, when you run one of the latest v1.0.0 betaā€™s there are profiles for Google Home mini included. After restarting they should automatically be discovered and give you the option to add with the GUI with a single click.

Should appear similar like this.

1 Like

Hi there,
I please need some help and advices.

Iā€™ve got some plugs which monitors the power consumption. They are connected via LocalTuja.
To get some data from them I uses a Rieman Sensor, so I have the overall Total and three Utility Meters, which gives the Daily, Weekly, Monthly Consumption.

In Powercalc I want to add this plugs to an existing group, but I donā€™t know which of the given sensors I should use - its seems I need to create another one, but I have no idea what I need and how to create.
Thanks a lot.

Thanks,

yes - itā€™s working. Great.

If i wanā€™t to create more Utility Meters - hourly - i can this configured by YAML. Is it possible to configure thi via GUI too?