#Bug: REST command integration

1 messages · Page 1 of 1 (latest)

tidal walrus
#

Cant add rest command to automation..

#

Bug: REST command integration

onyx radish
#

it's not clear what you did

#

the second picture (please use formatted text, not images of text) implies that you put the definitions in configuration.yaml), but it's not clear what you did to get the left image

tidal walrus
onyx radish
#

agai

scarlet thistleBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

onyx radish
#

text

#

you're repeating what you posted above

#

did you choose the rest_command.xx actions?

tidal walrus
#
rest_command:
  example_request:
    url: "http://example.com/"
  ma_add_to_playlist:
    url: https://l7t7582ssaiorltwaskuylypkcyjdibw.ui.nabu.casa/api
    method: POST
    headers:
      accept: "application/json, text/html"
    payload: >
      {
        "message_id": "1",
        "command": "music/playlists/add_playlist_tracks",
        "args": {
          "db_playlist_id": {{playlist_id}},
          "uris": [ {{track_url}} ]
        }
      }
    content_type:  'application/json; charset=utf-8'
onyx radish
#

how did you define what went into the "Then do..." part?

tidal walrus
#
alias: Add to song to playlist
description: ""
triggers:
  - trigger: conversation
    command:
      - Add it to track {track_id}
conditions:
  - condition: device
    device_id: 382288c47f6746fe7e37ee3b6409f162
    domain: media_player
    entity_id: 404911e56fc7c1b74cd4c0ca1883a3b2
    type: is_playing
actions:
  - action: rest_command.example_request
    response_variable: response
  - action: rest_command.ma_add_to_playlist
    response_variable: response
mode: single
tidal walrus
#

example_request is just a sanity test

onyx radish
#

did you restart HA after adding the commands to configuration.yaml?

tidal walrus
#

yes

#

reloaded yaml and restart

onyx radish
#

you would need to restart HA, not just reload YAML

tidal walrus
#

i did

onyx radish
#

test in devtools -> Actions

tidal walrus
#

ok i will

#

2nd restart did the trick.... 🤷‍♂️

#

thanks