Open
Description
Checklist
- I have filled out the template to the best of my ability.This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).This issue is not a duplicate feature request of previous feature requests.
Is your feature request related to a problem? Please describe.
There is lack of support of fan / purifier
Describe the solution you'd like
Add purifier to library
Describe alternatives you've considered
Just add it... An alternative is calculate power usage independent for every motor and group it (?)
Additional context
There is something like xiaomi purifer. I use model Xiaomi Air Purifier Pro, which identify in home assistant as zhimi.airpurifier.v7.
It have have two motors inside, which works partly independent. I've stored power usage of it in https://docs.google.com/spreadsheets/d/19eC3LRcdEiU-u6yyms163hdAFy7Xp63k73F2aA55OyQ/edit?usp=sharing. Motor speed is under sensor.oczyszczacz_motor_speed and secondary motor speed under sensor oczyszczacz_second_motor_speed
Activity
bramstroker commentedon Dec 3, 2024
Need to give it a thought.
But I also wanted to suggest to just create 2 seperate linear sensor and group them.
Or you might use the composite mode:
https://docs.powercalc.nl/strategies/composite/
Which will probably also be the solution I want to investigate.
Would be nice to have a possibility to use composite configuration in
model.json
so a profile can be made for this and eventually also be submitted to the library, so everyone with this device can use the profile.bramstroker commentedon Dec 3, 2024
Looking at your sheet it just seems a mapping between state and power would be sufficient.
So you can just use
states_power
:https://docs.powercalc.nl/strategies/fixed/#power-per-state
Not sure if
mode
is the actual state of the entity, or some attribute of the entity?When you can share from developer tools I might give you an example how to configure it.
theundefined commentedon Dec 3, 2024
States aren't useful here. favorite etc - are only manual modes where I can control motors to measuer power :). Apart of manual mode there is the most usefull auto mode where speed of motors depends on the pollution in room.
in developer tools i have for fan.oczyszczacz:
and for sensor.oczyszczacz_motor_speed:
(simmilar for second_motor)
for number.oczyszczacz_favorite_level:
(but it's only settable and used when fan is in "favorite" state - not when is in "auto" mode)
bramstroker commentedon Dec 7, 2024
I'm not understanding fully.
Essentially you want to calculate power depending on the speed of both motors right?
So when the mode is auto HA will constantly be updated with the actual motor speeds and we can calculate power accordingly.
You have made the favorite settings only to measure the power?
I would suggest to do that more structured so you can determine a linear scale for them.
So for example:
When you have the values for each motor you could use
linear
strategies with the calibrate feature in conjunction with group logic.You can also do this with the GUI flow, then you'll need to create 3 sensors.
I might have a look into supporting some mode for the composite strategy: https://docs.powercalc.nl/strategies/composite/, so you the strategies can be combined (summed). Currently only one strategy will apply depending on matching condition.
Advantage is we can create a single sensor this way, and don't need to use grouping functionality.
But with current possibilities you can use the configuration as explained above.
theundefined commentedon Dec 7, 2024
"favorite" modes are defined - I can't controll every fan. I can only setup modes:
I know more or less that I need to group power of:
1.2W W linear as 1.2W for 0 rpm
2W linear when 330W
10W linear when 500W
I can do it manually, but I think that there would be great to add such possibility basing on 2 linear sensors for models in library :)
bramstroker commentedon Dec 8, 2024
@theundefined Could you setup the sensor as suggested with the calibration values you mentioned in your latest reply and see how it goes?
Let it run a few days and try different settings and see if the power consumption of virtual sensor matches the consumption records by smart plug closely.
When it's working fine I will see what development is needed to get it integrated in a profile for the library.
bramstroker commentedon Dec 31, 2024
@theundefined Just wanted to let you know I've worked on some development to facilitate your use case.
I have implemented
sum_all
mode for composite strategy:https://docs.powercalc.nl/strategies/composite/#sum-all-mode
Which essentially allows you to combine multiple calculations in one sensor. The resulting power calculation will be the sum of all underlying strategies which match the conditions.
This configuration is also supported in library profiles
model.json
files:Only challenge left is the entity_id's which are variable.
So when we want to add profile to the library
sensor.oczyszczacz_motor_speed
is different for other users.We might have a look at using some wildcard, but that's also error prone.
Maybe I will implement some possibility for variables in model.json where the form is dynamically extended with extra fields.
Similarly as in HA scripts and blueprints.
In this scenario there will be 2 variables:
motor_1_speed_entity
andmotor_2_speed_entity
Will give it some more thought.
Are you able to test if the new composite sum_all mode works for you?
github-actions commentedon Jan 31, 2025
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
theundefined commentedon Jan 31, 2025
Yes, I will try it(but I don't have much time at the moment)