ajmarks / sharkiq Goto Github PK
View Code? Open in Web Editor NEWPython API for Shark IQ robot
Python API for Shark IQ robot
I've been using this along with the HomeAssistant integration and have recently begun seeing the following error, causing the entity to become unavailable until the integration is reloaded:
Logger: homeassistant.components.sharkiq
Source: helpers/update_coordinator.py:205
Integration: Shark IQ (documentation, issues)
First occurred: May 11, 2021, 11:06:39 AM (23 occurrences)
Last logged: 10:51:37 AM
Error fetching sharkiq data: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://ads-field.aylanetworks.com/apiv1/devices.json')
Error fetching sharkiq data: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://ads-field.aylanetworks.com/apiv1/dsns/AC000W009799880/properties.json')
Error fetching sharkiq data: Ayla Networks API authentication expired. Re-authenticate and retry.
Just wondering if you plan on expanding support for more shark ion robots?
I have the older RV750 and your integration partially works. I see a status and vacuum name but not much else and none of the commands work.
If you have no plans to expand then disregard, but I'd be willing to provide more data if so.
Thanks
Hi,
Just trying to run this to confirm I can sign in:
from sharkiqpy import get_ayla_api, OperatingModes, Properties, PowerModes
USERNAME = 'my_username'
PASSWORD = 'my_password'
ayla_api = get_ayla_api(USERNAME, PASSWORD)
ayla_api.sign_in()
and I am receiving this error:
Traceback (most recent call last):
File "/Users/cartnj/Desktop/usefulprojects/vacuum.py", line 7, in <module>
ayla_api.sign_in()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sharkiqpy/ayla_api.py", line 84, in sign_in
self._set_credentials(resp.status_code, resp.json())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/sharkiqpy/ayla_api.py", line 73, in _set_credentials
raise SharkIqAuthError(login_result["error"]["message"])
TypeError: string indices must be integers
Any ideas? I just started playing with this API so I apologize if I am missing something. Thanks in advance!
Hi @ajmarks , I see you've implemented a hardcoded app_id and app_secret.
SHARK_APP_ID = "Shark-Android-field-id" SHARK_APP_SECRET = "Shark-Android-field-Wv43MbdXRM297HUHotqe6lU1n-w"
Can you tell me if these work for other users as well, or are these unique to you? How do you retrieve these for other users? I'm implementing something similar for Hubitat (Smart Hub), and while everything works for me, others are getting 403 Forbidden messages.
My Project: https://github.com/TheChrisTech/Hubitat-SharkIQRobot
So I would have expected that in order to specify a room to clean you would call
https://ads-field.aylanetworks.com/apiv1/dsns/ABCDEFG/properties/SET_Areas_To_Clean/datapoints.json
passing
{"datapoint":{"value":"{"clean_count":1,"areas_to_clean":["UserRoom: Room 2"]}"}}
Any idea why this wouldn't work?
The call returns
{'datapoint': {'updated_at': '2021-12-09T02:33:11Z', 'created_at': '2021-12-09T02:33:11Z', 'echo': False, 'metadata': {}, 'generated_at': None, 'generated_from': None, 'value': '{"clean_count"=>"1", "areas_to_clean"=>["UserRoom:Room 2"]}'}}
Hello,
Ayla API seems to be used by many IoT devices, do you think the API could be spun off into it's own project?
I just got a Fujitsu Heat Pump, and it's using the Ayla API, so I would need to reimplement the code being used here, it would simpler if the Ayla API could simply be imported.
Thanks!
Hello,
I'm working on my own integration into Hubitat, and am looking through your code. I'm not a professional at python, so I was hoping you could help explain the following method to me:
def _encode_room_list(self, rooms: List[str]):
"""Base64 encode the list of rooms to clean"""
if not rooms:
raise ValueError('Room list must not be empty')
if len(rooms) > 3:
raise ValueError('At most three rooms may be given')
# These are a mystery to me, but they seem constant
header = b'\x80\x01\x0b\xca\x02'
footer = b'\x1a\x08155B43C4'
I do notice some unusual encoding around a possible value:
Calling "SET_Areas_To_Clean" via the App, it's sending this as the payload:
{"datapoint": {"value": "gAELygIXCgtMaXZpbmcgUm9vbRoINzZBODA1OEE="}}
Which base64 decodes to:
��ハ��
�Living Room��76A8058A
Any tips? I'm essentially going to be making a simple string to pass this on to the API using Groovy.
Just starting to try to use this api - thanks, this should be great to get to schedule rooms instead of just scheduling everything. (can't get scheduling to do individual rooms over Google Assistant or Amazon Alexa)
I can get the ayla_api, and I can sign_in.
But when I call get_devices, it comes back with an empty list.
I do have one Shark IQ vacuum in my account.
any ideas why the api would be reporting no devices or how I can troubleshoot?
Thanks
Its docked but does not update once returned
Is there anyway that you're aware of for local control of this robot? As in not using the cloud services.
If not at present, could it be somehow reverse engineered?
I'm curious as to what that lan_enabled: false means.
Thank you very much for this integration!
I like my new Shark IQ, but the Shark app seems to lack one feature that's important for my home: multi-floor mapping.
I started looking for a Shark API to see if I might be able to correct that by writing some code. Perhaps something that could load and store different maps, and let me use Alexa to switch which floor I've put the robot and doc on.
Thoughts? How dev-friendly has Shark (and ayla?) been to your effort?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.