Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharkIQ authentication error #123392

Open
jnooraga opened this issue Aug 8, 2024 · 95 comments
Open

SharkIQ authentication error #123392

jnooraga opened this issue Aug 8, 2024 · 95 comments

Comments

@jnooraga
Copy link

jnooraga commented Aug 8, 2024

The problem

Receiving an error while loading the Shark IQ integration after updating to 2024.8.0:

I have verified my login works through the sharkclean.com website.

What version of Home Assistant Core has the issue?

core-2024.8.0

What was the last working version of Home Assistant Core?

core-2024.7.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Shark IQ

Link to integration documentation on our website

https://www.home-assistant.io/integrations/sharkiq

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-08-08 11:08:33.730 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry <email> for sharkiq
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 67, in async_setup_entry
    if not await async_connect_or_timeout(ayla_api):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 40, in async_connect_or_timeout
    await ayla_api.async_sign_in()
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 106, in async_sign_in
    self._set_credentials(resp.status, await resp.json())
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 84, in _set_credentials
    self._access_token = login_result["access_token"]
                         ~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'access_token'
2024-08-08 11:08:43.983 DEBUG (MainThread) [homeassistant.components.sharkiq] Initialize connection to Ayla networks API
2024-08-08 11:08:44.253 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry <email> for sharkiq
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 67, in async_setup_entry
    if not await async_connect_or_timeout(ayla_api):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 40, in async_connect_or_timeout
    await ayla_api.async_sign_in()
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 106, in async_sign_in
    self._set_credentials(resp.status, await resp.json())
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 84, in _set_credentials
    self._access_token = login_result["access_token"]
                         ~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'access_token'

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Aug 8, 2024

Hey there @JeffResc, @funkybunch, mind taking a look at this issue as it has been labeled with an integration (sharkiq) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of sharkiq can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign sharkiq Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


sharkiq documentation
sharkiq source
(message by IssueLinks)

@wnaylor
Copy link

wnaylor commented Aug 9, 2024

Same problem here. Won't work after updating to HA core-2024 8.0

@craig0r
Copy link

craig0r commented Aug 9, 2024

Yep, also seeing the exact same problem here!

@JeffResc
Copy link
Contributor

JeffResc commented Aug 10, 2024

I am also able to reproduce this. It looks like the backend API used by the integration had some changes made and I'm having trouble finding any public documentation for this. I can confirm that this doesn't have to do with any specific HA core version and has to do with the upstream sharkiq pypi package. I can also confirm that the app ID and app secret constants still seem to be correct

It looks like the previously working call to /users/sign_in.json is now resulting in a 403 with the error "You are forbidden to perform this operation" with no reason as to why this API call is no longer functioning as it originally was. I will continue to look into this, but I'm not seeing an immediate resolution without reverse engineering the login logic is and re-implementing it in the upstream dependency.

Issue created on upstream repo: JeffResc/sharkiq#51

@funkybunch
Copy link
Contributor

funkybunch commented Aug 20, 2024

Worth noting that this does not seem to affect all installations. Additional analysis is being done to determine the root cause.

Instead of simply responding "yeah its happening to me too" please include your logs, model, and region to help us get to the bottom of the issue, otherwise it is not helpful.

Likewise, if you have a working installation, please do leave a comment with your model and region to help us determine if there is a pattern.

Finally, some users have reported despite successfully logging into the app with the same credentials, both the app and HA worked after resetting their password. Please try this and let us know if it worked for you as well. Any and all data points are helpful at this stage.

@craig0r
Copy link

craig0r commented Aug 20, 2024

The integration is broken for me in Canada. I have both a Shark IQ and a Shark AI device integrated and previously both working perfectly. Below is the log when I attempt to reload the integration:

Logger: homeassistant.config_entries
Source: config_entries.py:604
First occurred: August 19, 2024 at 4:57:12 PM (2 occurrences)
Last logged: 11:44:54 AM

Error setting up entry craig.webster@gmail.com for sharkiq
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 67, in async_setup_entry
    if not await async_connect_or_timeout(ayla_api):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 40, in async_connect_or_timeout
    await ayla_api.async_sign_in()
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 106, in async_sign_in
    self._set_credentials(resp.status, await resp.json())
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 84, in _set_credentials
    self._access_token = login_result["access_token"]
                         ~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'access_token'

@craig0r
Copy link

craig0r commented Aug 20, 2024

I apologize that I didn't attempt this in my previous comment, but I've just tried resetting my password and it didn't work. however, it is now giving me a different error log. Hope this helps!

Logger: homeassistant.components.sharkiq
Source: components/sharkiq/config_flow.py:59
integration: Shark IQ (documentation, issues)
First occurred: 1:34:24 PM (2 occurrences)
Last logged: 1:35:40 PM

string indices must be integers, not 'str'

I'd be curious to know how to change the existing credentials on the integration, as I could only figure out how to input my updated password by using "Add Entry" on the integration config. and SharkIQ is not available in the "Application Credentials" page. Just to be sure, I also deleted my (backed up) existing SharkIQ integration and re-added it with the new password, but the log output is the same.

@Sleeepy2
Copy link

Not sure if mine is the same problem however I can not set it up
Model is UR1410ZWCA
In North America

Logger: homeassistant.config_entries
Source: config_entries.py:604
First occurred: 2:43:25 pm (2 occurrences)
Last logged: 2:47:26 pm

Error setting up entry sleeepy2@gmail.com for sharkiq
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 72, in async_setup_entry
    shark_vacs = await ayla_api.async_get_devices(False)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 222, in async_get_devices
    devices = [SharkIqVacuum(self, d, europe=self.europe) for d in await self.async_list_devices()]
                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 208, in async_list_devices
    devices = await resp.json()
              ^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 80, in json
    return await super().json(*args, loads=loads, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1199, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html;charset=utf-8', url='https://ads-field-39a9391a.aylanetworks.com/apiv1/devices.json

@vaeron
Copy link

vaeron commented Aug 23, 2024

I began having failures immediately upon upgrading my HA to 2024.08.0. I am running on an Ubuntu VM. Region is US. Without thinking I removed the configuration and this is what I was met with when I tried to set it back up. Logs from my first attempted logon:

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup

result = await component.async_setup_entry(hass, self)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 67, in async_setup_entry

if not await async_connect_or_timeout(ayla_api):

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 40, in async_connect_or_timeout

await ayla_api.async_sign_in()

File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 106, in async_sign_in

self._set_credentials(resp.status, await resp.json())

^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 80, in json

return await super().json(*args, loads=loads, **kwargs)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1199, in json

raise ContentTypeError(

aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url='https://user-field-39a9391a.aylanetworks.com/users/sign_in.json'

I then reset my password and was met with a failed to connect and this in the logs (I did verify that I can connect to sharkclean's website with the new password):

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/config_flow.py", line 57, in _validate_input
    await ayla_api.async_sign_in()
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 106, in async_sign_in
    self._set_credentials(resp.status, await resp.json())
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 84, in _set_credentials
    self._access_token = login_result["access_token"]
                         ~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'access_token'

@tombrant
Copy link

My Robot model is RV2520A0US. The latest integration fails with the access_token error and a 403 response code as reported above. I started using the HA integration in May 2024 (and successfully extended it for room specific cleaning with a custom integration based on the logic in jeffresc/sharkiq). Prior to May, I started running into problems using the Google Assistant with the SharkClean skill. I had been using it to schedule room-based cleaning successfully, but it suddenly stopped working. Alexa's SharkClean skill also failed to work, so I had no solution to schedule specific rooms for cleaning. The reason I mention the above is that I just unlinked and relinked the skills on Alexa and Google Assistant. There was a hint in the link skill page in the Alexa app that says under the heading 'What's new' that they 'replaced the web authorization URI'. There was no information like that on Google Assistant's skill, but when I tried it to perform a room-specific cleaning operation, it worked.

@craig0r
Copy link

craig0r commented Aug 23, 2024

My Robot model is RV2520A0US. The latest integration fails with the access_token error and a 403 response code as reported above. I started using the HA integration in May 2024 (and successfully extended it for room specific cleaning with a custom integration based on the logic in jeffresc/sharkiq). Prior to May, I started running into problems using the Google Assistant with the SharkClean skill. I had been using it to schedule room-based cleaning successfully, but it suddenly stopped working. Alexa's SharkClean skill also failed to work, so I had no solution to schedule specific rooms for cleaning. The reason I mention the above is that I just unlinked and relinked the skills on Alexa and Google Assistant. There was a hint in the link skill page in the Alexa app that says under the heading 'What's new' that they 'replaced the web authorization URI'. There was no information like that on Google Assistant's skill, but when I tried it to perform a room-specific cleaning operation, it worked.

I imagine that'll be helpful, although I looked into the Google Home integration a bit, and it seems like it authenticates against a google-specific URL.... and I've just checked Alexa and it does the same; you actually log into https://alexa-account-linking.iot-sharkninja.com/?client_id=RANDOMTEXT

So, I dunno if it would be possible to leverage the Google/Alexa integrations, but it's definitely interesting to know they had to change their configs as well. Hopefully that's a good sign that there's a way forwards for us too.

@funkybunch
Copy link
Contributor

@tombrant do you happen to have that new URL?

@Frazou1
Copy link

Frazou1 commented Aug 26, 2024

Same problem here in Canada

@dakoellis
Copy link

dakoellis commented Aug 26, 2024

Getting the same KeyErorr: 'Access Token' issue in US, Model is RV2520A0US. @funkybunch I think the one for Alexa at least is the link posted by @craig0r : https://alexa-account-linking.iot-sharkninja.com/?client_id=RANDOMTEXT

@tombrant
Copy link

@tombrant do you happen to have that new URL?

No, unfortunately I don’t but perhaps @craig0r is onto something that can help make progress.

Can you @craig0r elaborate on the form that RANDOMTEXT follows? Is it symmetric with the google specific URL?

@craig0r
Copy link

craig0r commented Aug 26, 2024

@tombrant, @funkybunch

Nope, they're a bit different. I've changed a couple letters at the end of each URL to avoid potential privacy/security issues, but here's what I get when I attempt to authenticate to each:

Google
https://gaccount-linking.iot-sharkninja.com/?response_type=code&client_id=d08c597f811c2650242ccc36859d9c40b57250964babcdf9a21568ec3fbfc569&redirect_uri=https://oauth-redirect.googleusercontent.com/r/shark-field&state=APvkAzG-NNA4N1JxBC1svz_fGq12iUi4-TdZp_Goc4xaLhQFYluaKv2L-o9Mxq_5IGxas1F0SK1zevKEFARwmpsotQnFAdIk5jDF16euHxGpWlGK5BusUFhBrG2HprjUS9K06Y4eaNlfVejPpFqIJ0R2Fap9DIIugzpG-bh2xqpNvbx69MW4ENe7bKsdzU3bB-yM0tioQ5TDvgjXGlWWcES4Qhtpc_WCee1cn4uP_Q3Gl6FYoYUqODunyOGIDDW919NRFOcbn0HSIfMBYrZRJxgXJf08SfbqkiYbsrHfseFHeHLhBlxiRVPBIeAgPG8YrI6joRYSOZ63m9BxKP2OZ7QKzR85mKYyerQqTFw4MoRSwz1DUxyVOpRhOxM0QMw0CQLREN1chvDk6pGk0TT6rwLp6LgdeFqTuFmwulsMqdj_Wgf02tzePLZ4iGp5Hm0vjwnPBeUSOwhIZwCpBjBkUFnIDg

Alexa
https://alexa-account-linking.iot-sharkninja.com/?client_id=9651aaaa8db120b87499939262d138cca75c11fa632db549f755e4a796eba447&response_type=code&scope=device+user&redirect_uri=https%3A%2F%2Fpitangui.amazon.com%2Fapi%2Fskill%2Flink%2FM39CMXRVRKC8C0&state=AmaseyJ2YWxpZGF0aW9uQ29kZSI6IklJN1NGd0VvS0NPVDh3bUsrbDFWMW92d2laUTVTQkJUNmlKdnRBVCtQRms9IiwiZGlyZWN0ZWRJZCI6ImFtem4xLmFjY291bnQuQUc1N1JIUktER7ZYQ0dXU1VKM1Q0V0pQN1dGUSIsInBhcnRuZXJJZCI6IlB6SlRNdmNtRkdEUGxld3RaQmxCRlhJSXQiLCJhcHBsaWNhdGlvbkRvbWFpbiI6IkFMRVhBX1NLSUxMUyIsImFwcGxpY2F0aW9uRG9tYWlucyI6WyJBTEVYQV9TS0lMTFMiLCJBTEVYQV9DT0hPIl0sImV4cGlyYXRpb25UaW1lSW5NaWxsaXMiOjE3MjQ3MDg3MDM2MTcsInVzZXJTdGF0ZSI6W3siayI6InJlcXVlc3RSZWFsbSIsInYiOiJ1cy1lYXN0LTEifSx7ImsiOiJza2lsbElkIiwidiI6ImFtem4xLmFzay5za2lsbC41NzFkYTRjZS03NDFhLTQxN2YtYTVmMS01YjFmYzE4ZWQ2NmMifSx7ImsiOiJjc3JmVG9rZW4iLCJ2IjoiMTY4Nzk1Mzc4In0seyJrIjoicmVxdWVzdEluZ3Jlc3MiLCJ2Ijoic2hvd0VuYWJsZVNraWxsIn0seyJrIjoiY3VzdG9tZXJJZCIsInYiOiJBMUJIQ1ZSVEVIRUg2ViJ9LHsiayI6InJlcXVlc3REZXZpY2VGYW1pbHkiLCJ2IjoiQ29tcEFwcEFuZHJvaWQifSx7ImsiOiJyZXF1ZXN0U3RhZ2UiLCJ2IjoicHJvZCJ9LHsiabI6InNraWxsU3RhZ2UiLCJ2IjoibGl2ZSJ9LHsiayI6InJlcXVlc3RTdGFydFRpbWUiLCJ2IjoiMTcyNDcwNDkwMzYxMyJ9XSwiZGlyZWN0ZWRJZFR5cGUiOiJPQkZVU0NBVEVEX0NVU1RPTUVSX0lEIiwiZ3JhbnRlZFNjb3Blc0luY2x1ZGVkIjpmYWxzZX0BBBBBBBBAAAAAAAAAABQwEVUg_dgVSwzvAW8cAauIQAAAAAAEACngf6ibVUaAWmc6F5PaqyKY-EQaVegl6_Ly58b8nZAekM%3D

@JOHLC
Copy link

JOHLC commented Sep 1, 2024

I am seeing this as well. Region is US/North America and model is RV1100A.

HA Version: 2024.8.3
Install type: Home Assistant OS

Logs:

2024-09-01 12:16:37.455 DEBUG (MainThread) [homeassistant.components.sharkiq] Initialize connection to Ayla networks API
2024-09-01 12:16:37.861 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Shark for sharkiq
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 67, in async_setup_entry
    if not await async_connect_or_timeout(ayla_api):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sharkiq/__init__.py", line 40, in async_connect_or_timeout
    await ayla_api.async_sign_in()
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 106, in async_sign_in
    self._set_credentials(resp.status, await resp.json())
  File "/usr/local/lib/python3.12/site-packages/sharkiq/ayla_api.py", line 84, in _set_credentials
    self._access_token = login_result["access_token"]
                         ~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'access_token'

@tombrant
Copy link

tombrant commented Sep 3, 2024

From the look of the Google and Alexa auth urls and the arguments being supplied, this appears to be an OAuth Client Credentials Grant flow. In this case, the applications engaged in the API activity to control the device are running on the Google or Alexa hosted servers and are granted authentication through a token exchange with the SharkClean IOT authentication endpoints. This doesn't appear to involve any user-specific credentials being supplied. The fact that the HA authentication is now returning a 403 seems to me to indicate that the original username and password API flow has been explicitly disabled and only registered applications can interact. Does this sound like a valid conclusion to draw based on the information known?
Can someone make an inquiry with SharkNinja to see if they would entertain an HA registration?

@rmuehler
Copy link

rmuehler commented Sep 4, 2024

From the look of the Google and Alexa auth urls and the arguments being supplied, this appears to be an OAuth Client Credentials Grant flow. In this case, the applications engaged in the API activity to control the device are running on the Google or Alexa hosted servers and are granted authentication through a token exchange with the SharkClean IOT authentication endpoints. This doesn't appear to involve any user-specific credentials being supplied. The fact that the HA authentication is now returning a 403 seems to me to indicate that the original username and password API flow has been explicitly disabled and only registered applications can interact. Does this sound like a valid conclusion to draw based on the information known? Can someone make an inquiry with SharkNinja to see if they would entertain an HA registration?

This seems to be true. It seems the API can still authenticate email/password through the current endpoint so I don't think the URL is dead. The 403 makes me think they disabled auth token generation through the ""Shark-Android-field-id" app_id that HA integration has been using. The is a similar "Shark-iOS-field-id" app_id + app_secret that used to work that returns a 403 now.

They probably reworked the mobile apps since 2020 or whenever these app details were first posted and now finally got around to disabling auth token generation from the old app ids. My integration was working fine until yesterday when my token must have expired and I lost client access to the underlying APIs.

@Frazou1
Copy link

Frazou1 commented Sep 11, 2024

Any news yet ?

@craig0r
Copy link

craig0r commented Sep 12, 2024

Any news yet ?

I wouldn't hold your breath. It seems like Shark are deliberately locking out anyone who isn't Google, Amazon, or Apple. My guess is to avoid excess API calls, which is frustrating since other companies deal with this by simply limiting the external API calls (see Ecobee for a good example; they only allow 1 API call per minute, or something along those lines.)

I was able to (mostly) recreate my Shark automations with Google Home via their website at home.google.com/automations (note that you can't do this in the Android/iOS app)

Here's a sample of one of mine:

metadata:
  name: Vacuum Hallway
  description: At 11am on Tuesdays and Thursdays,vacuum the hallway
    vacuum
automations:
  - starters:
      - type: time.schedule
        at: 11:00
        weekdays:
          - TUE
          - THU
    actions:
      - type: assistant.command.OkGoogle
        devices:
          - Dining Room speaker - Dining Room
        okGoogle: Start main vacuum in hallway

This is asking Google Assistant via my device "Dining Room Speaker" to simply run a voice command, and it runs on Tuesdays and Thursdays at 11:00am. I built it using the Gemini assistant built into the site.

I may, however, actually end up adjusting my exiting Home Assistant automations so that instead of interacting directly with the Shark integration, they will simply ask the Google Assistant integration to run "Start main vacuum in hallway." Then at least Home Assistant is still doing the scheduling, even though it can't tell me the status of the vacuums anymore.

@tombrant
Copy link

tombrant commented Sep 12, 2024

re latest comment from @craig0r

I have reverted to using the Google Home automations as well. They were broken for me early this year which is why I ended up adapting the jeffresc/sharkiq HA integration for my own use. Now that HA auth is broken and I'm back on Google Home automations (which can be scheduled) I see that they only work for one room at a time. I had successfully adapted Jeff's integration to support more than one room per cleaning. I'm not sure why the Google automation can't handle more than one room. Also, Alexa automations apparently ignore all room-specific commands and just start cleaning. @craig0r you mention Apple as a supported Shark assistant. That's not in Homekit, is it?

@ghost
Copy link

ghost commented Sep 12, 2024

This is all very unfortunate, as I bought two new shark's the week this went down, after integrating my previous shark for the last year without issue. Sucks because I was on the fence with new shark's or Roborocks.

It's not ideal, but I did the same with google. Made a bubble-card pop-up with various rooms and commands, and it works pretty good.

Screenshot_20240912_115848_Home Assistant

@craig0r
Copy link

craig0r commented Sep 12, 2024

re latest comment from @craig0r

I have reverted to using the Google Home automations as well. They were broken for me early this year which is why I ended up adapting the jeffresc/sharkiq HA integration for my own use. Now that HA auth is broken and I'm back on Google Home automations (which can be scheduled) I see that they only work for one room at a time. I had successfully adapted Jeff's integration to support more than one room per cleaning. I'm not sure why the Google automation can't handle more than one room. Also, Alexa automations apparently ignore all room-specific commands and just start cleaning. @craig0r you mention Apple as a supported Shark assistant. That's not in Homekit, is it?

@tombrant I'm not sure, I just assumed Shark works with Apple devices. I don't have one of my own to check.

@lishan89uc
Copy link

Last I checked shark devices only work through apple via app. No homekit, not even siri shortcuts.

@craig0r
Copy link

craig0r commented Nov 4, 2024

I’m beginning to wonder if the issue I am running into with Google assistant/Home is really a problem that is specific to my model or firmware on the vacuum. For me, everything works fine until I add a phrase that identifies a target room for cleaning. Then, it’s simply doesn’t work. Can you tell me the firmware and model number of your vacuum? Also, is there a way to get any logs or details about the interaction between Google Home and the SharkClean skill cloud service?

Sure!

Shark AI Ultra Firmware: v1.06-20221219v6.6.10-P7.N3308.17.0-Sep 21 2023Lidar2_0M1.1.84Lidar2_0B1.1.14T2.5.020

As for the logs re: SharkClean skill I haven't dug into it.

Exact same model/firmware as mine. I also have a SharkIQ on my top floor, V 0.1.9-20211115V6.6.1 o-P3.E3308.22.1-Mar14 2023Lidar2_OM1.1..76Lidar2_OB1.1.13T2.4.026 and it also runs just fine on room-specific Google commands.

@Sleeepy2
Copy link

Sleeepy2 commented Nov 4, 2024

I’m beginning to wonder if the issue I am running into with Google assistant/Home is really a problem that is specific to my model or firmware on the vacuum. For me, everything works fine until I add a phrase that identifies a target room for cleaning. Then, it’s simply doesn’t work. Can you tell me the firmware and model number of your vacuum? Also, is there a way to get any logs or details about the interaction between Google Home and the SharkClean skill cloud service?

Sure!
Shark AI Ultra Firmware: v1.06-20221219v6.6.10-P7.N3308.17.0-Sep 21 2023Lidar2_0M1.1.84Lidar2_0B1.1.14T2.5.020
As for the logs re: SharkClean skill I haven't dug into it.

Exact same model/firmware as mine. I also have a SharkIQ on my top floor, V 0.1.9-20211115V6.6.1 o-P3.E3308.22.1-Mar14 2023Lidar2_OM1.1..76Lidar2_OB1.1.13T2.4.026 and it also runs just fine on room-specific Google commands.

I don't actually use the room commands, I need to clean everything. lol However just to confirm you have rooms labeled correctly in the app. No strange characters or trailing spaces.

@tombrant
Copy link

tombrant commented Nov 4, 2024

I’m beginning to wonder if the issue I am running into with Google assistant/Home is really a problem that is specific to my model or firmware on the vacuum. For me, everything works fine until I add a phrase that identifies a target room for cleaning. Then, it’s simply doesn’t work. Can you tell me the firmware and model number of your vacuum? Also, is there a way to get any logs or details about the interaction between Google Home and the SharkClean skill cloud service?

Sure!
Shark AI Ultra Firmware: v1.06-20221219v6.6.10-P7.N3308.17.0-Sep 21 2023Lidar2_0M1.1.84Lidar2_0B1.1.14T2.5.020
As for the logs re: SharkClean skill I haven't dug into it.

Exact same model/firmware as mine. I also have a SharkIQ on my top floor, V 0.1.9-20211115V6.6.1 o-P3.E3308.22.1-Mar14 2023Lidar2_OM1.1..76Lidar2_OB1.1.13T2.4.026 and it also runs just fine on room-specific Google commands.

Just for context, on my RV2520AOUS, here’s the version info:

App version
v5.3.0(28991)

V1.0.6-20221219V6.6.1
O-P3.N3308.22.1-Mar
Firmware version
14
2023Lidar2_OM1.1.76L idar2_0B1.1.14T2.4.02
6

@xMacJ
Copy link

xMacJ commented Nov 6, 2024

The only way I can get shark to work is with Alexa. Unfortunately it is broken with home assistant for me.

@tombrant
Copy link

tombrant commented Nov 6, 2024

The only way I can get shark to work is with Alexa. Unfortunately it is broken with home assistant for me.

I just tried Alexa and got room-specific cleaning to work, but

  1. It sets matrix cleaning mode on unconditionally
  2. I had to rename all my rooms so that they use single-word names or the room targeting was ignored and a full house clean initiated

Anyone know if there is a workaround for #1

Is Alexa Media player the only or best way to send Alexa voice commands from within Home Assistant?

bigbadwolv added a commit to bigbadwolv/home-assistant.io that referenced this issue Nov 9, 2024
Add information about its current status and link to work around within home-assistant/core#123392
@Ithrial
Copy link

Ithrial commented Nov 13, 2024

I'm having similar issues though I think its on the shark's side. I tried logging out and logging back into the shark app and I'm unable to log in even after changing passwords

@dakoellis
Copy link

The only way I can get shark to work is with Alexa. Unfortunately it is broken with home assistant for me.

I just tried Alexa and got room-specific cleaning to work, but

1. It sets matrix cleaning mode on unconditionally

2. I had to rename all my rooms so that they use single-word names or the room targeting was ignored and a full house clean initiated

Can you drop a snippet of how you get this to work with alexa media player? everything I try gives me some kind of response like "I don't know how to do that"

@tombrant
Copy link

The only way I can get shark to work is with Alexa. Unfortunately it is broken with home assistant for me.

I just tried Alexa and got room-specific cleaning to work, but

1. It sets matrix cleaning mode on unconditionally

2. I had to rename all my rooms so that they use single-word names or the room targeting was ignored and a full house clean initiated

Can you drop a snippet of how you get this to work with alexa media player? everything I try gives me some kind of response like "I don't know how to do that"

I haven’t tried this with Alexa Mediaplayer inside HA, but here’s the routine syntax I use inside an Alexa routine. Note that I had to shorten the room name to ‘Laundry’ from ‘Laundry Room’

IMG_9206

@Frazou1
Copy link

Frazou1 commented Nov 13, 2024

I tried with your command for Alexa and Alexa answer me i dont know how to help you

@catgirlkara
Copy link

I just got my shark vacuum in today and was under the impression that it would work with HA. T_T

@Stuke00
Copy link

Stuke00 commented Nov 24, 2024

I just got my shark vacuum in today and was under the impression that it would work with HA. T_T

Take it back

@BobMac57
Copy link

I just got my shark vacuum in today and was under the impression that it would work with HA. T_T

Take it back

Agreed! Black Friday Specials will get you a Roborock Q5 Pro+ for about $300. Got one to replace my Shark...

@Kelinni
Copy link

Kelinni commented Dec 4, 2024

Anyone know if this is being address? The authentication error that is... or can we expect HA to drop this integration in the future at this point if the code owners are mia?

@Stuke00
Copy link

Stuke00 commented Dec 4, 2024

Anyone know if this is being address? The authentication error that is... or can we expect HA to drop this integration in the future at this point if the code owners are mia?

It sounds like a change on the Shark side, nothing that HA can do since the API appears to be restricted.

@BobMac57
Copy link

BobMac57 commented Dec 4, 2024

Just do what I did... buy a Roborock and sell the Shark.

@Sleeepy2
Copy link

Sleeepy2 commented Dec 4, 2024

Do what I did, just use the Shark app. I would prefer to use HA but the app works fine and not worth the effort and loss of $$ to sell the Shark and get anything else.

@Kelinni
Copy link

Kelinni commented Dec 4, 2024

Do what I did, just use the Shark app. I would prefer to use HA but the app works fine and not worth the effort and loss of $$ to sell the Shark and get anything else.

Thanks for the advice. I use google home as my front end devices and shark still integrates just fine with google home as well. I just like it in HA for the dashboard, time since last clean, and a counter to remind me when to clean the filters and empty the docking station.

Seems like shark/ninja doesn't want to play nice with others anymore

@vaeron
Copy link

vaeron commented Dec 4, 2024

The Google Assistant integration is really straightforward on configuration. We aren't going to see a fix to the Shark integration unless Shark decides to make changes to re-allow authentication.

That being said, I love my Shark and selling it because the easy integration broke doesn't make sense to me. The functionality is still there, albeit through a slightly different method. You can reference my information above if you want to build it so it triggers on the different areas you specify in the Shark App.

The Shark App by itself is fine if you don't want to schedule different rooms, but I also have other automation I kick off when it starts to vacuum. I use the Custom Google Assistant SDK to parse responses regarding the Shark's current state so that I can control music throughout my apartment while the vacuum is running, as well as send notifications to my mobile when it starts and finishes.

@Stuke00
Copy link

Stuke00 commented Dec 4, 2024

The Google Assistant integration is really straightforward on configuration. We aren't going to see a fix to the Shark integration unless Shark decides to make changes to re-allow authentication.

That being said, I love my Shark and selling it because the easy integration broke doesn't make sense to me. The functionality is still there, albeit through a slightly different method. You can reference my information above if you want to build it so it triggers on the different areas you specify in the Shark App.

The Shark App by itself is fine if you don't want to schedule different rooms, but I also have other automation I kick off when it starts to vacuum. I use the Custom Google Assistant SDK to parse responses regarding the Shark's current state so that I can control music throughout my apartment while the vacuum is running, as well as send notifications to my mobile when it starts and finishes.

I got my google assistant SDK to send commands from home assistant but I’m not getting any responses back. Only “empty response”.

@nikkehsolaris
Copy link

nikkehsolaris commented Dec 4, 2024 via email

@Ithrial
Copy link

Ithrial commented Dec 4, 2024

I ended up moving my automation from HA to Homekit via Homebridge and it seems to be working

@bditter
Copy link

bditter commented Dec 5, 2024

Maybe someone will work out how to simulate the app in HA. I know other integrations do that when there is no accessible API.

@Shayne55434
Copy link

@nikkehsolaris

Here's my version. It needs polishing but, it works.

alias: Action - Vacuum Room(s)
sequence:
  - variables:
      formatted_rooms: |-
        {% set rooms = action %} {% if rooms|length == 1 %}
          {{ rooms[0] }}
        {% else %}
          {{ rooms[:-1] | join(', ') }} and {{ rooms[-1] }}
        {% endif %}
  - action: google_assistant_sdk.send_text_command
    data:
      command: Ask Bruce to vacuum the "{{ formatted_rooms }}"
    enabled: true
  - action: persistent_notification.create
    metadata: {}
    data:
      title: Google command
      notification_id: vacuum
      message: Ask Bruce to vacuum the {{ formatted_rooms }}
fields:
  action:
    selector:
      select:
        options:
          - Kitchen
          - Living Room
          - Hallway
          - Bathroom
          - Foyer
          - Dining Room
          - Playroom
        multiple: true
    name: Action
    description: Select Room
    required: true
    default:
      - Kitchen
      - Hallway
      - Foyer
      - Dining Room
description: ""
icon: mdi:robot-vacuum

Results in the following notification/command being sent:
Screenshot_20241206-220717.png

@vaeron
Copy link

vaeron commented Dec 7, 2024

Would you mind sharing your automation/config? Curious to see how you’ve implemented it!

On Wed, Dec 4, 2024 at 4:09 PM Vaeron @.> wrote: The Google Assistant integration is really straightforward on configuration. We aren't going to see a fix to the Shark integration unless Shark decides to make changes to re-allow authentication. That being said, I love my Shark and selling it because the easy integration broke doesn't make sense to me. The functionality is still there, albeit through a slightly different method. You can reference my information above if you want to build it so it triggers on the different areas you specify in the Shark App. The Shark App by itself is fine if you don't want to schedule different rooms, but I also have other automation I kick off when it starts to vacuum. I use the Custom Google Assistant SDK to parse responses regarding the Shark's current state so that I can control music throughout my apartment while the vacuum is running, as well as send notifications to my mobile when it starts and finishes. — Reply to this email directly, view it on GitHub <#123392 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQQCS3MWI7PNYO5V7PZDMR32D5VQJAVCNFSM6AAAAABMHAPEBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJYGU3DMMBUGE . You are receiving this because you are subscribed to this thread.Message ID: @.>

I have it written up in the link in my bio. Just finished it a few minutes ago for y'all.

@michguy2000
Copy link

I have the same issue. When HA reboots or I reload the integration I get the error "failed to setup". I have two shark robots and they are working in the Shark, Google Home and Alexa apps. This issue started about 2 weeks ago.

Shark RV2530AWFB & RV2500AFX

Home Assistant Core 2024.12.1
Supervisor 2024.11.4
Operating System 14.0
Frontend 20241127.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests