-
Notifications
You must be signed in to change notification settings - Fork 33
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
skip all measurements below 80Kg ? #38
Comments
The idea of the component is to have one addition per user. Your problem is certainly related to the backup problem when you restart. Look for my node red to solve the problem. |
backup problem is solved when restart HA. I´m asking for a small hint to avoid measurements transferred to HA when another user is using the scale. Node red is no option. can you point me to code and file, where I can enter a small code to avoid transferring data when user is below 80Kg? For me, your inetrgation is working fine and I love it. But I have a wife and a kid using the scale as well. |
You can create a model sensor. This is the one you add to bodymiscale.
|
that´s what I also think about. But all other attributes are changing as well, like BMI, body_fat etc. wouldn't it be easier to implement a weight-range in the bodymiscale.yaml? like this: ` Mo: your Integration can now decide if the data is to write to bodymiscale.dirk or bodymiscale.Mo ? I´m not able to prog these changes, but maybe you can think about it and implement a multi user option... in the meantime I will play with template sensors in HA. Maybe there is a solution in a template sensor I can´t see at the moment... But thanx anyway for your quick reply! |
I understand but this is the reverse of this components. It should read your weight sensor. So you must have an independent weight sensor for each user. |
The Xiaomi App can handle this and automatically put the Data to the Person. Don´t know on which base, but I think it´s weight in relation to impedance. Thank you for pointing me in the right direction. Learned a lot, and slowly come into HA, Yaml, py |
But what you could (probably) easily do is split up the configuration such that
Granted the user must not let the weight ranges overlap. I also think each person's stats should be a device with each attribute being an entity |
If you use an ESP with ESPHome to collect the data, you can set this in the ESPHome config: - platform: xiaomi_miscale
mac_address: "50:FB:19:17:34:96"
weight:
name: "Xiaomi Mi Scale Weight"
id: weight_miscale
on_value:
then:
- lambda: |-
if (id(weight_miscale).state >= 69 && id(weight_miscale).state <= 77.49) {
return id(weight_user2).publish_state(x);}
else if (id(weight_miscale).state >= 77.50 && id(weight_miscale).state <= 83) {
return id(weight_user1).publish_state(x);}
impedance:
name: "Xiaomi Mi Scale Impedance"
id: impedance_xiaomi
on_value:
then:
- lambda: |-
if (id(weight_miscale).state >= 69 && id(weight_miscale).state <= 77.49) {
return id(impedance_user2).publish_state(x);}
else if (id(weight_miscale).state >= 77.50 && id(weight_miscale).state <= 83) {
return id(impedance_user1).publish_state(x);}
- platform: template
name: Weight Martijn
id: weight_user1
unit_of_measurement: "kg"
state_class: "measurement"
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Impedance Martijn
id: impedance_user1
unit_of_measurement: "ohm"
icon: mdi:omega
accuracy_decimals: 0
- platform: template
name: Weight Marleen
id: weight_user2
unit_of_measurement: "kg"
icon: mdi:weight-kilogram
state_class: "measurement"
accuracy_decimals: 2
- platform: template
name: Impedance Marleen
id: impedance_user2
unit_of_measurement: "ohm"
icon: mdi:omega
accuracy_decimals: 0 69 kg to 77.49 kg is assigned to Marleen All other values are ignored. You could also include the impedance to further finetune it, but in my case they are too close to each other to be useful. |
Did you solve your problem? |
This is more a question.
Is it possible to skip all data/update/states/attributes when a person is using a scale who is below 80Kg?
Reason is:
Me, main user of the intergration, is above 80Kg. But all others in our household are below 80Kg nd they are not interested in details exept weight the scale is showing when they use it.
But that destroyes my longterm data.
So, it is possible to avoid all data transferred or stored when the user is below 80Kg?
Of course, a multi user arrangment would be better, but for the beginning that would help to skip all below 80Kg.
Thanx
The text was updated successfully, but these errors were encountered: