Hello I have Home Assistant OS installed
- Core 2024.12.5
- Supervisor 2024.12.0
- Operating System 14.1
- Frontend 20241127.8
I am having issues with creating a good automation with a sensor that keeps going back to “Cleared” meaning no vibration, like it is resetting its counter.
In the past with other sensors like a power sensor I can do something like; if power consumption is high. Wait until it is off for 6 minutes and then send voice announcement.
This vibration sensor is doing this crap though
Please keep in mind that the dryer was on the entire time. I tried different things like setting vibration sensor to low, med, high, highest. Similar results.
So how would I create an automation where I am searching for a minimum of 5 “motion detected” over the course of 5 minutes = Start
Wait for motion to be set to no motion detected for 5 minutes then proceed to send out voice announcements.
Trigger "Detecting Motion"
For Duration
3 minutes.
This condition does not ever come true.
Another thing I tried
Trigger "Detecting Motion"
dont set duration timers
AND IF
No Motion
For Duration
3 Minutes
Except this will probably trigger way too often with too many false positives.
Any suggestions?
Still having issues but here is the direction I have taken.
Created a new sensor/helper using YAML under configurations.
# Ties to a History Stats Helper
# This is keeping track of how often sensor switches to on in five minutes
sensor:
- platform: history_stats
name: helper_vibration_dryer
entity_id: binary_sensor.third_reality_inc_3rvs01031z_motion
state: "on"
start: "{{ now() - timedelta(minutes=5) }}"
end: "{{ now() }}"
After a lot of troubleshooting (it did not originally look like what I just posted above).
It does seem to measure stuff… not sure why its doing decimal increments.
Anyways my automation does not work because it doesnt do jack.
alias: Dryer Vibration Automation
description: Notify when dryer stops running
triggers:
- entity_id: binary_sensor.third_reality_inc_3rvs01031z_motion
trigger: state
conditions: []
actions:
- choose:
- conditions:
- condition: template
value_template: |
{{ states('sensor.helper_Vibration_Dryer') | int >= 5 }}
sequence:
- target:
entity_id: input_boolean.dryer_running
action: input_boolean.turn_on
data: {}
- conditions:
- condition: state
entity_id: binary_sensor.third_reality_inc_3rvs01031z_motion
state: "off"
for:
minutes: 5
sequence:
- target:
entity_id: input_boolean.dryer_running
action: input_boolean.turn_off
data: {}
- data:
title: Dryer Update
message: Dryer has halted or finished its cycle.
action: notify.notify
- data:
cache: false
entity_id: media_player.googlehome9088
message: Dryer has halted or finished its cycle.
action: tts.cloud_say
mode: single
guessing its because I am searching for values of 5, and higher but I am stuff at 0.XX values?
Anyone know why?
since int is designed for whole numbers, will it be as easy as doing
{{ states('sensor.helper_Vibration_Dryer') | float >= 0.05 }}
Anyways spent whole day on this, so obviously out of my depth. Any assistance appreciated.
Fixed it.
Create a sensor to keep track of how often it goes into a “motion” mode, indicating vibrations are detected.
Create a sensor in configuration.yaml file.
# This is keeping track of how often it switches to "ON" or motion detected in five
# minutes
sensor:
- platform: history_stats
name: helper_vibration_dryer
entity_id: binary_sensor.third_reality_inc_3rvs01031z_motion
state: "on"
type: count
start: "{{ now() - timedelta(minutes=5) }}"
end: "{{ now() }}"
Create an input Boolean in Helpers
name: dryer_running
icon: mdi:fire
Entity ID: input_boolean.dryer_running
Area: Optional
Label: Optional
Voice Assistant: No need to expose them
Enable: true
Visible: true
Create the automation once the prerequisites are setup
alias: Dryer Notification
description: Notify when dryer stops running
triggers:
- entity_id:
- sensor.helper_vibration_dryer
trigger: state
conditions: []
actions:
- choose:
- conditions:
- condition: template
value_template: |
{{ states('sensor.helper_Vibration_Dryer') | int >= 5 }}
sequence:
- target:
entity_id: input_boolean.dryer_running
action: input_boolean.turn_on
data: {}
- conditions:
- condition: state
entity_id: binary_sensor.third_reality_inc_3rvs01031z_motion
state: "off"
for:
minutes: 5
sequence:
- target:
entity_id: input_boolean.dryer_running
action: input_boolean.turn_off
data: {}
- data:
title: Dryer Update
message: Dryer has halted or finished its cycle.
action: notify.notify
- data:
cache: false
entity_id: media_player.googlehome9088
message: Dryer has halted or finished its cycle.
action: tts.cloud_say
mode: single
So far its been working great for me. Hope this helps others.
1 Like
@chris1bass THANK YOU. I got the same sensor and was trying to do the same thing, this was a huge help. I actually bought three of them and did some science - if it helps, I noticed that different spots on my dryer brought more consistent “motion detected” results. For my dryer, it was more toward the front = more consistent with the sensitivity on the sensor turned all the way up.
Glad it was able to get you going.
Question what type of dryer design do you have? For example, this is mine.
I just assumed the fat rounded door would result in inconsistent measurements, but I haven’t moved it around much yet.
My next-door neighbor with his car that is louder than a Harley Davidson at startup keeps triggering it once in a while for me, so I am still fine tuning it. My windows rattle for goodness’ sake lol.