qqaatw / libjcihitachi Goto Github PK
View Code? Open in Web Editor NEWA library for controlling Jci-Hitachi devices 台灣日立雲端模組 裝置控制
License: Apache License 2.0
A library for controlling Jci-Hitachi devices 台灣日立雲端模組 裝置控制
License: Apache License 2.0
Are the DH sensor data supported to be read only when the DH is powered on? i.e. state of the DH is actually running ON? When I read the pm2.5 sensor for example of the currently humidity sensor data doesn't seem to be updated when the DH is not currently being used in any mode
Description:
I encountered an issue when trying to connect my dehumidifier using the provided documentation examples. I attempted to establish a connection using both the legacy API and the AWS API.
from JciHitachi.api import JciHitachiAPI
# from JciHitachi.api import JciHitachiAWSAPI
# Login
api = JciHitachiAPI(EMAIL, PASSWORD, DEVICENAME)
# api = JciHitachiAWSAPI(EMAIL, PASSWORD, DEVICENAME)
api.login()
# Check device status
# device_status = api.get_status(legacy=True) # return legacy status class
device_status = api.get_status()
print(device_status[DEVICENAME].status)
Error Message:
Upon executing the code, I received the following error:
AssertionError: Some of device_names are not available from the API.
Full traceback:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
[/Users/mcc_311/Desktop/playground/test.ipynb](https://file+.vscode-resource.vscode-cdn.net/Users/mcc_311/Desktop/playground/test.ipynb) 儲存格 19 in ()
[1](vscode-notebook-cell:/Users/mcc_311/Desktop/playground/test.ipynb#X24sZmlsZQ%3D%3D?line=0) # Login
[2](vscode-notebook-cell:/Users/mcc_311/Desktop/playground/test.ipynb#X24sZmlsZQ%3D%3D?line=1) api = JciHitachiAPI(EMAIL, PASSWORD, DEVICENAME)
----> [3](vscode-notebook-cell:/Users/mcc_311/Desktop/playground/test.ipynb#X24sZmlsZQ%3D%3D?line=2) api.login()
[5](vscode-notebook-cell:/Users/mcc_311/Desktop/playground/test.ipynb#X24sZmlsZQ%3D%3D?line=4) # Check device status
[6](vscode-notebook-cell:/Users/mcc_311/Desktop/playground/test.ipynb#X24sZmlsZQ%3D%3D?line=5) # device_status = api.get_status(legacy=True) # return legacy status class
[7](vscode-notebook-cell:/Users/mcc_311/Desktop/playground/test.ipynb#X24sZmlsZQ%3D%3D?line=6) device_status = api.get_status()
File [/opt/anaconda3/lib/python3.9/site-packages/JciHitachi/api.py:377](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/lib/python3.9/site-packages/JciHitachi/api.py:377), in JciHitachiAPI.login(self)
374 self._user_id = conn_json["results"][0]["Owner"]
376 # peripherals
--> 377 self._peripherals = Peripheral.from_device_names(
378 conn_json,
379 self.device_names
380 )
381 self.device_names = list(self._peripherals.keys())
383 # mqtt
File [/opt/anaconda3/lib/python3.9/site-packages/JciHitachi/api.py:88](https://file+.vscode-resource.vscode-cdn.net/opt/anaconda3/lib/python3.9/site-packages/JciHitachi/api.py:88), in Peripheral.from_device_names(cls, peripherals_json, device_names)
85 if device_type in cls.supported_device_type:
86 peripherals[device_name] = cls(result)
---> 88 assert device_names is None or len(device_names) == len(peripherals), \
89 "Some of device_names are not available from the API."
91 return peripherals
AssertionError: Some of device_names are not available from the API.
Exception ignored in: Exception ignored in: <class 'KeyError'>
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site-packages/awscrt/mqtt.py", line 628, in callback_wrapper
<class 'KeyError'>
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site-packages/awscrt/mqtt.py", line 628, in callback_wrapper
callback(topic=topic, payload=payload, dup=dup, qos=QoS(qos), retain=retain)
File "/opt/anaconda3/lib/python3.9/site-packages/JciHitachi/aws_connection.py", line 561, in _on_publish
callback(topic=topic, payload=payload, dup=dup, qos=QoS(qos), retain=retain)
File "/opt/anaconda3/lib/python3.9/site-packages/JciHitachi/aws_connection.py", line 561, in _on_publish
self._mqtt_events.device_control_event[thing_name].set()
KeyError: 'ap-northeast-1:f5fb78f7-04b3-418e-aab0-6ee66afadeca_66428598606390'
self._mqtt_events.device_control_event[thing_name].set()
KeyError: 'ap-northeast-1:f5fb78f7-04b3-418e-aab0-6ee66afadeca_66428598606390'
Exception ignored in: <class 'KeyError'>
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site-packages/awscrt/mqtt.py", line 628, in callback_wrapper
callback(topic=topic, payload=payload, dup=dup, qos=QoS(qos), retain=retain)
File "/opt/anaconda3/lib/python3.9/site-packages/JciHitachi/aws_connection.py", line 561, in _on_publish
self._mqtt_events.device_control_event[thing_name].set()
KeyError: 'ap-northeast-1:f5fb78f7-04b3-418e-aab0-6ee66afadeca_66428598606390'
Exception ignored in: <class 'KeyError'>
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.9/site-packages/awscrt/mqtt.py", line 628, in callback_wrapper
callback(topic=topic, payload=payload, dup=dup, qos=QoS(qos), retain=retain)
File "/opt/anaconda3/lib/python3.9/site-packages/JciHitachi/aws_connection.py", line 561, in _on_publish
self._mqtt_events.device_control_event[thing_name].set()
KeyError: 'ap-northeast-1:f5fb78f7-04b3-418e-aab0-6ee66afadeca_66428598606390'
Additional Information:
Hi
我最近購入一台panasonic的冷氣也想做跟日立相同的擴充控制功能
可以請問您是如何取得日立的相關資訊嗎?
With latest update of firmware and app and library getting error -
Has the API changed or does the new firmware from Hitachi require some different mechanism to connect?
python3 example.py
Traceback (most recent call last):
File "/Users/nsankar/Projects/LibJciHitachi/example.py", line 11, in
api.login()
File "/Users/nsankar/Projects/LibJciHitachi/JciHitachi/api.py", line 384, in login
self._peripherals = Peripheral.from_device_names(
File "/Users/nsankar/Projects/LibJciHitachi/JciHitachi/api.py", line 95, in from_device_names
assert device_names is None or len(device_names) == len(peripherals),
AssertionError: Some of device_names are not available from the API.
more example.py
from JciHitachi.api import JciHitachiAPI
api = JciHitachiAPI(EMAIL, PASSWORD, DEVICENAME)
api.login()
device_status = api.get_status()
print(device_status[DEVICENAME].status)
What are the definitions of the API for the following -
air_cleaning_filter
clean_filter_notify
Are these to enable getting notifications of filter state for DH or for do they indicate the actual state of the filter?
My integration suddenly failed to start up. I attempted to reinstall the integration, but upon logging in, I received the following error.
"Failed to login API: An error occurred when connecting to MQTT endpoint."
"MQTT connection failed with exception AWS_ERROR_MQTT_UNEXPECTED_HANGUP: The connection was closed unexpectedly."
The status in JciHitachiAWSAPI is not updated until refresh_status() is called. With print_response set to true, you can see that the MQTT client does receive the updated status. However, get_status() always returns the old status until refresh_status() is called. Not sure if this is a bug or a design choice.
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.