Giter Club home page Giter Club logo

libjcihitachi's People

Contributors

amigcamel avatar pre-commit-ci[bot] avatar qqaatw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

libjcihitachi's Issues

破解詢問

Hi
我最近購入一台panasonic的冷氣也想做跟日立相同的擴充控制功能
可以請問您是如何取得日立的相關資訊嗎?

Failed to login API

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."

API Definitions?

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?

Some of device_names are not available from the API.

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:

  • The error seems to point to the Peripheral.from_device_names method in JciHitachi/api.py.
  • It seems the program is asserting that some device names aren't available from the API.
  • There were also some KeyError exceptions related to the AWS connection.
  • Any assistance would be greatly appreciated. Thank you for developing this project; it's fantastic!

Reading data from sensors

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

API status is not updated until refresh_status() is called

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.

New API or changes?

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

Fill out your Jci Hitachi email address, password, and device name.

Login

api = JciHitachiAPI(EMAIL, PASSWORD, DEVICENAME)
api.login()

Check device status

device_status = api.get_status()
print(device_status[DEVICENAME].status)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.