fineemb / Xiaomi-Smart-Multipurpose-Kettle

小米养生壶
7 stars 7 forks source link

Can't cancel 'Cooking' #8

Open odu14ick opened 2 years ago

odu14ick commented 2 years ago

More of a question really.

Tried to call 'set_work' service with service data: { "id": 18, "status": 5, "entity_id": %proper_entity_id% }

but that doesn't really cancel cooking.

In the log I see following:

2021-11-22 22:12:34 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [547476363248] Received {'type': 'call_service', 'domain': 'health_pot', 'service': 'set_work', 'service_data': {'status': 5, 'id': 1, 'entity_id': 'health_pot.xiaomi_40313cca4525'}, 'id': 85}
2021-11-22 22:12:34 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=health_pot, service=set_work, service_data=status=5, id=1, entity_id=health_pot.xiaomi_40313cca4525>
2021-11-22 22:12:34 DEBUG (SyncWorker_5) [miio.miioprotocol] Got a response: Container:
data = Container:
data = b'' (total 0)
value = b'' (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = b'!1\x00 \x00\x00\x00\x00\x07\x18Zq\x00;\xd9\xa1' (total 16)
value = Container:
length = 32
unknown = 0
device_id = b'\x07\x18Zq' (total 4)
ts = 1970-02-15 09:32:17
offset1 = 0
offset2 = 16
length = 16
checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)

so is there really a proper way to cancel the cooking?

I must say the only statuses that worked for me were 2 (to start cooking) and 1 (reservation) anything else doesn't work for me either.

fixsssator commented 2 years ago

Hi @odu14ick. I found solution. You have to change this line "vol.Required(ATTR_WORK_STATUS): vol.All(vol.Coerce(int), vol.Range(min=1, max=5))," in this file Xiaomi-Smart-Multipurpose-Kettle/custom_components/xiaomi_miio_health_pot/init.py to "vol.Required(ATTR_WORK_STATUS): vol.All(vol.Coerce(int), vol.Range(min=0, max=5))," And use status 0 - to stop cooking. I hope i help you.