Skip to main content

Hey Sonos fans,

I’ve been playing around with the idea of using AI to automate some Sonos routines—nothing crazy, just little things like starting music when I walk in the door, or dimming the lights when I hit play. I know it’s usually done via IFTTT or Alexa routines, but I recently discovered a cool blog post showing how people have built smart home automations using simple AI-generated scripts—kinda got me thinking. (IFTTT has a whole section on Sonos workflows here)

So I tried an AI tool myself (let’s call it “deepseekai.free” for now). It generated a quick script to trigger a “Good Morning” playlist when motion was detected, and even slipped in a cheeky comment like “# Your tunes will be more reliable than your snooze button.” I died laughing—but the snippet actually worked pretty well as a starting point.

Has anyone else experimented with AI-assisted Sonos scripts or automations? Did it save time… or give you a funny comment you couldn’t unsee? I’d love to hear your successes (or epic fails).

— A Sonos user with too many routines to tap manually

No, I have not.  I have some routines in HA and other smart home controllers that play music when certain conditions are met, but I didn’t use AI to set these up.  For the scripts you had AI create, what software/hub is executing these scripts?


No, I have not.  I have some routines in HA and other smart home controllers that play music when certain conditions are met, but I didn’t use AI to set these up.  For the scripts you had AI create, what software/hub is executing these scripts?

Thanks Danny!
Good point — I should have clarified. I didn’t run the AI output directly on Sonos. I basically used the AI to generate some pseudo-code / example automation logic, then adapted it into my Home Assistant setup. So technically, HA was the one executing the routine, not Sonos alone.

For example, the AI suggested a trigger like “motion detected → play Good Morning playlist,” and I just translated that into HA’s YAML automation format. It was less about AI doing the execution, more about it giving me a quick draft to work from.

Curious though — have you found HA’s automation editor enough on its own, or do you also end up tweaking YAML by hand?


I haven’t done a lot of automation with HA, and nothing complex, so no YAML needed.  The most complex task I have is for additional lights and music to start when I hit the light switch in a room (and turn off when I turn off the light switch).  The only other automation I have with Sonos is a morning alarm, and that’s not in HA.  It could be done in HA, but I have not bothered to move it over since it’s working fine now.

I hesitate to automate with Sonos because I don’t think really I know what automations I would want, I don’t know my patterns, if I have any.  That’s the area where I think AI might help.  If AI could look at when, what, and where, I listen to Sonos based on my usage history, and create an automation based on that, I can see it being useful.

That said, if I ever struggle with a HA automation and need to do some YAML, I will remember to use AI to get me started.


Hey Sonos fans,

I’ve been playing around with the idea of using AI to automate some Sonos routines—nothing crazy, just little things like starting music when I walk in the door, or dimming the lights when I hit play. I know it’s usually done via IFTTT or Alexa routines, but I recently discovered a cool blog post showing how people have built smart home automations using simple AI-generated scripts—kinda got me thinking. (IFTTT has a whole section on Sonos workflows here)

So I tried an AI tool myself (let’s call it “deepseekai.free” for now). It generated a quick script to trigger a “Good Morning” playlist when motion was detected, and even slipped in a cheeky comment like “# Your tunes will be more reliable than your snooze button.” I died laughing—but the snippet actually worked pretty well as a starting point.

Has anyone else experimented with AI-assisted Sonos scripts or automations? Did it save time… or give you a funny comment you couldn’t unsee? I’d love to hear your successes (or epic fails).

— A Sonos user with too many routines to tap manually

What HA tool are you using for the motion detection? Can you link the blog post you referenced?


Hey Sonos fans,

I’ve been playing around with the idea of using AI to automate some Sonos routines—nothing crazy, just little things like starting music when I walk in the door, or dimming the lights when I hit play. I know it’s usually done via IFTTT or Alexa routines, but I recently discovered a cool blog post showing how people have built smart home automations using simple AI-generated scripts—kinda got me thinking. (IFTTT has a whole section on Sonos workflows here)

So I tried an AI tool myself (let’s call it “deepseekai.free” for now). It generated a quick script to trigger a “Good Morning” playlist when motion was detected, and even slipped in a cheeky comment like “# Your tunes will be more reliable than your snooze button.” I died laughing—but the snippet actually worked pretty well as a starting point.

Has anyone else experimented with AI-assisted Sonos scripts or automations? Did it save time… or give you a funny comment you couldn’t unsee? I’d love to hear your successes (or epic fails).

— A Sonos user with too many routines to tap manually

What HA tool are you using for the motion detection? Can you link the blog post you referenced?


Thanks for the follow-up!

Motion detection / HA stack: I’m testing this in Home Assistant. The PIR is a basic Zigbee motion sensor (Aqara P1) paired via ZHA (works the same with Hue Motion via Hue Bridge, too). When the sensor flips to on during a time window, HA fires a Sonos action.

What the automation does (HA):

only runs between 06:30–09:00 on weekdays

checks the Sonos player is idle (so it doesn’t interrupt music)

sets a gentle volume, then starts a playlist/Favorite

adds a cool-down so it doesn’t retrigger constantly

YAML sketch (trim to taste):

alias: Morning motion → Sonos “Good Morning”
trigger:
  - platform: state
    entity_id: binary_sensor.hall_motion
    to: 'on'
condition:
  - condition: time
    after: '06:30:00'
    before: '09:00:00'
  - condition: state
    entity_id: media_player.sonos_living_room
    state: 'idle'
action:
  - service: media_player.volume_set
    target: { entity_id: media_player.sonos_living_room }
    data: { volume_level: 0.20 }
  - service: media_player.play_media
    target: { entity_id: media_player.sonos_living_room }
    data:
      media_content_type: music
      # pick ONE that matches your setup:
      # media_content_id: "spotify:playlist:<playlist_id>"
      # media_content_id: "applemusic:playlist:p.<id>"
      # media_content_id: "FV:2/<favorite_uri>"   # Sonos Favorite (copy URI from HA dev-tools)
  - delay: "00:10:00"   # simple cool-down
mode: single


If you’re not using HA, this also works with IFTTT: motion event (e.g., SmartThings/Wyze) → IFTTT → Sonos “Play Favorite”.

Blog post I mentioned: it was a write-up about using LLMs to draft Home Assistant automations (basically: “let AI sketch the YAML, then you edit/test”). If links are OK here I can drop it; otherwise I can DM the exact article. The key idea was to prompt for time window + idle check + cool-down, which produced a decent first draft.

Happy to share the prompt I used if helpful!


Reply