#triggering automation when sensor updated with exact same value

1 messages · Page 1 of 1 (latest)

plain raft
#

hi, i have a xiaomi scale that measures my weight. it reports that weight to a sensor in HA and I'm trying to trigger an automation every time i weigh myself. The problem i am having is that if my weight is the exact same as on my previous weigh in, the automation isn't triggered. I tried triggering the automation by looking at the last_changed, last_updated timestamps and the entity itself, but can't seem to figure it out. Is this how all sensors work or is the xiaomi ble integration not updating it because it sees it is the same value? is there any way i'm not seeing to solve this?

fallen yacht
#

Do you have the scale that also measures the impedance? I use this one as an indicator, I never experienced the weight and the impedance to stay the same

plain raft
#

yeah it has weight, impedance, impedance low and heart rate

#

i measure weight and impedance twice in a row and nothing updates the 2nd time. only the heart rate is different each time. and if it's not different last_update and last_changed don't change for weight and impedance

fallen yacht
#

But then something changes and you know that you weighted yourself. In that case I just send myself a notification that the weight did not change

plain raft
#

yeah but i'd prefer it to trigger an automation even if the weight didn't change cuz i'm setting it up so i have to weigh myself to turn off my alarm clock xD. won't want to measure impedance and heart rate every day

fallen yacht
#

I don't know how your scale works but mine measures impedance and weight at the same time. I can't select only one. Is your's different?

plain raft
#

mine measures weight first, then impedance and then pulse. i can stop after i see the weight results and only the weight gets sent to HA.

#

i found entities also have "last_reported" timestamp which should get updated even when the same value is reported but that doesn't get triggered either after i make the same measurement. probably somewhere in xiaomi_ble or regular bluetooth code it doesn't update entity if it sees the values are the same

fallen yacht
#

Home assistant will not write the same entry in the database again if it hasn't changed. I don't see any other option than to stand longer on the scale to also measure the impedance.

#

Do you use an esp32 with a bluetooth proxy by any chance? Then you might be able to capture the bluetooth reading and update an entity on the esp when a reading is captured

plain raft
#

no, i'm just using my rpi3 bluetooth radio

fallen yacht
#

Maybe you can capture the bluetooth event using home assistant as well. I don't know how though

plain raft
#

i saw that post when i was browsing around but mine is MJTZC01YM, dunno if i can make it work

fallen yacht
#

Looked around a bit, I'm pretty sure it would work if you used an esp32 as a bluetooth proxy

#

But I don't think you'll get there without one

plain raft
#

seems like every time i step on the scale signal strength is also reported as changed, even when the weight is the same. might be simpler. tho not as pretty of a solution

fallen yacht
#

Why not? You only want to know if you stepped on the scale, abort the alarm when any value changes, including the signal strength

plain raft
#

True, i guess i was just fixated on it being weight. I just need to test that it updates signal strength only when it's on. Dont want it to trigger when i'm not on the scale and turn off the alarm

#

Alarm was going for 50 minutes today before i got on the scale lmao

quartz urchin
#

if you use it every day in the morning you can add a time sensor to your automation. if it's a new day then trigger the automation even if the weight is identical
what does the automation ?

plain raft
quartz urchin
#

can you change the number of decimal of the weight ? maybe with more decimal you will be able to see a difference

plain raft
#

I will try but i think it was already set to 2 digits after decimal point and only displays 1 (2nd digit always 0)

plain raft