scp10011 / xiaomi_toiletlid

hass tinymu toiletlid
3 stars 3 forks source link

example configuration.yaml ? #1

Open xekil opened 4 years ago

xekil commented 4 years ago

Hello,

Can you provide an example of the configuration.yaml file?

Thank you

scp10011 commented 4 years ago
toiletlid:
  - platform: xiaomi_toiletlid
    name: iot-toiletlid
    host: <ip>
    token: <token>
xekil commented 4 years ago

Hello,

Thank you for your answer, that's what I indicated however it does not work, I get the following error:

Invalid config
The following integrations and platforms could not be set up:

toiletlid
Please check your config.
Logger: homeassistant.setup
Source: setup.py:118
First occurred: 7:24:40 (1 occurrences)
Last logged: 7:24:40

Setup failed for toiletlid: No setup function defined.

My configuration :

toiletlid:
  - platform: xiaomi_toiletlid
    name: Toilet Xiaomi
    host: 192.168.1.24
    token: mytoken
scp10011 commented 4 years ago

I pushed the new version of the code, try again.

path:

/config/custom_components
custom_components $ ls xiaomi_toiletlid/
__init__.py     manifest.json  toiletlid.py
custom_components $ ls toiletlid/
__init__.py      manifest.json  services.yaml
xekil commented 4 years ago

Thank you, I have no more errors, however the entities are not created, I have this in the logs:

2020-08-11 10:43:06 ERROR (MainThread) [custom_components.toiletlid] xiaomi_toiletlid: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 335, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 454, in async_device_update
    await self.async_update()  # type: ignore
  File "/config/custom_components/xiaomi_toiletlid/toiletlid.py", line 187, in async_update
    {key: getattr(state, key) for key in AVAILABLE_ATTRIBUTES_TOILETLID}
  File "/config/custom_components/xiaomi_toiletlid/toiletlid.py", line 187, in <dictcomp>
    {key: getattr(state, key) for key in AVAILABLE_ATTRIBUTES_TOILETLID}
AttributeError: 'ToiletlidStatus' object has no attribute 'work'
xekil commented 4 years ago

I rebooted HA again, an entity was created but unavailable:

Toiletlid Base toiletlid.Toilet_Xiaomi

Model of my xiaomi toilet: xjx.toilet.pro Maybe my cuvette is not compatible?

scp10011 commented 4 years ago

Currently only supports tinymu.toiletlid.v1 You need wireshark to capture the package and write miio

xekil commented 4 years ago

ok, thank you, I suspected it but I still wanted to test :)

I let it go, capture the packets I would do it but then it's way too complicated for me to code ..

Thank you for your responsiveness and have a good day

scp10011 commented 4 years ago

You can send me the captured data packet and token. (Try to trigger all actions)

sorryusernameisalreadytaken commented 4 years ago

I rebooted HA again, an entity was created but unavailable:

Toiletlid Base toiletlid.Toilet_Xiaomi

Model of my xiaomi toilet: xjx.toilet.pro Maybe my cuvette is not compatible?

How did you get your exact model id? I had the pro version with lid-close/open and wifi. Is there a place to see all models?

xekil commented 4 years ago

You can send me the captured data packet and token. (Try to trigger all actions)

Hello,

Thank you for your suggestion, but right now I won't have time, one day maybe ... Have a nice day

How did you get your exact model id? I had the pro version with lid-close/open and wifi. Is there a place to see all models?

In the xiaomi mi home database :

https://www.home-assistant.io/integrations/xiaomi_miio/