#Detecting continual vibration

1 messages · Page 1 of 1 (latest)

main lynx
#

I'm working on an automation to report status of our dishwasher. (dishwasher is hard wired, so any power monitoring would involve removing it, wiring, and replacing. Not doing that).

So I'm working with three potential conditions: I have a vibration sensor that fits nicely underneath, and a door contact sensor that also monitors temp. The vibration seems the most reliable to determine if the dishwasher is running, but also can fire briefly if the dishwasher is opened/loaded.

What's the best way to trigger off continual (or rapid on-off) vibration for, say, a minute and a half? I have it now as
Trigger: " if door changes from open to close"
Then do: <if triggered by above> Actions: conditionally execute "if vibration is detected for 1:30"

I then trigger if the vibration sensor changes to clear for 2:00 then the dishwasher cycle is done / clean.

That seems a little convoluted. Suggestions on a cleaner way to do this?

night glade
#

So you can get sensors that can just clip around the cable if you don't want to rewire the dishwasher and still measure the power directly (CT clamps)

#

How I'd approach it depends exactly how your vibration sensor works - the only one i've played with just worked like a button - the state was the time of the last "vibration event" but idk if that's standard

#

For something that works like that - make a template binary sensor triggered to turn on based off the vibration sensor with auto_off set to 5s or something - this will then be "on" for 5s after any vibration event

#

You can then use that in your automation as just "template sensor on for 1:30"

neon tangle
#

the CT clamps only work if you can put them around either live or earth
if you put them around the whole cable they read nothing

night glade
#

oh yeah, forgot the ones in my house aren't actually CT clamps - they work on whole cables using fancy magnetic witchcraft my company's been developing, but look the same 🙂

long mantle
#

I do this with my washer and dryer, the vibration sensor shows detected while it's vibrating then goes clear when it stops. I have a series of if vibrating for x then off for y then vibrate for z and then nothing for 5 min it will set a helper to done

#

I have a button I have to click to clear it, ideally I'd like to get a vibration and tilt sensor but....

main lynx
#

went down the rabbit hole of binary template sensors, really confusing. I found an example of almost exactly what I'd want, but the sensor was in yaml. So apparently they want to have these templates more UI-based over yaml (so they don't always translate), but they don't give you the ability to do the 5 second delay on in the UI. Too bad, the UI method seems cleaner overall. I'm still futzing to see if I can figure out a way around the limitation with the UI method.

neon tangle
#

What makes you think you can't do a delay over the UI? You definitely can!

hasty wigeon
night glade
#

or the auto off, or a trigger

#

however you could do it with a datetime comparison (i.e. using the "button style" state example), something like: {{ states('vibration_sensor') | as_datetime + timedelta(seconds = 5) > now() }} - though i don't think that would actually work with now only refreshing every minute.. i can't remember how i got around that before in purely ui

steep swan
long mantle
#

indeed, for my dishwater specifically i monitor the power and do this same sort of dance because there is a very specific pattern of usage

#

i use the same binary helper to set when done and the kids push the button when they unload it to reset 😉

main lynx
# steep swan I have something similar, in my case with the power metering for some appliances...

that's what I'm trying to do...I think..looks like depending on the cycle and randomness of a dishwasher, I can have up to a 2 minute pause in vibration. So if vibration is detected, then set Dishwasher state to running. When vibration state goes to clear, then wait 2 minutes. <if vibration detected in that time, then it naturally resets> otherwise set Dishwasher state to Not running.

steep swan
#

As you say, the end detection is some minutes after ending, because of the pattern detection

#

If you are not in a hurry, I can leave here later my code, just in case it helps you 😉

main lynx
night glade
main lynx
night glade
#

yeah.. neither of those are correct syntax

main lynx
night glade
#

{{ is_state('binary_sensor.vibro','on') and states['binary_sensor.vibro'].last_changed + timedelta(seconds=5) > now() }}

main lynx
night glade
#

change the and for an or

main lynx
# night glade change the and for an or

interesting...on/running is instant, and off/not running it does delay but takes longer then 5 seconds...when it does update I see "This template updates at the start of each minute.", so that's probably why. Closest I've been and can probably work with this to get it going. Owe you a beer for that one.