Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

leshow.humidifier.jsq1 wrong water level reported #556

Closed
Aljutor opened this issue May 1, 2022 · 14 comments
Closed

leshow.humidifier.jsq1 wrong water level reported #556

Aljutor opened this issue May 1, 2022 · 14 comments

Comments

@Aljutor
Copy link

Aljutor commented May 1, 2022

Hi, I've got a leshow.humidifier.jsq1 but it reports water level wrongly

In devices states it is device.water_level: 1

min_humidity: 40
max_humidity: 70
available_modes: Off, Const Humidity, Strong, Sleep
device_class: humidifier
friendly_name: Mi Smart Evaporative Humidifer Pro Humidifier
supported_features: 1
humidity: 50
mode: Strong
model: leshow.humidifier.jsq1
lan_ip: *.*.*.*
mac_address: XX:XX:XX:XX:XX:XX
entity_class: MiotHumidifierEntity
miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:1
humidifier.on: true
humidifier.fault: 0
humidifier.mode: 1
humidifier.target_humidity: 50
device.water_level: 1
device.tsms_turn_off: 0
device.turn_off_dry_turn: true
device.warm_wind_turn: 1
device.mode: 1
alarm: true
environment.relative_humidity: 34
state_updater: lan
sub_entities: device-8.water_level-1, environment-3.relative_humidity-1

But if I use Xiaomi Miot Auto: get_properties service:
[{'did': 'prop.2.7', 'siid': 2, 'piid': 7, 'code': 0, 'value': 20}]
Same as in MiHome App

Home Assistant 2022.4.7
Xiaomi Miot 0.6.1

@al-one
Copy link
Owner

al-one commented May 2, 2022

leshow.humidifier.jsq1

There is no water_level property under the humidifier service in urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:1, only urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:2 has it, but it is debug state.

You need to specify it manually:

# configuration.yaml
xiaomi_miot:
  device_customizes:
    leshow.humidifier.jsq1:
      miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:2

@Aljutor
Copy link
Author

Aljutor commented May 2, 2022

From what I see there is water-percentage and water-level property in the "device" section but unfortunately I am not confident in reading this miot specs.

if I change specification manual as you say, after restart (both, config only and full reload) it's state reports as:

min_humidity: 40
max_humidity: 70
available_modes:
  - 'Off'
  - Const Humidity
  - Strong
  - Sleep
humidity: 49
mode: Strong
model: leshow.humidifier.jsq1
lan_ip: *.*.*.*
mac_address: XX:XX:XX:XX:XX:XX
entity_class: MiotHumidifierEntity
miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:1
humidifier.on: true
humidifier.fault: 0
humidifier.mode: 1
humidifier.target_humidity: 49
device.water_level: 2
device.tsms_turn_off: 0
device.turn_off_dry_turn: true
device.warm_wind_turn: 1
device.mode: 1
alarm: true
environment.relative_humidity: 32
state_updater: lan
device_class: humidifier
friendly_name: Mi Smart Evaporative Humidifer Pro Humidifier
supported_features: 1

This line seems strange:
miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:1

In configuration.yaml I have this:

xiaomi_miot:
  device_customizes:
    leshow.humidifier.jsq1:
      miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:2

Mb I am doing something wrong.

@al-one
Copy link
Owner

al-one commented May 3, 2022

Try restart HA.

@Aljutor
Copy link
Author

Aljutor commented May 4, 2022

Restarted HA, and whole machine (Raspberry PI 4B) - nothing, still uses old miot spec.
May be there are some logs where I can check what happening?

@Aljutor
Copy link
Author

Aljutor commented May 7, 2022

Try restart HA.

Restarted HA, checked logs - nothing, seems like it just ignoring miot_type option in customisation

@al-one
Copy link
Owner

al-one commented May 10, 2022

Try master branch.

@Aljutor
Copy link
Author

Aljutor commented May 10, 2022

Thanks for your work, updated, re added device via cloud:

min_humidity: 40
max_humidity: 70
available_modes:
  - 'Off'
  - Const Humidity
  - Strong
  - Sleep
humidity: 51
mode: Sleep
model: leshow.humidifier.jsq1
lan_ip: *.*.*.*
mac_address: XX:XX:XX:XX:XX:XX
entity_class: MiotHumidifierEntity
miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:2
humidifier.on: true
humidifier.fault: 0
humidifier.mode: 2
humidifier.target_humidity: 51
humidifier.water_level.error: '-704040003 Property does not exist'
debug.ntc_value.error: '-704040002 Service does not exist'
device.water_level: 2
device.tsms_turn_off: 0
device.turn_off_dry_turn: true
device.warm_wind_turn: true
device.mode: 2
device.turn_ovp.error: '-704040003 Property does not exist'
device.ntc_over_push.error: '-704040003 Property does not exist'
device.dry_turn.error: '-704040003 Property does not exist'
device.overwetting.error: '-704040003 Property does not exist'
screen.on.error: '-704040002 Service does not exist'
screen.brightness.error: '-704040002 Service does not exist'
alarm: true
environment.relative_humidity: 25
state_updater: cloud
device_class: humidifier
friendly_name: Mi Smart Evaporative Humidifer Pro Humidifier
supported_features: 1
sub_entities:
  - environment-3.relative_humidity-1

Over local wifi I have this (no updated mitt config)

min_humidity: 40
max_humidity: 70
available_modes:
  - 'Off'
  - Const Humidity
  - Strong
  - Sleep
humidity: 51
mode: Sleep
model: leshow.humidifier.jsq1
lan_ip: *.*.*.*
mac_address: XX:XX:XX:XX:XX:XX
entity_class: MiotHumidifierEntity
miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:1
humidifier.on: true
humidifier.fault: 0
humidifier.mode: 2
humidifier.target_humidity: 51
device.water_level: 2
device.tsms_turn_off: 0
device.turn_off_dry_turn: true
device.warm_wind_turn: 1
device.mode: 2
alarm: true
environment.relative_humidity: 25
state_updater: lan
device_class: humidifier
friendly_name: Mi Smart Evaporative Humidifer Pro Humidifier
supported_features: 1

al-one added a commit that referenced this issue May 14, 2022
@al-one
Copy link
Owner

al-one commented May 14, 2022

Fixed in cbdf7ef, try master branch.

@Aljutor
Copy link
Author

Aljutor commented May 14, 2022

Fixed in cbdf7ef, try master branch.

Great, now it reports water level locally.

Mb, some properties with 1 or -1 values should be treated as bool.
This humidifier have option for water pre heating (warm_wind) - it can be controlled via service, but for now there is no direct option in HA. How can it be done? Also light indicator brightness can be controlled in the app (full, half).

Thanks for you work.

min_humidity: 40
max_humidity: 70
available_modes:
  - 'Off'
  - Const Humidity
  - Strong
  - Sleep
humidity: 51
mode: Strong
model: leshow.humidifier.jsq1
lan_ip: *.*.*.*
mac_address: XX:XX:XX:XX:XX:XX
entity_class: MiotHumidifierEntity
miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:2
humidifier.on: true
humidifier.fault: 0
humidifier.mode: 1
humidifier.target_humidity: 51
humidifier.water_level: 20
debug.ntc_value: 0
device.water_level: 1
device.tsms_turn_off: 0
device.turn_off_dry_turn: true
device.warm_wind_turn: 0
device.mode: 1
device.turn_ovp: 3
device.ntc_over_push: 1
device.dry_turn: 0
device.overwetting: 0
screen.on.error: '-1'
screen.brightness.error: '-1'
alarm: true
environment.relative_humidity: 38
state_updater: lan
device_class: humidifier
friendly_name: Mi Smart Evaporative Humidifer Pro Humidifier
supported_features: 1

@Aljutor
Copy link
Author

Aljutor commented May 14, 2022

Added this to customize.yaml

humidifier.leshow_jsq1_a25f_humidifier:
  sensor_properties: water_level
sensor.leshow_jsq1_a25f_water_level_2:
  icon: mdi:waves-arrow-up

And now device look like this:

Screenshot 2022-05-15 at 02 17 02

@al-one
Copy link
Owner

al-one commented May 20, 2022

screen.on.error: '-1'

-1 is an error code returned by the device when obtaining the state.

About warm_wind ... :

# configuration.yaml
xiaomi_miot:
  device_customizes:
    leshow.humidifier.jsq1:
      miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:2
      sensor_properties: humidifier.water_level
      switch_properties: alarm,warm_wind_turn

@al-one
Copy link
Owner

al-one commented May 20, 2022

Try master again.

@Aljutor
Copy link
Author

Aljutor commented May 20, 2022

Re added entity with auto integration: (removed customise records):
Screenshot 2022-05-20 at 15 08 54

min_humidity: 40
max_humidity: 70
available_modes: Off, Const Humidity, Strong, Sleep
humidity: 50
mode: Strong
model: leshow.humidifier.jsq1
lan_ip: *.*.*.*
mac_address: XX:XX:XX:XX:XX:XX
entity_class: MiotHumidifierEntity
miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:2
humidifier.on: true
humidifier.fault: 0
humidifier.mode: 1
humidifier.target_humidity: 50
humidifier.water_level: 60
debug.ntc_value: 0
device.water_level: 3
device.tsms_turn_off: 0
device.turn_off_dry_turn: true
device.warm_wind_turn: 0
device.mode: 1
device.turn_ovp: 3
device.ntc_over_push: 0
device.dry_turn: 0
device.overwetting: 0
screen.on.error: -1
screen.brightness.error: -1
alarm: true
environment.relative_humidity: 37
state_updater: lan
sub_entities: environment-3.relative_humidity-1, humidifier-2.water_level-7
device_class: humidifier
friendly_name: Mi Smart Evaporative Humidifer Pro Humidifier
supported_features: 1

With local, token only integration it still uses miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:1

@Aljutor
Copy link
Author

Aljutor commented May 20, 2022

Added some lines to config:

xiaomi_miot:
  device_customizes:
    leshow.humidifier.jsq1:
      miot_type: urn:miot-spec-v2:device:humidifier:0000A00E:leshow-jsq1:2
      sensor_properties: humidifier.water_level
      switch_properties: alarm,warm_wind_turn,turn_ovp,dry_turn,turn_off_dry_turn
      number_properties: screen_brightness,tsms_turn_off

Now device looks like this:

Screenshot 2022-05-20 at 15 46 03

@al-one al-one closed this as completed Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants