Thanks a lot jbardi! I added hass as a sudoer. Getting closer…
I can now successfully call the shell command service from the Home Assistant user interface. It’s still not triggering when the door opens though. Here’s my code:
shell_command: play_sound: sudo /usr/bin/omxplayer /usr/share/scratch/Media/Sounds/Instruments/Trumpet2.wav
automation: alias: 'Play Audio File' trigger: platform: state entity_id: binary_sensor.aeotec_dsb29_doorwindow_sensor_2nd_edition_sensor_3 state: on action: service: shell_command.play_sound
I’ve double-checked the entity ID. For example, here’s my customize code in the same configuration file:
customize: # Only the 'entity_id' is required. All other options are optional. binary_sensor.aeotec_dsb29_doorwindow_sensor_2nd_edition_sensor_3: friendly_name: Front Door