bramstroker / homeassistant-powercalc

Custom component to calculate estimated power consumption of lights and other appliances
MIT License
940 stars 251 forks source link

Add humidifiers to fixed mode #425

Closed denysdovhan closed 2 years ago

denysdovhan commented 2 years ago

I'm trying to add my humidifier (which previously belonged to the fan domain), but it's not whitelisted as a correct device.

This should not be a problem though. I would expect this to work:

- entity_id: humidifier.air_humidifier
  fixed:
    states_power:
      on: 25
  standby_power: 0.5

I suppose it would even work with linear mode because humidifiers have min_humidity, max_humidity, and target_humidity attributes.

Thanks for the project! Even been looking for such integration for a long time! Thanks for making it!

bramstroker commented 2 years ago

Added support with #427. This has been merged into master. Are you able to test with the master branch? I was only able to do some testing with setting up a MQTT humidifier, but I don't have a real humidifier to test with.

nepozs commented 2 years ago

I suppose it would even work with linear mode because humidifiers have min_humidity, max_humidity, and target_humidity attributes.

Could you explain how min, max or target humidity can affect power draw? I understand that if it expose also current humidity - so we can determine if it works or not, but the attributes you have mentioned are not enough I think.

bramstroker commented 2 years ago

@nepozs You got me thinking some more. But it makes no sense to have a humidifier working with linear mode. Think I will revert my additions for that. I implemented by looking at min, max and current humidity value. But I suspect a humidifier will just switch on until target humidity is reached. Same as a freezer or heater would work. Let's assume the target humidity is 40. Regardless of the current humidity being 10, 15, 20 I suspect will take the same amount power to get the humidity up to 40, and the humidifier will turn off at 40. Until at 39 it will turn on again.

I don't have a real smart humidifier to see what the real pattern is and how it behaves. Maybe @denysdovhan can elaborate about this some more. Or check the state history in HA.

denysdovhan commented 2 years ago

My humidifier has 4 different modes: Low, Medium, High, and Humidity. The first three modes will change the intensity of the emission. I suppose this also affects power consumption.

Though you're right I doubt target humidity actually tells anything about power consumption. Additionally, the logic might differ from model to model.

denysdovhan commented 2 years ago

I'll try to measure the power consumption of my humidifier in different modes next week. Then I'll be able to specify precise power via states_power and attributes.

My humidifier attributes look like this:

min_humidity: 30
max_humidity: 80
available_modes:
  - Low
  - Medium
  - High
  - Humidity
humidity: 60
mode: Humidity
device_class: humidifier
friendly_name: Air Humidifier
supported_features: 1

The sensor would look like this:

sensor:
  - platform: powercalc
    entity_id: humidifier.air_humidifier
    fixed:
      power: 12
      states_power:
        mode|Low: 5
        mode|Medium: 10
        mode|High: 15
        mode|Humidity: 12
bramstroker commented 2 years ago

@denysdovhan Thanks for the input! Let me know if you have the measurements ready. states_power for the humidifier should already be supported now with the master branch version.

bramstroker commented 2 years ago

@denysdovhan You have got enough functionality for the humidifier, right? Can we close this issue?

kuduacz commented 2 years ago

So? whats with power depend of mode of humidifier? i have 3 modes and have no idea how to use it.

bramstroker commented 2 years ago

The creator of this issue suggested his humidifier used a relatively fixed amount of power. So he measured the amount of power for his humidifier on each mode (using a power meter) and powercalc allows to set the power for each mode:

Like this:

sensor:
  - platform: powercalc
    entity_id: humidifier.air_humidifier
    fixed:
      states_power:
        mode|Low: 5
        mode|Medium: 10
        mode|High: 15

The power values and attributes are different for each humidifier model, so you should change them to fit your use case.

denysdovhan commented 2 years ago

I've finally measured my humidifier's power. Here's what I got:

sensor:
- entity_id: humidifier.air_humidifier
        fixed:
          states_power:
            mode|Low: 18
            mode|Medium: 21
            mode|High: 23
            mode|Humidity: 21
        standby_power: 4

However, in Humidity (auto) mode. The power can change dramatically depending on the current humidity level (from 4W to 26W). I've specified the middle value for my Humidity mode, bad I guess it's gonna be far from realistic.