mochipon / pysesame3 Goto Github PK
View Code? Open in Web Editor NEWUnofficial Python Library to communicate with SESAME 3 series products from CANDY HOUSE, Inc.
Home Page: https://pysesame3.readthedocs.io/en/stable/
License: Other
Unofficial Python Library to communicate with SESAME 3 series products from CANDY HOUSE, Inc.
Home Page: https://pysesame3.readthedocs.io/en/stable/
License: Other
Just in case anyone is interested I made a home assistant custom integration with this library.
You can find it here: https://github.com/dragouf/sesame_lock_homeassistant
It is compatible with sesame 5 devices (pro included).
You just need to copy the root content of the repository to config/custom_components/sesame_lock then restart home assistant and go to integration and search for sesame. Name of the integration is Sesame Smart Lock 3/4/5.
You will need your api key, device uuid (found inside mobile app) and device secret (found by sending device QR code to api admin website).
it use CognitoAuth to get lock status and battery so it should avoid to much api request.
it's the first version, it may contain some bugs but it is working fine for me though.
The only minor bug I was not able to fix was to display correctly config flow label (the form show when setting up the integration).
If anyone can help for that you are welcome.
No response
pip show pysesame3
)0.6.0
python --version
)3.11
linux
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)
As as a specification of MQTT, only one MQTT connection can be established for one client ID at a time.
In the current implementation, the device object maintains a session to AWS IoT. That is, if a user executes subscribeMechStatus
for multiple devices with a single client ID (CognitoAuth
authenticator), only one of them can be kept.
pysesame3/pysesame3/chsesame2.py
Lines 148 to 150 in ba72169
This is because when a device instance creates a new MQTT connection, it destroys the MQTT connection created by another device instance.
Allow users to subscribe to the status of multiple devices at the same time.
No response
As the subject line suggests.
No response
No response
This looks great and I would love to use it. I just have no idea where to get the QR code that the QR code site need to provide the KEY Secret. Thoughts?
No response
pip show pysesame3
)3
python --version
)3
macOS
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/ci.yml
szenius/set-timezone v1.0
actions/checkout v3
actions/setup-python v4
codecov/codecov-action v3
szenius/set-timezone v1.0
actions/checkout v3
actions/setup-python v4
.github/workflows/release.yml
actions/checkout v3
heinrichreimer/github-changelog-generator-action v2.3
actions/setup-python v4
pyproject.toml
poetry-core >=1.0.0
pyproject.toml
python >=3.7,<4.0
typing-extensions ^4.2.0
importlib-metadata ^4.11.4
pycryptodome ^3.14.1
requests ^2.27.1
awsiotsdk ^1.11.1
boto3 ^1.23.6
certifi *
requests-aws4auth ^1.1.2
livereload ^2.6.3
mkdocs ^1.3.0
mkdocstrings ^0.19.0
mkdocstrings-python ^0.7.0
mkdocs-autorefs ^0.4.1
mkdocs-include-markdown-plugin ^3.5.0
mkdocs-material ^8.2.15
asynctest ^0.13.0
bump2version ^1.0.1
moto ^3.1.10
pre-commit ^2.19.0
pytest ^7.1.2
pytest-cov ^3.0.0
requests-mock ^1.9.3
subscribeMechStatusを実行するとエラーが出続け、鍵の開閉を受信しません。
おそらく半年前くらい前からこの症状が出ており、それまで便利に使わせていただいていましたが、いつかバージョンアップ等で解消されるだろうと思い放置していましたが、現状も同じなので報告させていただきます。
エラーが出ず、開閉を受信する。
pip show pysesame3
)0.5.1
python --version
)Python 3.10.4
Win10
C:\Users\myname\Desktop>python pysesame3Test.py
==========
[Initial MechStatus]
CHSesame2MechStatus(Battery=100% (6.07V), isInLockRange=True, isInUnlockRange=False, retCode=0, target=551, position=517)
==========
[History]
AWS IoT connection interrupted. error: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
AWS IoT connection resumed. return_code: 0 session_present: True
(Histories)
==========
[Prompt]
Action [lock/unlock/toggle/click]: AWS IoT connection interrupted. error: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
AWS IoT connection resumed. return_code: 0 session_present: True
AWS IoT connection interrupted. error: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
AWS IoT connection resumed. return_code: 0 session_present: True
AWS IoT connection interrupted. error: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
AWS IoT connection resumed. return_code: 0 session_present: True
AWS IoT connection interrupted. error: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
AWS IoT connection resumed. return_code: 0 session_present: True
AWS IoT connection interrupted. error: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
AWS IoT connection resumed. return_code: 0 session_present: True
AWS IoT connection interrupted. error: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
AWS IoT connection resumed. return_code: 0 session_present: True
AWS IoT connection interrupted. error: AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly.
Traceback (most recent call last):
File "C:\Users\myname\Desktop\pysesame3Test.py", line 134, in <module>
main()
File "C:\Users\myname\Desktop\pysesame3Test.py", line 116, in main
val = input("Action [lock/unlock/toggle/click]: ")
KeyboardInterrupt
^C
Almost at the end of cloud.py, CHSesame2History is created using returned value from the API (**entry), but it fails when it contains a value with 'parameter' key, as it is not defined in CHSesame2History.__init__
.
I sImply followed the example usage at: https://pysesame3.readthedocs.io/en/latest/usage/
then got an error in device.historyEntries
iteration.
Read the Docs is able to handle multiple doc versions. Although pysesame3
is developed with backward compatibility in mind, users should be able to intentionally specify and read the version of the document they are using.
Read the Docs will inject their own javascript and css at build time, and the version (flyout) menu should appear at the bottom right of the screen. The problem is, this script depends on jQuery, but jQuery was not loaded implicitly, so the menu could not be displayed.
8a7ca4b has solved the issue. We have to cherry-pick the commit and rebuild the docs we have published so far.
No response
pip show pysesame3
)N/A
python --version
)N/A
N/A
Open the docs site.
readthedocs-doc-embed.js:1 Uncaught ReferenceError: $ is not defined
at Object.get (readthedocs-doc-embed.js:1)
at Object.init (readthedocs-doc-embed.js:1)
at HTMLDocument.n (readthedocs-doc-embed.js:1)
The user is unable to issue a new CLIENT_ID
. CLIENT_ID
is no longer unique to each user.
To be honest, I personally thought that this was going to be a paid service. So I was very surprised to see this decision.
No response
No response
ここに書いて良いのかどうかわかりませんが、使ってないセサミbotがあります。開発のお役に立てるのならお譲りしたいと思います。
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
Reported at sesame スマートロック Part.7:
439目のつけ所が名無しさん (ワッチョイ a56c-KuYY [180.144.208.216])2021/07/01(木) 23:03:59.36ID:DD5tr8/A0
Pysesame3のwebhookつうかMQTTの開閉通知だが、急に効かなくなるPysesame3が勝手にgetLoggerに吐いてたのを見たが、
ドア開閉すると、まずAWSIoTPythonSDKがProduced出す。
次にDispatching→Invoking Custom Event Callbackで、Callbackされるけど
たまにProducedで止まっちゃう。一度止まると再起動するまで止まったまま。
一日一回夜中にcronで再起動かけてるけど、夕方くらいからCallbackしなくなってくる。再起動しなくても上手く動いてる人いるかね?
Thanks for the report! I could reproduce the issue.
No problems even if you use it for a long time.
pip show pysesame3
)0.3.1.dev70
python --version
)3.9.6
Ubuntu 20.04.2 LTS
Run the example script and keep it running for a long time.
DEBUG:AWSIoTPythonSDK.core.protocol.internal.clients:Invoking custom event callback...
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Dispatching [message] event
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/AWSIoTPythonSDK/core/protocol/internal/workers.py", line 147, in _dispatch
self._dispatch_one()
File "/usr/local/lib/python3.9/site-packages/AWSIoTPythonSDK/core/protocol/internal/workers.py", line 154, in _dispatch_one
self._dispatch_methods[event_type](mid, data)
File "/usr/local/lib/python3.9/site-packages/AWSIoTPythonSDK/core/protocol/internal/workers.py", line 237, in _dispatch_message
message_callback(None, None, message) # message_callback(client, userdata, message)
File "/usr/local/lib/python3.9/site-packages/pysesame3/chsesame2.py", line 84, in _iot_shadow_callback
status = CHSesame2MechStatus(rawdata=shadow["state"]["reported"]["mechst"])
KeyError: 'mechst'
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [message] event
at first "CognitoAuth" next "CHSesame2" use then accessing 169.254.169.254 and time out and error.
There is no problem in operation.
It's working fine.
Is this the correct behavior?
2021-07-03 17:58:32,506 - botocore.hooks - DEBUG - Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2021-07-03 17:58:32,573 - botocore.hooks - DEBUG - Changing event name from before-call.apigateway to before-call.api-gateway
2021-07-03 17:58:32,601 - botocore.hooks - DEBUG - Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2021-07-03 17:58:32,670 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunch$2021-07-03 17:58:32,674 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2021-07-03 17:58:32,691 - botocore.hooks - DEBUG - Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2021-07-03 17:58:32,716 - botocore.hooks - DEBUG - Changing event name from docs..autoscaling.CreateLaunchConfiguration.complete-section to docs..auto-scaling.CreateLaunchConfiguration.c$2021-07-03 17:58:32,825 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2021-07-03 17:58:32,829 - botocore.hooks - DEBUG - Changing event name from docs..logs.CreateExportTask.complete-section to docs..cloudwatch-logs.CreateExportTask.complete-section
2021-07-03 17:58:32,832 - botocore.hooks - DEBUG - Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2021-07-03 17:58:32,836 - botocore.hooks - DEBUG - Changing event name from docs..cloudsearchdomain.Search.complete-section to docs..cloudsearch-domain.Search.complete-section
2021-07-03 17:58:32,899 - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/
2021-07-03 17:58:32,927 - botocore.credentials - DEBUG - Looking for credentials via: env
2021-07-03 17:58:32,929 - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2021-07-03 17:58:32,931 - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity
2021-07-03 17:58:32,933 - botocore.credentials - DEBUG - Looking for credentials via: sso
2021-07-03 17:58:32,934 - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2021-07-03 17:58:32,937 - botocore.credentials - DEBUG - Looking for credentials via: custom-process
2021-07-03 17:58:32,938 - botocore.credentials - DEBUG - Looking for credentials via: config-file
2021-07-03 17:58:32,941 - botocore.credentials - DEBUG - Looking for credentials via: ec2-credentials-file
2021-07-03 17:58:32,942 - botocore.credentials - DEBUG - Looking for credentials via: boto-config
2021-07-03 17:58:32,945 - botocore.credentials - DEBUG - Looking for credentials via: container-role
2021-07-03 17:58:32,947 - botocore.credentials - DEBUG - Looking for credentials via: iam-role
2021-07-03 17:58:32,959 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 169.254.169.254:80
2021-07-03 17:58:33,982 - botocore.utils - DEBUG - Caught retryable HTTP exception while making metadata service request to http://169.254.169.254/latest/api/token: Connect timeout on endp$Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 170, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.7/dist-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/botocore/httpsession.py", line 332, in send
chunked=self._chunked(request.headers),
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 756, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.7/dist-packages/urllib3/util/retry.py", line 507, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.7/dist-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 706, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.7/dist-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/lib/python3.7/http/client.py", line 1260, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.7/dist-packages/botocore/awsrequest.py", line 93, in _send_request
method, url, body, headers, *args, **kwargs)
File "/usr/lib/python3.7/http/client.py", line 1306, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1255, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.7/dist-packages/botocore/awsrequest.py", line 120, in _send_output
self.send(msg)
File "/usr/local/lib/python3.7/dist-packages/botocore/awsrequest.py", line 204, in send
return super(AWSConnection, self).send(str)
File "/usr/lib/python3.7/http/client.py", line 970, in send
self.connect()
File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 200, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.7/dist-packages/urllib3/connection.py", line 177, in _new_conn
% (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<botocore.awsrequest.AWSHTTPConnection object at 0xb56c5370>, 'Connection to 169.254.169.254 timed out. (connect timeout=1)')
During handling of the above exception, another exception occurred:
pip show pysesame3
)0.4.0
python --version
)3.7.3
Raspbian buster 10.10
As described in the subject.
We must fix the typo while maintaining backward compatibility for a while.
No response
pip show pysesame3
)latest
python --version
)N/A
N/A
https://github.com/mochipon/pysesame3/search?q=Precentage
No response
Due to the websocket connection quota in AWS IoT, the websocket connection will be closed after 24 hours. The problem is the temporary credential from Cogninto has been out dated at that moment so we cannot reconnect.
The issue is reported at aws/aws-iot-device-sdk-python#224.
No response
pip show pysesame3
)0.4.0
python --version
)3.9.6
Ubuntu 20.04.2 LTS
Run the example script and keep it running more than 24 hours.
DEBUG:AWSIoTPythonSDK.core.protocol.internal.clients:Invoking custom event callback...
[Errno 103] 0
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Produced [disconnect] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.workers:Dispatching [disconnect] event
DEBUG:AWSIoTPythonSDK.core.protocol.internal.clients:Invoking custom event callback...
DEBUG:AWSIoTPythonSDK.core.protocol.connection.cores:backOff: current backoff time is: 1 sec.
DEBUG:AWSIoTPythonSDK.core.protocol.connection.cores:IAM credentials from custom config.
DEBUG:AWSIoTPythonSDK.core.protocol.connection.cores:createWebsocketEndpoint: Websocket URL: wss://<snip>
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/AWSIoTPythonSDK/core/protocol/connection/cores.py", line 428, in __init__
self._handShake(hostAddress, portNumber)
File "/usr/local/lib/python3.9/site-packages/AWSIoTPythonSDK/core/protocol/connection/cores.py", line 523, in _handShake
raise wssHandShakeError()
AWSIoTPythonSDK.exception.AWSIoTExceptions.wssHandShakeError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.9/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 2389, in _thread_main
self.loop_forever()
File "/usr/local/lib/python3.9/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 1391, in loop_forever
self.reconnect()
File "/usr/local/lib/python3.9/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 802, in reconnect
self._ssl = SecuredWebSocketCore(rawSSL, self._host, self._port, self._AWSAccessKeyIDCustomConfig, self._AWSSecretAccessKeyCustomConfig, self._AWSSessionTokenCustomConfig) # Override the _ssl socket
File "/usr/local/lib/python3.9/site-packages/AWSIoTPythonSDK/core/protocol/connection/cores.py", line 432, in __init__
raise ValueError("Websocket Handshake Error")
ValueError: Websocket Handshake Error
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.