Disable motion sensor when volume is above 2?

Disable motion sensor when volume is above 2

Hey everyone,

I’m trying to run a simple automation which disables my motion sensor when the volume of the Echo Dot is above 2 but it’s not working at all :

Any idea what I’m doing wrong here ?
Thanks for your help

My config

version core-2023.4.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.10.10
os_name Linux
os_version 5.15.90
arch x86_64
timezone Europe/Paris
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.32.1
Stage running
Available Repositories 1265
Downloaded Repositories 8
Home Assistant Cloud
logged_in true
subscription_expiration 17 mai 2023 à 02:00
relayer_connected true
relayer_region eu-central-1
remote_enabled true
remote_connected true
alexa_enabled true
google_enabled true
remote_server eu-central-1-12.ui.nabu.casa
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 9.5
update_channel stable
supervisor_version supervisor-2023.04.0
agent_version 1.4.1
docker_version 20.10.22
disk_total 30.8 GB
disk_used 3.1 GB
healthy true
supported failed to load: Unsupported
board ova
supervisor_api ok
version_api ok
installed_addons Terminal & SSH (9.6.1), Duck DNS (1.15.0), File editor (5.5.0)
Dashboards
dashboards 1
resources 1
views 1
mode storage
Recorder
oldest_recorder_run 17 avril 2023 à 07:18
current_recorder_run 21 avril 2023 à 08:21
estimated_db_size 42.46 MiB
database_engine sqlite
database_version 3.38.5
Spotify
api_endpoint_reachable ok

Hi there, first of all: How to help us help you - or How to ask a good question
So you can post the yaml which we can read properly instead of the screenshot.

If you look at the media_player Media Player - Home Assistant
Then you’ll see the range is between 0 - 1. 1 Being 100% volume 0 is 0$
You will have to figure out what 2 is in that range. Using a template in the dev tools you can see what it produces:

{{ state_attr('media_player.echo_dot_salle_de_bain', 'volume_level') }}

Wow thanks for the info!

I made it work now setting the correct value.