I think the third_reality_inc_3rvs01031z_motion is the real sensor and the sensor.helper_vibration_dryer is using the history stats integration - I am afraid I haven’t used that integration, so I can’t give you any info on it.
Caution: I use Zigbee2MQTT (and I think the OP is using ZHA) so you might need to translate some of my knowledge.
Anyway I can give you what I do (for my AC) and explain that so that might help you figure something out, I use a template binary sensor:
template:
- binary_sensor:
- name: "Invalid Run Dining AC"
unique_id: invalid_run_dining_ac
device_class: power
delay_on:
minutes: 1
state: >
{{ is_state('binary_sensor.dining_ac_vibration_vibration', 'on') and is_state('input_select.acdiningcontrol', 'Off') and (now() - states.sensor.dining_ac_vibration_y_axis.last_updated).total_seconds() < 30 }}
name and unique_id are needed to show up in the UI and be referenced from automations.
device_class makes it show up as a power icon in the UI.
delay_on means that it must be running continuously for 1 minute before it triggers - this is because the AC might take a moment to shut down after I turn it off.
The state can be broken down as follows
Is the sensor currently detecting vibration?
is_state('binary_sensor.dining_ac_vibration_vibration', 'on')
And,
Is the AC meant to be off currently?
is_state('input_select.acdiningcontrol', 'Off')
And,
Have I received an update from the sensor in the last 30 seconds?
(now() - states.sensor.dining_ac_vibration_y_axis.last_updated).total_seconds() < 30
This is because the sensor actually shows up like this:
- Boolean sensor that indicates if vibration is detected/clear (on/off)
- Separate sensors for movement in X, Y an Z directions.
So I am accounting for two issues:
- Firstly if you have a battery failure the device can get stuck in the “on” (motion detection state).
- The boolean sensor only changes if the state changes (clear/detected) where as the motion sensors constantly change due to the vibration.
Net result, my sensor only trips if all of the following are true:
- Motion is detected (and has been for 1 minute).
- The AC should be off (and has been for 1 minute)
- Updates have been received in the last 30 seconds.
I then simply feed this sensor into an automation:
triggers:
- trigger: state
entity_id:
- binary_sensor.invalid_run_dining_ac
from: "off"
to: "on"
actions:
- action: remote.send_command
data:
command: power
device: aircon_lg
target:
entity_id: remote.deskremote
Note: The vibration sensor isnt completely reliable - it sometimes goes to clear when it shouldn’t - this is actually helpful to me, because it means that I send the off command each time it cycles.