Greetings. This is my first attempt at creating an automation by editing yaml files, and this is my first post on the forums, so try not to be too hard on me.
I’ve been using Home Assistant for a month or so to control lights. This week, I started working with Lyrion Music Server and gave Volumio the boot. I have five Pi Core Players around the house and two tablets serving as dashboards. For one of the players, I’m working on designing a component to sit on my AV shelf and display album artwork and playlist when music is playing. I didn’t know how to get started, so I created an automation with the web interface so that I could get the IDs needed, but didn’t have the right action information, so I set it up to send my phone a notification when music starts playing. After that, I went into yaml to work on manual configuration.
I searched Google and found a number of articles, some as far back as 2018, some newer, but many getting much more in the weeds than what I’m trying to do. I searched these forums and didn’t find quite what I’m looking for. I just need to hit a URL.
Code snippets. (I hope I have these right, I had to type them by hand):
configuration.yaml (simply added to the end of the file):
shell_command:
playing_started: curl http://10.10.3.150/playingStarted.php
playing_stopped: curl http://10.10.3.150/playingStopped.php
playing_paused: curl http://10.10.3.150/playingPaused.php
automations.yaml:
- id: '------------'
alias: Start Playing Music
description: ''
triggers:
- device_id: ----------------
domain: media_player
entity_id: ------------
type: Playing
trigger: device
conditions: []
actions:
- parallel:
- action: notify.mobile_app_iphone_13_pro
metadata: {}
data:
message: Music Started Playing
- action: shell_command.playing_started
mode: single
If I comment out the shell command, save and do a quick reload, when I start playing music, I get a phone notification. So far, so good. If I uncomment that line, save and do a quick reload, when I start playing music, I still get the phone notification, but I also get this error in Home Assistant:
“The automation ‘Start Playing Music’ (automation.start_playing_music) has an unknown action: shell_command.playing_started.”
If I look at the automation itself in the web interface, I see two actions set to run in parallel, with the second listing:
“Error in describing action: Cannot read properties of undefined (reading ‘playing_started’)”
It acts like it’s unaware that the shell command exists. I’m not sure how to solve it. Please advise.