controllerx icon indicating copy to clipboard operation
controllerx copied to clipboard

[BUG] Mapped service call fails with xxx is not recognized as a template

Open nielsrune opened this issue 7 months ago • 0 comments

Bug report

Description

Since migrating my controller due to a changed service call in Spotcast, the service call fails. The last two lines in the logs below are outputted without switching log level to debug.

In HA > Developer tools > actions I can run the exact same service call with succes. (Only diff is that service: must be action: in HA). I call the service with a long press on the two dots button which I can see in the logs is triggering correctly.

Since the service call is working from withing HA, I believe it is a issue with the otherwise great ControllerX project.

Other standard mappings on the same controller is working (removed below with [...])

Background: Since the HACS project Spotcast was forced to do a rewrite due to Spotify changing their API, a new service/action spotcast.play_media was made instead of the former spotcast.start.

I am aware that the currently working state of Spotcast is still an unstable alpha release. However, everything seems working at my end expect for this service call done through ControllerX

Additional information

  • Devices involved:
    • Model: IKEA E2123 as a Media Player Controller
  • Integration: z2m
  • AppDaemon version: Home assistant addon v. 0.16.7
  • ControllerX version: v4.29.0
  • HACS version (if installed from there): v2.0.5
  • Home Assistant Core version: v2025.5.3

AppDaemon app configuration

MediaController:
  module: controllerx
  class: E2123MediaPlayerController
  integration: 
    name: z2m
    listen_to: mqtt
  controller: Bad mediekontrol
  media_player: media_player.nest_badevaerelse
  mapping:
    # [...]
    dots_2_long_press:
      - service: spotcast.play_media
        data:
          media_player:
            entity_id: media_player.nest_badevaerelse
          spotify_uri: spotify:playlist:VALID_URI
          account: VALID_STRING
          data:
            volume: 25
            repeat: context
            shuffle: true
            random: true
            random_song: true

Logs

2025-06-09 15:36:17.220782 INFO MediaController: 🏃 Running `Service (spotcast.play_media)` now
2025-06-09 15:36:17.231531 DEBUG MediaController: `media_player.nest_badevaerelse` is not recognized as a template
2025-06-09 15:36:17.238402 DEBUG MediaController: `spotify:playlist:VALID_URI` is not recognized as a template
2025-06-09 15:36:17.248700 DEBUG MediaController: `VALID_STRING` is not recognized as a template
2025-06-09 15:36:17.258791 DEBUG MediaController: `context` is not recognized as a template

...

2025-06-09 15:36:17.437608 WARNING HASS: Error calling Home Assistant service default/spotcast/play_media
2025-06-09 15:36:17.469171 WARNING HASS: Code: 400, error: 400: Bad Request

Additional Context

Add any other context or screenshots about the bug here.

nielsrune avatar Jun 09 '25 14:06 nielsrune