Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

viomi.waterheater.e1 #375

Closed
soulthiefer opened this issue Jan 11, 2022 · 22 comments
Closed

viomi.waterheater.e1 #375

soulthiefer opened this issue Jan 11, 2022 · 22 comments
Labels
bug Something isn't working device: water-heater fixed bug fixed

Comments

@soulthiefer
Copy link

soulthiefer commented Jan 11, 2022

Good evening! device viomi.waterheater.e1. does not show the current temperature and water-level. the current temperature is always 0 , water-level does not show anywhere at all. how to fix it, tell me please

@al-one
Copy link
Owner

al-one commented Jan 13, 2022

Try this service, and find the result in the HA notification:

service: xiaomi_miot.send_command
data:
  entity_id: water_heater.viomi_e1_entity_id
  method: get_prop
  params: [targetTemp,waterTemp,washStatus,hotWater,modeType]
  throw: true

@soulthiefer
Copy link
Author

soulthiefer commented Jan 13, 2022

result this service in notification:
Miio command result
[7]

7 - this Target temp
current temp? water_lewel?

this condition my entity

min_temp: 30
max_temp: 75
operation_list:
  - Normal
  - Heat
  - Delay
current_temperature: 0
temperature: 7
target_temp_high: 75
target_temp_low: 30
operation_mode: null
model: viomi.waterheater.e1
lan_ip: 192.168.31.24
mac_address: 50:EC:50:AC:50:E8
entity_class: MiotWaterHeaterEntity
miot_type: urn:miot-spec-v2:device:water-heater:0000A02A:viomi-e1:1
water_heater.target_temperature: 7
water_heater.status: null
water_heater.on: true
water_heater.mode: null
state_updater: lan
sub_entities:
  - water_heater-2.on-4
friendly_name: Xiaomi_Waterheat Water Heater
supported_features: 3

!!!current_temperature: 0 and water-level absent

@al-one
Copy link
Owner

al-one commented Jan 13, 2022

Upgrade to master branch and try again.

@soulthiefer
Copy link
Author

soulthiefer commented Jan 13, 2022

im changed miio2miot_specs.py files
service:
image
result:
image

nothing has changed((( show only "7" (((

@soulthiefer
Copy link
Author

in server's logs , intergation sgeated mistake

Logger: custom_components.xiaomi_miot.water_heater
Source: custom_components/xiaomi_miot/init.py:1312
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 15:06:44 (90 occurrences)
Last logged: 15:49:59

Xiaomi_Waterheat Water Heater: Got miio properties ['washStatus', 'velocity', 'waterTemp', 'targetTemp', 'errStatus', 'hotWater', 'needClean', 'modeType', 'appointStart', 'appointEnd'] failed: {'code': -9998, 'message': 'user ack invalid'}

maybe these errors will help to understand the reason

@Zuz666
Copy link
Contributor

Zuz666 commented Jan 13, 2022

maybe these errors will help to understand the reason

device_customizes.py:

    'viomi.waterheater.e1': {
        'chunk_properties': 1,
        'miio_properties': 'washStatus,velocity,waterTemp,targetTemp,errStatus,'
                           'hotWater,needClean,modeType,appointStart,appointEnd',
    },

init.py:

    def update_miio_props(self, props):
        if not self.miot_device:
            return
        try:
            max_properties = self.custom_config_integer('chunk_properties') or 10
            attrs = self._device.get_properties(props, max_properties=max_properties)
        except DeviceException as exc:

result:
image

@soulthiefer
Copy link
Author

soulthiefer commented Jan 13, 2022

thank you very much!!! problem with current_temperature and mistake in logs solved
image
the parameter water_heater.target_temperature: 7 is incorrect (
and does not show some parameters:
operation_mode: null
water_heater.status: null
water_heater.mode: null
but it's not very important to me

there is a similar problem with

zhimi.humidifier.ca1
Эта ошибка возникла в кастомной интеграции.

Logger: custom_components.xiaomi_miot.humidifier
Source: custom_components/xiaomi_miot/init.py:1164
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 22:58:58 (13 occurrences)
Last logged: 23:05:03

AirHumidifier Humidifier: Got MiioException while fetching the state: {'code': -9999, 'message': 'user ack timeout'}, mapping: {'humidifier.on': {'siid': 2, 'piid': 1}, 'humidifier.fan_level': {'siid': 2, 'piid': 2}, 'humidifier.water_level': {'siid': 2, 'piid': 3}}, max_properties: 7/3
AirHumidifier Humidifier: Got MiioException while fetching the state: {'code': -9999, 'message': 'user ack timeout'}, mapping: {'humidifier.on': {'siid': 2, 'piid': 1}, 'humidifier.fan_level': {'siid': 2, 'piid': 2}, 'humidifier.water_level': {'siid': 2, 'piid': 3}, 'physical_controls_locked': {'siid': 5, 'piid': 1}, 'alarm': {'siid': 4, 'piid': 1}, 'environment.relative_humidity': {'siid': 3, 'piid': 1}, 'environment.temperature': {'siid': 3, 'piid': 2}}, max_properties: 9/7

and
chuangmi.camera.v2
Эта ошибка возникла в кастомной интеграции.

Logger: custom_components.xiaomi_miot.camera
Source: custom_components/xiaomi_miot/init.py:1164
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 22:59:31 (12 occurrences)
Last logged: 23:04:59

Xiaomi_Cam360 Camera Control: Got MiioException while fetching the state: {'code': -9999, 'message': 'user ack timeout'}, mapping: {'camera_control.on': {'siid': 2, 'piid': 1}, 'camera_control.image_rollover': {'siid': 2, 'piid': 2}, 'camera_control.night_shot': {'siid': 2, 'piid': 3}, 'camera_control.time_watermark': {'siid': 2, 'piid': 4}, 'camera_control.wdr_mode': {'siid': 2, 'piid': 5}, 'camera_control.recording_mode': {'siid': 2, 'piid': 6}}, max_properties: 8/6

please help me solve

@Zuz666
Copy link
Contributor

Zuz666 commented Jan 13, 2022

And in miio2miot_specs.py set_template must be:

    'viomi.waterheater.e1': {
        'chunk_properties': 1,
        'miio_specs': {
            'prop.2.1': {'prop': 'targetTemp', 'setter': 'set_temp', 'set_template': '{{ value | int }}'},
            'prop.2.2': {'prop': 'waterTemp'},
            'prop.2.3': {'prop': 'washStatus'},
            'prop.2.4': {
                'prop': 'washStatus',
                'setter': 'set_power',
                'template': '{{ value != 0 }}',
                'set_template': '{{ [value | int] }}',
            },
            'prop.2.5': {'prop': 'hotWater'}, # water-level
            'prop.2.6': {'prop': 'modeType', 'setter': 'set_mode'},
        },
    },

otherwise power off switch does not work.

@soulthiefer
Copy link
Author

soulthiefer commented Jan 13, 2022

these parameters began to show

water_heater.target_temperature: 7
operation_mode: null
water_heater.status: null
water_heater.mode: null

power off switch also works
thank you again very much!

is there a similar solution for the camera and humidifier?

@Zuz666
Copy link
Contributor

Zuz666 commented Jan 14, 2022

@soulthiefer, this is an issue tracker, not a chat. ;) A separate issue should be created for a question about camera.

@soulthiefer
Copy link
Author

got it, thanks again)

@al-one
Copy link
Owner

al-one commented Jan 15, 2022

Does it work on the master branch ?

@soulthiefer
Copy link
Author

I made manual changes to the files that Zuz666 pointed out. viomi.waterheater.e1 works, no errors.
need to check in another way? tell me how i can check

@al-one
Copy link
Owner

al-one commented Jan 15, 2022

@soulthiefer Upgrade to master branch again.

@soulthiefer
Copy link
Author

soulthiefer commented Jan 15, 2022

@al-one im update integration in HACS , and the data is wrong again (((
Screenshot_2022-01-15-20-36-19-314_com opera browser

Also there are errors in the logs
Эта ошибка возникла в кастомной интеграции.

Logger: custom_components.xiaomi_miot.water_heater
Source: custom_components/xiaomi_miot/init.py:1312
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 19:55:59 (87 occurrences)
Last logged: 20:39:01

Xiaomi_Waterheat Water Heater: Got miio properties ['washStatus', 'velocity', 'waterTemp', 'targetTemp', 'errStatus', 'hotWater', 'needClean', 'modeType', 'appointStart', 'appointEnd'] failed: {'code': -9998, 'message': 'user ack invalid'}

@soulthiefer
Copy link
Author

now I copied only the file miio2miot_specs.py
device viomi.waterheater.e1 in card GUI is inactive and great mistake in logs
1:
Эта ошибка возникла в кастомной интеграции.

Logger: aiohttp.server
Source: custom_components/xiaomi_miot/core/miio2miot.py:8
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 21:49:36 (1 occurrences)
Last logged: 21:49:36

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 71, in delete
result = await hass.config_entries.async_remove(entry_id)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 831, in async_remove
await entry.async_remove(self.hass)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 487, in async_remove
component = integration.get_component()
File "/usr/src/homeassistant/homeassistant/loader.py", line 522, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/config/custom_components/xiaomi_miot/init.py", line 50, in
from .core.miio2miot import Miio2MiotHelper
File "/config/custom_components/xiaomi_miot/core/miio2miot.py", line 8, in
from .miio2miot_specs import MIIO_TO_MIOT_SPECS
File "/config/custom_components/xiaomi_miot/core/miio2miot_specs.py", line 7

^
SyntaxError: invalid syntax

And 2:
Эта ошибка возникла в кастомной интеграции.

Logger: homeassistant.setup
Source: custom_components/xiaomi_miot/core/miio2miot.py:8
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 21:46:01 (1 occurrences)
Last logged: 21:46:01

Setup failed for xiaomi_miot: unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 181, in _async_setup_component
component = integration.get_component()
File "/usr/src/homeassistant/homeassistant/loader.py", line 522, in get_component
cache[self.domain] = importlib.import_module(self.pkg_path)
File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/config/custom_components/xiaomi_miot/init.py", line 50, in
from .core.miio2miot import Miio2MiotHelper
File "/config/custom_components/xiaomi_miot/core/miio2miot.py", line 8, in
from .miio2miot_specs import MIIO_TO_MIOT_SPECS
File "/config/custom_components/xiaomi_miot/core/miio2miot_specs.py", line 7

^
SyntaxError: invalid syntax

@Zuz666
Copy link
Contributor

Zuz666 commented Jan 15, 2022

@soulthiefer Upgrade to master branch again.

I do not know all the features of your cool integration, I just found a place that leads to an error. Check out the post: #375 (comment) the problem is viomi.waterheater.e1 can only get one property by miIO local protocol.

I have this device and I sometimes edit your integration to make it work, unfortunately, I can't find the time to issue a pull request yet.

@soulthiefer
Copy link
Author

soulthiefer commented Jan 15, 2022

maybe these errors will help to understand the reason

device_customizes.py:

    'viomi.waterheater.e1': {
        'chunk_properties': 1,
        'miio_properties': 'washStatus,velocity,waterTemp,targetTemp,errStatus,'
                           'hotWater,needClean,modeType,appointStart,appointEnd',
    },

init.py:

    def update_miio_props(self, props):
        if not self.miot_device:
            return
        try:
            max_properties = self.custom_config_integer('chunk_properties') or 10
            attrs = self._device.get_properties(props, max_properties=max_properties)
        except DeviceException as exc:

result: image

When i make manual changes that I wrote to the files init.py and in device_customizes.py: , then the integration works. But when i update this integration in hacs , integration not work again(

can you write these this changes to the hacs integration files?

@al-one
Copy link
Owner

al-one commented Jan 17, 2022

Thanks, my mistake. Fixed now.

@soulthiefer
Copy link
Author

there are no errors in the server logs. but the current temperature does not show again(
image

@al-one
Copy link
Owner

al-one commented Jan 18, 2022

Upgrade to master branch again.

@soulthiefer
Copy link
Author

everything is working!!! Great !!! cool!!! thank you very much !!!

@al-one al-one added the bug Something isn't working label Jan 18, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working device: water-heater fixed bug fixed
Projects
None yet
Development

No branches or pull requests

3 participants