-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xiaomi purifier support #2755
Comments
Need to give it a thought. Or you might use the composite mode: |
Looking at your sheet it just seems a mapping between state and power would be sufficient. https://docs.powercalc.nl/strategies/fixed/#power-per-state Not sure if |
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) |
I'm not understanding fully. You have made the favorite settings only to measure the power? So for example:
When you have the values for each motor you could use powercalc:
sensors:
- create_group: Humidifier
hide_members: true
entities:
- entity_id: sensor.oczyszczacz_motor_speed
linear:
calibrate:
- 300 -> 1
- 310 -> 1.5
- 320 -> 2
- 500 -> 5
- entity_id: sensor.oczyszczacz_second_motor_speed
linear:
calibrate:
- 600 -> 2.5
... 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. But with current possibilities you can use the configuration as explained above. |
"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:
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 :) |
@theundefined Could you setup the sensor as suggested with the calibration values you mentioned in your latest reply and see how it goes? When it's working fine I will see what development is needed to get it integrated in a profile for the library. |
@theundefined Just wanted to let you know I've worked on some development to facilitate your use case. I have implemented 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 {
"name": "My device",
"measure_method": "manual",
"measure_device": "xx",
"device_type": "generic_iot",
"calculation_strategy": "composite",
"composite_config": {
"mode": "sum_all",
"strategies": [
{
"condition": {
"condition": "numeric_state",
"above": 70
},
"fixed": {
"power": 20
}
},
{
"fixed": {
"power": 2
}
}
]
}
} Only challenge left is the entity_id's which are variable. Maybe I will implement some possibility for variables in model.json where the form is dynamically extended with extra fields. Are you able to test if the new composite sum_all mode works for you? |
Checklist
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
The text was updated successfully, but these errors were encountered: