vlebourl / custom_vesync

Custom VeSync component for Home Assistant
96 stars 60 forks source link

The Dual 200S Needs an Entity like: switch.humidifier_power_switch #127

Closed Lasakro closed 1 year ago

Lasakro commented 1 year ago

The problem

This needs to have a 10th entity stripped out for user use. Something like switch.humidifier_power_switch boolean. Great work so far.

What version of this integration has the issue?

2.14

What version of Home Assistant Core has the issue?

4.1

Diagnostics

NA

Home Assistant log

Logs ```py Copy/paste any log here, between the starting and ending backticks. ```

Additional information

No response

github-actions[bot] commented 1 year ago

'There hasn't been any activity on this issue recently. Is this issue still present? Please make sure to update to the latest Home Assistant version and version of this integration to see if that solves the issue. Let us know if that works for you by adding a comment 👍. This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.'

Lasakro commented 1 year ago

Yes this still exists. Control from the device level, like in scripts, you can turn the device on and off. But at the entity level there is no on / off capable entity.

github-actions[bot] commented 1 year ago

'There hasn't been any activity on this issue recently. Is this issue still present? Please make sure to update to the latest Home Assistant version and version of this integration to see if that solves the issue. Let us know if that works for you by adding a comment 👍. This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.'

Lasakro commented 1 year ago

Yes this still exists.

vlebourl commented 1 year ago

Hi, thanks for the issue. I'm not sure to understand correctly what you want. Furthermore, this doesn't make sense to me:

What version of this integration has the issue?
2.14

What version of Home Assistant Core has the issue?
4.1

Can you explain what you mean and provide the content of the diagnostics file?

Lasakro commented 1 year ago

Yes I'm using the above versions. There are only 3 Switch Entities available: switch.200s_auto_mode switch.200s_automatic_stop switch.humidifier_display But no switch to turn it on or off.

vlebourl commented 1 year ago

I'm not sure what integration you're using... Please provide the diagnostics file (go to Settings > Device and Services page, find the vesync integration, click the 3dots menu and Download diagnostics).

Here's what I have regarding versions:

About Home Assistant: image

"Home Assistant Core" refers to 2023.4.6. 4.1 doesn't make sense to me.

Intergration versions are here: https://github.com/vlebourl/custom_vesync/releases 2.14 doesn't refere to any existing version...

vlebourl commented 1 year ago

I believe you are not using my custom integration, but rather the native one from home assistant. To use this component, please follow instructions here: https://github.com/vlebourl/custom_vesync/blob/main/README.md#installation

Lasakro commented 1 year ago

I appreciate the instructions about the Download Diagnostics. I didn't know what that was, now I do and attached. From the file I see that I have Home Assistant OS version is 4.6, Home Assistant Supervisor is 4.1, that's where I got that from.

I don't know where I got 2.14 from. Just to be sure I deleted the Integration I had, rebooted HA, and re-installed from your provided link (V0.2.8) and rebooted. I don't know why the attached file shows under custom components vesync 0.2.5 but there are still only 9 entities available, none being device on/off.

config_entry-vesync-ce2b4b257d7ddc1c7cf08461de3a2efb.json.txt

vlebourl commented 1 year ago

Hey, I updated the integration to v1.0.0 today, can you update and paste the diagnostics below? Use a code block like this: ```json your diagnostics ```

Lasakro commented 1 year ago

I deleted the past integration, 0.2.8, and installed the one showing 1.0.0 at the top of the Github site. Not sure if it matters but my diagnostics, attached, still reads: "vesync": { "version": "0.2.5", "requirements": [ "pyvesync==2.1.6"

I also still only have 9 entities. None named something like switch.humidifier_power. config_entry-vesync-7d9602c0237cf5008f98dfcc5e8427e7.json.txt

{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.4.6", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.10.10", "docker": true, "arch": "x86_64", "timezone": "America/New_York", "os_name": "Linux", "os_version": "6.1.25", "supervisor": "2023.04.1", "host_os": "Home Assistant OS 10.1", "docker_version": "23.0.3", "chassis": "vm", "run_as_root": true }, "custom_components": { "hacs": { "version": "1.32.1", "requirements": [ "aiogithubapi>=22.10.1" ] }, "webrtc": { "version": "v3.1.0", "requirements": [] }, "vesync": { "version": "0.2.5", "requirements": [ "pyvesync==2.1.6" ] }, "smart_thermostat": { "version": "2021.11.1", "requirements": [] }, "localtuya": { "version": "5.0.0", "requirements": [] } }, "integration_manifest": { "domain": "vesync", "name": "VeSync", "codeowners": [ "@markperdue", "@webdjoe", "@thegardenmonkey", "@vlebourl" ], "config_flow": true, "dhcp": [ { "hostname": "levoit-*", "macaddress": "*" } ], "documentation": "https://www.home-assistant.io/integrations/vesync", "iot_class": "cloud_polling", "issue_tracker": "https://github.com/vlebourl/custom_vesync", "requirements": [ "pyvesync==2.1.6" ], "version": "0.2.5", "is_built_in": false }, "data": { "humidifier": [ { "device_name": "Humidifier", "device_image": "https://image.vesync.com/defaultImages/deviceDefaultImages/wifibtonboardingnotify_airhumidifier_dual200s_us_240.png", "cid": "**REDACTED**", "connection_status": "online", "connection_type": "WiFi+BTOnboarding+BTNotify", "device_type": "Dual200S", "type": "wifi-air", "uuid": "**REDACTED**", "config_module": "WiFiBTOnboardingNotify_AirHumidifier_Dual200S_US", "mac_id": "**REDACTED**", "mode": null, "speed": null, "extension": null, "current_firm_version": null, "device_region": "US", "pid": null, "sub_device_no": null, "config": { "auto_target_humidity": 30, "display": true, "automatic_stop": true }, "device_status": "off", "enabled": true, "config_dict": { "module": "VeSyncHumid200300S", "models": [ "Dual200S", "LUH-D301S-WUSR", "LUH-D301S-WJP", "LUH-D301S-WEU" ], "features": [], "mist_modes": [ "auto", "manual" ], "mist_levels": [ 1, 2 ] }, "mist_levels": [ 1, 2 ], "mist_modes": [ "auto", "manual" ], "features": [], "warm_mist_feature": false, "warm_mist_levels": [], "night_light": false, "details": { "humidity": 56, "mist_virtual_level": 1, "mist_level": 1, "mode": "manual", "water_lacks": false, "humidity_high": false, "water_tank_lifted": false, "display": true, "automatic_stop_reach_target": true }, "_api_modes": [ "getHumidifierStatus", "setAutomaticStop", "setSwitch", "setNightLightBrightness", "setVirtualLevel", "setTargetHumidity", "setHumidityMode", "setDisplay", "setLevel" ] } ] } }

Lasakro commented 1 year ago

Entities: Entities

github-actions[bot] commented 1 year ago

'There hasn't been any activity on this issue recently. Is this issue still present? Please make sure to update to the latest Home Assistant version and version of this integration to see if that solves the issue. Let us know if that works for you by adding a comment 👍. This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.'

Lasakro commented 1 year ago

Yes, still present.

vlebourl commented 1 year ago

Hi,

Your diagnostics show you are not using the custom integration... Otherwise it would show 1.0.0 as shown here https://github.com/vlebourl/custom_vesync/blob/2e2f77a95ea471d4717e4bff2dc6b1c0f7c6bd66/custom_components/vesync/manifest.json#L16

Can you post a screenshot of the integration page showing the vesync installation? It should show a box icon (see the README).

To make sure you use the correct one, please do the following:

Lasakro commented 1 year ago

config_entry-vesync-7d9602c0237cf5008f98dfcc5e8427e7.json.txt vsync

vlebourl commented 1 year ago

Okay, now we have the correct version

"vesync": {
      "version": "1.0.0",
      "requirements": [
        "pyvesync==2.1.6"
      ]
    }

Regarding the entities, 9 is correct. I have the same humidifier (LUH-D301S-WEU in my case) and also 9 entities: Screenshot_20230506-171746

But no on/off switch entity because the on/off is directly controlled by humidifier entity.

Screenshot_20230506-171818

I won't add a switch entity for that because that would be an extra entity for something already covered. If you absolutely need that entity and can't do it with the humidifier entity, you can have a look at template switches (https://www.home-assistant.io/integrations/switch.template/) using those services to control your template switch

Screenshot_20230506-172135

I'll close this issue now as I believe we covered the matter. Cheers

Lasakro commented 1 year ago

Without a 10th entity being on/off there is not a way to graph the state of on/off nor control it from plugin's and automatons which require a switch.some_entity. For the simple functions yes you can control power from the device level, for advance functions you can not. Are you still unwilling to strip out the power entity from the device?

vlebourl commented 1 year ago

I don't understand your problem... The start of the humidifier does reflect the on/off state and can be used in a graph of your choosing. Screenshot_20230506-201241 Screenshot_20230506-201647

If it helps, here's an automation using either the device or the service

alias: "Humidifier: on/off"
description: ""
trigger:
  - platform: numeric_state
    entity_id: humidifier.humidificateur
    attribute: current_humidity
    above: 60
    id: Stop
  - platform: numeric_state
    entity_id: humidifier.humidificateur
    attribute: current_humidity
    below: 40
    id: Start
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: Start
        sequence:
          - type: turn_on
            device_id: 3e74d70ba4ad2af8c97b4a563d3268b1
            entity_id: humidifier.humidificateur
            domain: humidifier
      - conditions:
          - condition: trigger
            id: Stop
        sequence:
          - service: humidifier.turn_off
            data: {}
            target:
              entity_id: humidifier.humidificateur
mode: single

If you still can't achieve your result with this and still need a dedicated switch, then your use case is too specific to justify adding the switch to this integration as every standard use case is already covered. A template switch should cover your needs. In your configuration.yaml, you can add something along the lines of:

switch:
  platform: template
  switches:
    humidifier_switch:
      value_template: "{{ is_state('humidifier.my_humidifier', 'on') }}"
      turn_on:
        service: humidifier.turn_on
        target:
          entity_id: humidifier.my_humidifier
      turn_off:
        service: humidifier.turn_off
        target:
          entity_id: humidifier.my_humidifier