krasnoukhov / homeassistant-smart-maic

Home Assistant Smart MAIC integration
MIT License
15 stars 0 forks source link

Error adding the D103 G1 device. #3

Closed kondrikserg closed 10 months ago

kondrikserg commented 10 months ago

I have installed integration version 1.1.0. I am adding a new D103 device. I get the error of adding a device "Unknown error occurred". home-assistant_smart_maic_2023-11-08T19-39-44.243Z.log

krasnoukhov commented 10 months ago

Thanks for the report. Log is really useful in this case. It looks like the component does not receive the data it expects, seems like this is due to the missing MQTT prefix.

This is likely because this feature is not supported on the firmware version you have. Could you please check whether your device has the latest firmware? If there's an update, install it and then re-add the device to HA so it sets proper config again.

kondrikserg commented 10 months ago

Unfortunately, I have the latest firmware.

image

Maybe the problem is something else. I used to transmit values via MQTT as described on the device developer's website.

krasnoukhov commented 10 months ago

Ok, can you send me a screenshot of the MQTT settings screen?

krasnoukhov commented 10 months ago

Please also try 1.2.0-beta.0 which I just created, maybe it will just work after this change?

kondrikserg commented 10 months ago

Ok, can you send me a screenshot of the MQTT settings screen?

image
kondrikserg commented 10 months ago

Version 1.2.0-beta-0 works correctly and the device was added without any problems!

krasnoukhov commented 10 months ago

Version 1.2.0-beta-0 works correctly and the device was added without any problems!

Great! Can you confirm all sensors display correctly and dry switch also works? Thanks

kondrikserg commented 10 months ago
image

All data is displayed correctly. Except that they are updated with a long delay. Perhaps I will set a shorter update time in the MQTT Server settings.

kondrikserg commented 10 months ago

Ddry contact works correctly, but a warning message appears.

image
krasnoukhov commented 10 months ago

Perhaps I will set a shorter update time in the MQTT Server settings.

I'm afraid this might not work, because it seems like device manufacturer enforces the interval at 60 seconds for "standard" devices and 5 seconds for "extended" versions. Anyhow this should be working pretty much the same as you had with manual MQTT sensor configuration.

dry contact works correctly, but a warning message appears.

Thanks for confirming. Could you check whether this message coincides in the log with something like this:

2023-11-09 15:24:56.117 DEBUG (SyncWorker_1) [custom_components.smart_maic.smart_maic] Smart MAIC request: GET http://192.168.11.16/?page=getdata&devid=xxxxxx&devpass=yyyyyyy&pout=1
2023-11-09 15:24:56.268 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547338859328] 
Traceback (most recent call last):
  File "/config/custom_components/smart_maic/smart_maic.py", line 81, in _get_request
    r.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: http://192.168.11.16/?page=getdata&devid=xxxxxx&devpass=yyyyyyy&pout=1

If that's the case I guess the cause is rate limit enforced by the device (for whatever reason), I currently don't know how to handle this better

Alright, I will close this issue then