Skip to content

(BUG) Hubitat app calls to Echo Speaks can trigger ambiguous speak() resolution and a spurious speak(null) invocation #1228

Description

@smcallah

Verify the following before opening an trouble issue

  • That OAuth is Enabled for the SmartApp under the IDE.
  • The App/SmartApp and Device Handler/Driver are using the latest code available.
  • You have reviewed the Echo Speaks Documentation for potential fixes.
  • That Both the Apps/SmartApps and Device Handlers/Drivers have been Published for You in the IDE. This is a Hubitat installation, so this SmartThings-specific item is not applicable.

About Your Setup

  • Hub Platform (SmartThings or Hubitat): Hubitat
  • How many devices are detected?: 12
  • iOS or Android?: N/A
  • Mobile App Version(Not required): N/A
  • App/SmartApp Version: 4.3.0.1
  • Device Handler/Driver Version: 4.3.0.1, modified 2025-09-10
  • Heroku Server Version: N/A

Expected Behavior

A Hubitat app should be able to call an Echo Speaks device's
executeSequenceCommand() command without any driver error being logged.

Current Behavior

The sequence plays correctly, but Echo Speaks logs a MethodSelectionException
for speak() every time executeSequenceCommand() is called from a Hubitat
app.

The same command executed manually from the Echo Speaks device page plays
without the error.

Steps to Reproduce (for bugs)

  1. Create or use a Hubitat app with an Echo Speaks device input.
  2. Select an Echo Speaks device.
  3. From the app, call:
echoDevice.executeSequenceCommand(
    'speak::<audio src="soundbank://soundlibrary/ui/gameshow/amzn_ui_sfx_gameshow_intro_01"/>'
)
  1. The sound plays, but Hubitat logs the error below.
  2. Run the identical command directly from the Echo Speaks device page. It
    plays without the error.

Context

I am building a Hubitat sound sequence app that sends SSML and Amazon Sound Library
audio using Echo Speaks. Playback works, including temporary volume changes,
but the driver logs this exception for every sequence started by the app.

The Echo Speaks driver defines speak() with optional parameters:

void speak(
    String msg,
    volume = null,
    String awsPollyVoiceName = sNULL,
    Boolean ignoreDoNotDisturb = false
)

Groovy generates these overloads:

speak(String)
speak(String, Object)
speak(String, Object, String)
speak(String, Object, String, Boolean)

Hubitat's app-to-device command dispatch appears unable to resolve those
overloads reliably.

I tested a local driver workaround:

  • Expose only one public speak(String) method.
  • Move the existing implementation to a private method with four required
    arguments.
  • Route Echo Speaks' internal volume and DND helpers to that private method.
  • Ignore a null message in the public wrapper.
  • Make fixLg() null-safe.

With that local patch, the following all worked without an error log:

  • One-step Amazon Sound Library audio sequence
  • Regular speech
  • Regular speech with temporary volume control
  • Native executeSequenceCommand() playback

The local patch should not be accepted unchanged because removing the public
multi-argument speak() overloads could affect other integrations. I am
reporting the issue so Echo Speaks can implement a backward-compatible fix.

Relevant log output:

[dev:192] error org.codehaus.groovy.runtime.metaclass.MethodSelectionException:
Could not find which method speak() to invoke from this list:
public void user_driver_tonesto7_Echo_Speaks_Device_733#speak(java.lang.String)
public void user_driver_tonesto7_Echo_Speaks_Device_733#speak(java.lang.String, java.lang.Object)
public void user_driver_tonesto7_Echo_Speaks_Device_733#speak(java.lang.String, java.lang.Object, java.lang.String)
public void user_driver_tonesto7_Echo_Speaks_Device_733#speak(java.lang.String, java.lang.Object, java.lang.String, java.lang.Boolean)
on line 6486 (method speak)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions