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

Fix custom power sensor with on/off values #1235

Closed
JonathanKang opened this issue Sep 22, 2023 · 2 comments
Closed

Fix custom power sensor with on/off values #1235

JonathanKang opened this issue Sep 22, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@JonathanKang
Copy link

I use this integration to fetch information of my Midea washing machine, which can be controlled using eWeLink app. After setting sonoff up, I added a custom sensor named sensor.sonoff_ab700XXXXX_power(see below for yaml configuration). The actual value of this entity is on or off. So it indicates whether the washing machine is turned on or off instead of the power consumption.

Added these custom sensors in configuration.yaml:

sonoff:
  sensors: [lock, door_opened, water_level, mode, progress, dehydration_time_value, power, temperature, wash_time, wash_time_value, remain_time, program, running_status, ultraviolet_lamp, detergent_lack, switch]
2023-09-22 11:51:36.510 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] ab700XXXXX UIID 0176 | {'bindInfos': {'miot': ['6f24a964-XXXX-XXXX-XXXX-74808229c2ce_ewelink-miot-v1']}, 'mideaConfig': {'applianceCode': '2111XXXXXXX', 'type': '0xDB'}, 'appointment': 'off',    'softener_lack': 'off', 'flocks_wash_count': 0, 'flocks_remind_period': 0, 'lock': 'off', 'door_opened': 'off', 'softener_density_global': 255, 'error_code': 0, 'add_rinse': '0', 'easy_ironing': 'off', 'water_level': 'auto', 'eye_wash': '0', 'cloud_cycle_jiepai_time2': 255,        'cloud_cycle_low': 0, 'mode': 'normal', 'detergent_density': 1, 'progress': 0, 'cloud_cycle_high': 0, 'dehydration_time_value': 0, 'appointment_time': 0, 'soak': 'off', 'softener': '0', 'old_speedy': 'off', 'cloud_cycle_jiepai_time3': 255, 'power': 'off', 'temperature': '40',      'memory': 'off', 'wash_time': 0, 'wash_time_value': 0, 'fast_clean_wash': 'off', 'ai_flag': 'off', 'detergent': '4', 'softener_global': 255, 'wind_dispel': '0', 'expert_step': 0, 'microbubble': '0', 'down_light': 'off', 'data_type': '0202', 'detergent_density_global': 255,         'remain_time': 58, 'dehydration_speed': '800', 'device_software_version': 0, 'dehydration_time': 0, 'project_no': 0, 'flocks_switcher': 'off', 'active_oxygen': '0', 'intelligent_wash': 'off', 'softener_density': 1, 'program': 'mixed_wash', 'steam_wash': 'off', 'detergent_global':  255, 'season': 1, 'disinfectant': '0', 'speedy': 'off', 'cycle_memory': 'on', 'running_status': 'idle', 'spray_wash': 'off', 'stains': '0', 'cloud_cycle_jiepai_time1': 255, 'cloud_cycle_jiepai1': 255, 'soak_count': '2', 'dryer': '0', 'cloud_cycle_jiepai_time4': 255, 'version': 54, 'dirty_degree': '0', 'cloud_cycle_jiepai2': 255, 'strong_wash': 'off', 'cloud_cycle_jiepai4': 255, 'customize_machine_cycle': 255, 'beforehand_wash': 'off', 'cloud_cycle_jiepai3': 255, 'ultraviolet_lamp': '1', 'detergent_lack': 'off', 'nightly': 'off', 'super_clean_wash': 'off',   'switch': 'on'}

The state of that entity is unknown. The state attribute is:

state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: Washing Machine Power

Besides, the auto generated entity switch.sonoff_ab700XXXXX shows the state of sensor.sonoff_ab700XXXXX_switch. It does not switch on/off the washing machine. I'm not exactly sure what the switch key in the json data actually does.

@AlexxIT AlexxIT added the enhancement New feature or request label Oct 15, 2023
@AlexxIT AlexxIT added this to the v3.6.0 milestone Oct 15, 2023
@AlexxIT AlexxIT self-assigned this Feb 13, 2024
@rhadeur
Copy link

rhadeur commented Mar 2, 2024

Is there any way to fix this? I am facing the same issue.

@AlexxIT AlexxIT changed the title Wrong device type of sensor.sonoff_ab700XXXXX_power Fix custom power sensor with on/off values Apr 17, 2024
@AlexxIT AlexxIT modified the milestones: v3.6.0, v3.7.0 Apr 17, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Apr 17, 2024

@AlexxIT AlexxIT closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants