Michsior14/ha-venta

Venta DeviceType: 500 (models AH550/AH555/AH510/AH515)

Closed this issue · 41 comments

What are the odds - I clicked HACS to see if there's a Venta humidifier integration and it was showcased in the newly submitted integrations HACS page before I cloud search for it myself :)

Unfortunately it shows no entities for my model - AH550 (AH555 is identical but black).
I don't know python and I'm not a programmer, but I took a glimpse at your code and it would seem that the url endpoint is just different. I changed /datastructure to /api/telemetry?request=set and now it shows entities, it reads everything correctly, but I can't actually set anything. I checked the logs after clicking 'power off' in HA:

2023-12-11 16:39:19.410 DEBUG (MainThread) [custom_components.venta.venta] Sending update request with data: None
2023-12-11 16:39:19.558 DEBUG (MainThread) [custom_components.venta.venta] Finished fetching venta data in 0.148 seconds (success: True)
2023-12-11 16:39:21.349 DEBUG (MainThread) [custom_components.venta.venta] Sending update request with data: {'Action': {'Power': False}}
2023-12-11 16:39:21.508 DEBUG (MainThread) [custom_components.venta.venta] Sending update request with data: None
2023-12-11 16:39:21.548 DEBUG (MainThread) [custom_components.venta.venta] Finished fetching venta data in 0.041 seconds (success: True)

and this showed me that you only pass {'Action': {'Power': False}} and my device unfortuanately has more required parameters than that (which is kinda stupid, but that's how it operates).

I have no idea how to update your code to make it work (essentially that's where my lack of programming knowledge crashes).

This is what HA shows:
Screenshot 2023-12-11 at 16 41 36
Screenshot 2023-12-11 at 16 45 12

Obviously AH5xx are simpler devices than LW7x and they have only these functions:
Action:

  • turn off/on — Power 0 or 1
  • set fan speed — FanSpeed 1, 2 or 3
  • set target humidity on auto — TargetHum min 30, max 70
  • dim LED panel — SleepMode 0 or 1
  • automatic mode — Automatic 0 or 1

Info:

  • total operation time — OperationT
  • time since last cleaned — ServiceT
  • time when service inticator should light up — ServiceMax
  • catch-all for all warnings — Warnings (it changes form 0 to 1 when water tank is empty)
  • software version — SWMain
  • hardware revision (?) — HwIndexMB

Measure:

  • current temp — Temperature
  • current humidity — Humidity

Humidifier responds succesfully to these POST commands and gives following json responses:

Get current device state

$ curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set"

Response:

{
  "Header": {
    "DeviceType": 500,
    "MacAdress": "40:91:51:[REDACTED]",
    "ProtocolV": "3.0"
  },
  "Action": {
    "Power": 1,
    "FanSpeed": 1,
    "TargetHum": 70,
    "SleepMode": 0,
    "Automatic": 0,
    "BaLi": 10
  },
  "Info": {
    "OperationT": 5053,
    "ServiceT": 11,
    "ServiceMax": 2016,
    "Warnings": 0,
    "SWMain": "1.0.0.6",
    "HwIndexMB": 1
  },
  "Measure": {
    "Temperature": 22.05997,
    "Humidity": 56.35614
  }
}

No idea what is BaLi.
Warning: 1 is catch-all for all errors, usually when it's out of water. There is no current water level indicator besides that.
If ServiceT == ServiceMax it shows a "Service" icon on the device to clean it up.

Set fan to manual lvl 1

$ curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{
    "Power": 1,
    "Automatic": 0,
    "SleepMode": 0,
    "FanSpeed": 1,
    "Action": "control"
}'

Response:

{
  "Header": {
    "DeviceType": 500,
    "MacAdress": "40:91:51:[REDACTED]",
    "ProtocolV": "3.0"
  },
  "Action": {
    "Power": 1,
    "FanSpeed": 1,
    "TargetHum": 70,
    "SleepMode": 0,
    "Automatic": 0,
    "BaLi": 10
  },
  "Info": {
    "OperationT": 5053,
    "ServiceT": 11,
    "ServiceMax": 2016,
    "Warnings": 0,
    "SWMain": "1.0.0.6",
    "HwIndexMB": 1
  },
  "Measure": {
    "Temperature": 22.12672,
    "Humidity": 53.76364
  }
}

Set to auto retaining currently set TargetHum

$ curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{
    "Power": 1,
    "Automatic": 1,
    "Action": "control"
}'

Response:

{
  "Header": {
    "DeviceType": 500,
    "MacAdress": "40:91:51:[REDACTED]",
    "ProtocolV": "3.0"
  },
  "Action": {
    "Power": 1,
    "FanSpeed": 3,
    "TargetHum": 70,
    "SleepMode": 0,
    "Automatic": 1,
    "BaLi": 10
  },
  "Info": {
    "OperationT": 5054,
    "ServiceT": 12,
    "ServiceMax": 2016,
    "Warnings": 0,
    "SWMain": "1.0.0.6",
    "HwIndexMB": 1
  },
  "Measure": {
    "Temperature": 22.29763,
    "Humidity": 53.00832
  }
}

Set target humidity to 50 on auto

$ curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{
    "Power": 1,
    "Automatic": 1,
    "TargetHum": 50,
    "Action": "control"
}'

Response:

{
  "Header": {
    "DeviceType": 500,
    "MacAdress": "40:91:51:[REDACTED]",
    "ProtocolV": "3.0"
  },
  "Action": {
    "Power": 1,
    "FanSpeed": 3,
    "TargetHum": 50,
    "SleepMode": 0,
    "Automatic": 1,
    "BaLi": 10
  },
  "Info": {
    "OperationT": 5054,
    "ServiceT": 12,
    "ServiceMax": 2016,
    "Warnings": 0,
    "SWMain": "1.0.0.6",
    "HwIndexMB": 1
  },
  "Measure": {
    "Temperature": 22.30564,
    "Humidity": 55.62677
  }
}

Dim LED panel

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{
    "Power": 1,
    "SleepMode": 1,
    "Automatic": 0,
    "FanSpeed": 1,
    "Action": "control"
}'

Response:

{
  "Header": {
    "DeviceType": 500,
    "MacAdress": "40:91:51:[REDACTED]",
    "ProtocolV": "3.0"
  },
  "Action": {
    "Power": 1,
    "FanSpeed": 1,
    "TargetHum": 50,
    "SleepMode": 1,
    "Automatic": 0,
    "BaLi": 10
  },
  "Info": {
    "OperationT": 5054,
    "ServiceT": 12,
    "ServiceMax": 2016,
    "Warnings": 0,
    "SWMain": "1.0.0.6",
    "HwIndexMB": 1
  },
  "Measure": {
    "Temperature": 23.03197,
    "Humidity": 55.04234
  }
}

Turn off

$ curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{
    "Power": 0,
    "Automatic": 0,
    "SleepMode": 0,
    "FanSpeed": 1,
    "Action": "control"
}'

Response:

{
  "Header": {
    "DeviceType": 500,
    "MacAdress": "40:91:51:[REDACTED]",
    "ProtocolV": "3.0"
  },
  "Action": {
    "Power": 0,
    "FanSpeed": 1,
    "TargetHum": 50,
    "SleepMode": 0,
    "Automatic": 0,
    "BaLi": 10
  },
  "Info": {
    "OperationT": 5054,
    "ServiceT": 12,
    "ServiceMax": 2016,
    "Warnings": 0,
    "SWMain": "1.0.0.6",
    "HwIndexMB": 1
  },
  "Measure": {
    "Temperature": 22.90913,
    "Humidity": 52.75196
  }
}

It seems that Power, Automatic, SleepMode, FanSpeed and Action are mandatory, even if insignificant for the current command (for example you'd think that "Power": 0 and "Action": "control" should be enough to turn the device off, but it actually also needs Automatic, SleepMode, FanSpeed in order for command to succeed). The only place where FanSpeed and SleepMode are not mandatory is when changing to auto mode. This is a bit problematic, bacause when for example I want to just dim the LED panel I don't want to change the fan speed as well, so I need to read current fan level value first and then pass it to the dim command even tho it doesn't need to change it . Unfortunately I have no idea how to update your code to do that.

I took most of my knowledge from GreyEarl/venta-air-api and that was for a smaller AH510 model that also has "DeviceType": 500 like mine.

If you'll be willing to take the time and add support to these line of devices I can even expose you it's API via cloudflare for a few days if needed.

Hey, thanks for the detailed issue. I will try to have a look on this during upcoming days since this shouldn't be that much of work.

Absolutely no rush! Ogromne dzięki!

@grzegor Could you please test this branch? Just download it as zip, copy over the venta directory into yours custom_components folder and restart home assistant. Next you will need to re-add the device with API version set to 3.

Thank you! The manual things work flawlessly now. Automatic however... I'm now beginning to understand why Venta is denying existance any form of API for their devices. Apperently not only SleepMode is not mandatory when Automatic: 1, but apparently it hates getting this parameter and refuses to do anything when it's present. Adding TargetHum to that mix and it then hates both SleepMode and FanSpeed. God, what a mess...

One last thing that personally don't bother me, but SleepMode is not really an operating mode. It just dims the display if set to 1 and brightens it up when 0, nothing else. I think it should be more of a toggle thing like with the "Power strip" control for yor device.

But in it's current state the integration works just fine for my needs, I usually run it on manual anyway and I really don't want to bother you to work more with this garbage API. Maybe somone sends a PR in the future that fixes the auto mode.

I also can't thank you enough for getting it to work! Do you have a ko-fi.com or something like that perhaps?

Are you sure SleepMode is not really a mode? If you change to level 3 and then toggle SleepMode on device, is it still on the same fan speed or it reverts back to 1? In my experience you can't really set the FanSpeed or Automatic with SleepMode and it overrides those with some kind of preset. This would also sync with your description.

I've updated the branch with small changes to reflect logic that works for API v2, please check if this helps with anything. It would be also great to know what happens if:

  1. Turn on (device off) with:
{
    "Power":  1,
    "Automatic": 1,
    "SleepMode": 1,
    "FanSpeed": 3,
    "Action": "control"
 }
  1. Turn off (device on) with:
{
    "Power":  0,
    "Automatic": 1,
    "SleepMode": 1,
    "FanSpeed": 3,
    "Action": "control"
 }
  1. Set humidity (device on, fan speed 3) with:
{
    "Power":  1,
    "TargetHum":  50,
    "Action": "control"
 }
  1. Set humidity (device on, sleep mode on) with:
{
    "Power":  1,
    "TargetHum":  50,
    "Action": "control"
 }

Regarding sponsoring, I am waiting for Github Sponsors to be live. Once it's there you can support me directly on github :) It's there: https://github.com/sponsors/Michsior14

I stripped all responses to "Action" section only for clarity.

1. Turn on (device off)

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{
    "Power":  1,
    "Automatic": 1,
    "SleepMode": 1,
    "FanSpeed": 3,
    "Action": "control"
 }'

[...] {"Power":1,"FanSpeed":3,"TargetHum":30,"SleepMode":1,"Automatic":0,"BaLi":10}

Device was turned on, display is dimmed, auto is 0 (but 1 was specified, setting SleepMode breakes it, see my additional info section at the end).

2. Turn off (device on)

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{
    "Power":  0,
    "Automatic": 1,
    "SleepMode": 1,
    "FanSpeed": 3,
    "Action": "control"
 }'

[...] {"Power":0,"FanSpeed":3,"TargetHum":30,"SleepMode":1,"Automatic":0,"BaLi":10}

Device turned off successfully.
Turning on with command no. 1 again before doing no. 3 (device is now on manual, also repeated 3 and 4 when device was previously on auto with exactly same results).

3. Set humidity (with device on, fan speed 3)

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{
    "Power":  1,
    "TargetHum":  50,
    "Action": "control"
 }'

[...] {"Power":1,"FanSpeed":3,"TargetHum":30,"SleepMode":1,"Automatic":0,"BaLi":10}

target humidity was unchanged, screen is still dimmed, the device changed nothing (it always replies with it's current status, even when it decides to NOOP).
Adding Automatic: 1 fixes it:

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{
    "Power":  1,
    "Automatic": 1,
    "TargetHum": 30,
    "Action": "control"
}'

[...] {"Power":1,"FanSpeed":1,"TargetHum":50,"SleepMode":0,"Automatic":1,"BaLi":10}

TargetHum now set correctly, screen went to bright mode.
Setting device to on, setting sleep mode to on and resetting target humidity to 30 before command no. 4.

4. Set humidity (device on, sleep mode on)

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '
{
    "Power":  1,
    "TargetHum":  50,
    "Action": "control"
 }'

[...] {"Power":0,"FanSpeed":3,"TargetHum":30,"SleepMode":1,"Automatic":0,"BaLi":10}

Nothing happened, again, there was no Automatic parameter. After adding it, even with value 0 the target humidity changed correctly (although obviously with Auto = 0 it won't use it until changed to 1 in the future):

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '
{
    "Power":  1,
    "TargetHum":  50,
    "Automatic": 0,
    "Action": "control"
 }'

[...] {"Power":1,"FanSpeed":3,"TargetHum":50,"SleepMode":0,"Automatic":0,"BaLi":10}

now the device is in manual with FanSpeed: 3 and bright display, TargetHum was set correctly with this command.

Additinal testing

SleepMode can't be added to any auto commands.

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '
{
    "Power":  1,
    "TargetHum":  70,
    "Automatic": 1,
    "SleepMode": 1,
    "Action": "control"
 }'

[...] {"Power":1,"FanSpeed":3,"TargetHum":50,"SleepMode":0,"Automatic":0,"BaLi":10}

Above command failed to change anything
When passing Auto = 0 but leaving TargetHum it also fails:

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '
{
    "Power":  1,
    "TargetHum":  70,
    "Automatic": 0,
    "SleepMode": 1,
    "Action": "control"
 }'

[...] {"Power":1,"FanSpeed":3,"TargetHum":50,"SleepMode":0,"Automatic":0,"BaLi":10}

When passing Auto = 0 and removing TargetHum it still fails:

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '
{
    "Power":  1,
    "Automatic": 0,
    "SleepMode": 1,
    "Action": "control"
 }'
[...] {"Power":1,"FanSpeed":3,"TargetHum":50,"SleepMode":0,"Automatic":0,"BaLi":10}

When passing Auto = 0, removing TargetHum and adding FanSpeed it finally succeeds:

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '
{
    "Power":  1,
    "Automatic": 0,
    "SleepMode": 1,
    "FanSpeed": 2,
    "Action": "control"
 }'

[...] {"Power":1,"FanSpeed":2,"TargetHum":50,"SleepMode":1,"Automatic":0,"BaLi":10}

Setting Auto = 1, SleepMode = 1 and FanSpeed = 3:

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '
{
    "Power":  1,
    "Automatic": 1,
    "SleepMode": 1,
    "FanSpeed": 3,
    "Action": "control"
 }'

[...] {"Power":1,"FanSpeed":3,"TargetHum":50,"SleepMode":1,"Automatic":0,"BaLi":10}

This is equal to the "on" command from no. 1. Device set the display to dimmed and FanSpeed to 3, it ignored auto = 1.
But after removing SleepMode from the equation but leaving "FanSpeed": 3 and "Automatic": 1:

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '
{
    "Power":  1,
    "Automatic": 1,
    "FanSpeed": 3,
    "Action": "control"
 }'
[...] {"Power":1,"FanSpeed":0,"TargetHum":50,"SleepMode":0,"Automatic":1,"BaLi":10}

It decided to switch to auto mode.

So it would seem that passing any command to the device always sets SleepMode: 0 (unless 1 was specified in the same command), but you can only pass SleepMode with manual settings. So no way to have dimmed display with auto. SleepMode also doesn't change in any way other device parameters - it just brightens or dims the display when issued with any manual fan setting respecting the desired fan speed. It also needs to be passed with each subsequent manual fan commands in order to be preserved.

Passing

{
    "Power":  1,
    "Automatic": 0,
    "SleepMode": 1,
    "FanSpeed": 3,
    "Action": "control"
 }

and then

{
    "Power":  1,
    "Automatic": 0,
    "FanSpeed": 2,
    "Action": "control"
 }

makes the fans go down from 3 to 2 but brightens the display after second command. When leaving "SleepMode": 1 in the second command it switches to 2 and dims the display.

TL;DR

The available operating modes are:

  • lvl 1, sleep 1
  • lvl 1, sleep 0
  • lvl 2, sleep 1
  • lvl 2, sleep 0
  • lvl 3, sleep 1
  • lvl 3, sleep 0
  • auto

But instead of cluttering the dropdown with all the permutations I think best would be a sleep toggle entity that would only be respected with manual commands.

Auto only wants Power, Automatic: 1, Action: "control" and optionally TargetHum. Breaks (or doesn't do what desired) with anything else specified.

Manual modes always wants Power, Automatic: 0, FanSpeed, Action: "control" and optionally SleepMode.

The device can be turned from off to on to either automatic mode with:
{ "Power": 1, "Automatic": 1, "Action": "control", [optional: TargetHum: XX] }
or to manual mode with:
{ "Power": 1, "Automatic": 0, "FanSpeed": 1..3, "Action": "control", [optional: SleepMode: 1] }.

Ohh, I see, this is then definitely different than on protocol V2. Nothing that can't be implemented tho, will try to adjust it tonight.

Awesome! I can expose the API directly to you if that helps with anything.

Please try again with the latest changes :)

Flawless! Auto and manual modes work exactly as intended!

Just to confirm. Is the switch for SleepMode working fine as well?

I can't really tell - I thought you got rid of it to simplify things. Where can I find it?

SCR-20231216-nncz-2 SCR-20231216-nnvs

Looks like I did a small typo last night, please update once again. It should show the switch entity in controls section.

Still nothing

Debug log:

2023-12-16 15:43:49.370 DEBUG (MainThread) [custom_components.venta.venta] Sending update request with data: None
2023-12-16 15:43:49.407 DEBUG (MainThread) [custom_components.venta.venta] Sending update request with data: None
2023-12-16 15:43:49.467 DEBUG (MainThread) [custom_components.venta.venta] Sending update request with data: None
2023-12-16 15:43:49.502 DEBUG (MainThread) [custom_components.venta.venta] Finished fetching venta data in 0.035 seconds (success: True)
2023-12-16 15:43:49.519 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up venta platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/venta/binary_sensor.py", line 95, in async_setup_entry
    entities = [
               ^
  File "/config/custom_components/venta/binary_sensor.py", line 98, in <listcomp>
    if description.key in sensors
       ^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'key'
2023-12-16 15:43:49.526 ERROR (MainThread) [homeassistant.components.switch] Error while setting up venta platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/venta/switch.py", line 77, in async_setup_entry
    entities = [
               ^
  File "/config/custom_components/venta/switch.py", line 78, in <listcomp>
    VentaSwitch(coordinator, description)
  File "/config/custom_components/venta/switch.py", line 101, in __init__
    self._attr_options = description.options
                         ^^^^^^^^^^^^^^^^^^^
AttributeError: 'VentaSwitchEntityDescription' object has no attribute 'options'

Thx for the logs, I am not next to my device so can't test it myself, but it should be good now (hopefully).

It showed up along with the sensors, but sadly it fails with the following error when trying to turn it on or off:

SCR-20231216-oeil

Copy paste errors start to pop, maybe now 😔

Now everything works just perfect! 😃

Changes released in v0.3.0! Thanks for the help!

Oh, it's definitely not you who should be thanking for help!

Just updated to 0.3 from HACS and just wanted to confirm it works as intended.

Regarding updated readme for 0.3 - you can't really check ProtocolV from the device's page on my model. AFAIK the only way is to query the API endpoint (with postdata, otherwise it shows 404 in the browser) for example from the terminal like this
curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry" -s | jq '.Header.ProtocolV'. But then again, you're querying the endpoint that, to the best of my knowledge, already suggests it's v3 exclusive (no idea about their AH902/AW902 line tho, so I might be wrong). Also if I were to bet none of their humidifiers will ever get a breaking change firmware update that will bump up the API version, unless it will be to Matter (doubtly for now), so it would be probably safe to assume LW7x = v2 and AH5xx = v3 and either have user to choose between models instead of API versions or autodetect them. But that is probably too small of a QoL improvement to warrant any more work on this.

The device's page in the browser for AH5xx is just a wifi configurator:
SCR-20231216-sapw

I wasn't sure how it looks on other devices. On LW7x it's actually a functional page: Screenshot_20231216-225743~2.png

Anyway I think it makes sense to try to auto detect it. It would be best if there is a unified way to achieve it on all devices, e.g. just GET/POST the root URL and read headers. Otherwise I could query on all known endpoints and try to read protocolV.

Oh, that's way more useful! I suspect they initially wanted to do the same, because the html try to include a script.js and the Vue framework (probably for control), but all of these files 404's.
SCR-20231216-ubvp

I also just find out that their inline embedded js communicates to a different API endpoint: /api/data, that responds as follows:

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/data"
{
  "ip": "192.168.150.219",
  "mac": "40:91:51:XX:XX:XX",
  "mode": 2,
  "ver": "1.0.0.6",
  "hw": 1,
  "device": {
    "hum": 49,
    "humt": 60,
    "temp": 22,
    "fan": 1,
    "auto": false,
    "sleep": false,
    "pow": true,
    "warn": 0
  },
  "known": {
    "ssid": "$MY_WIFI_SSID",
    "icon": 0,
    "state": 0,
    "is": true
  },
  "scan": []
}

but I don't think it helps with anything - there is no API version anywhere here.

I know this issue is closed, but this seem very related. First of all thank you @Michsior14 for implementing a working integration for Venta devices!

I am owner of a Venta Air AH500 for over a year and were successfully controlling it via REST commands. For me it is possible to set sleep mode for all modes, even auto. I have an automation to set it after sun down and reset it after sun rise. I use following command:

venta_air_set_sleep_mode:
    url: http://xxx.xxx.xxx.xxx/api/telemetry
    method: POST
    payload: '{ "SleepMode": {{ status }}, "Action": "control"}'
    verify_ssl: false

And this is how I used the command via switch

  - platform: template
    switches:
      venta_air_sleep_mode_switch:
        unique_id: "venta_air_ah500_sleep_mode_switch"
        value_template: "{{ state_attr('sensor.venta_air_ah500', 'Action')['SleepMode'] | int(0) >= 1 }}"
        turn_on:
          - service: rest_command.venta_air_set_sleep_mode
            data:
               status: 1
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.venta_air_ah500
        turn_off:
          - service: rest_command.venta_air_set_sleep_mode
            data:
               status: 0
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.venta_air_ah500
        friendly_name: Venta Air Sleep Mode Switch
        icon_template: >-
          {% if is_state('switch.venta_air_sleep_mode_switch', 'on') %}
            mdi:air-humidifier
          {% else %}
            mdi:air-humidifier-off
          {% endif %}

So maybe it is possible to implement this with this integration - what do you think? I can also create a new issue if required.

@Oxydation Could you please attach full response from api/telemetry (you can of course redact sensitive data)?

Also @grzegor if you have time could you check what happens if you try similar request as above? I think we did not test cases without Power property.

Auto-Mode and sleep enabled.

Disable sleep mode:
Command: { "SleepMode":0, "Action": "control"}

{
	"Header": {
		"DeviceType": 500,
		"MacAdress": "...",
		"ProtocolV": "3.0"
	},
	"Action": {
		"Power": 1,
		"FanSpeed": 0,
		"TargetHum": 49,
		"SleepMode": 0,
		"Automatic": 1,
		"BaLi": 10
	},
	"Info": {
		"OperationT": 31735,
		"ServiceT": 2016,
		"ServiceMax": 2016,
		"Warnings": 0,
		"SWMain": "1.0.0.6",
		"HwIndexMB": 1
	},
	"Measure": {
		"Temperature": 21.4992,
		"Humidity": 53.97726
	}
}

Enable sleep mode:
Command: { "SleepMode":1, "Action": "control"}

{
	"Header": {
		"DeviceType": 500,
		"MacAdress": "...",
		"ProtocolV": "3.0"
	},
	"Action": {
		"Power": 1,
		"FanSpeed": 0,
		"TargetHum": 49,
		"SleepMode": 1,
		"Automatic": 1,
		"BaLi": 10
	},
	"Info": {
		"OperationT": 31735,
		"ServiceT": 2016,
		"ServiceMax": 2016,
		"Warnings": 0,
		"SWMain": "1.0.0.6",
		"HwIndexMB": 1
	},
	"Measure": {
		"Temperature": 21.52857,
		"Humidity": 53.82925
	}
}

Auto-Mode and sleep enabled.

Disable sleep mode: Command: { "SleepMode":0, "Action": "control"}

{
	"Header": {
		"DeviceType": 500,
		"MacAdress": "...",
		"ProtocolV": "3.0"
	},
	"Action": {
		"Power": 1,
		"FanSpeed": 0,
		"TargetHum": 49,
		"SleepMode": 0,
		"Automatic": 1,
		"BaLi": 10
	},
	"Info": {
		"OperationT": 31735,
		"ServiceT": 2016,
		"ServiceMax": 2016,
		"Warnings": 0,
		"SWMain": "1.0.0.6",
		"HwIndexMB": 1
	},
	"Measure": {
		"Temperature": 21.4992,
		"Humidity": 53.97726
	}
}

Enable sleep mode: Command: { "SleepMode":1, "Action": "control"}

{
	"Header": {
		"DeviceType": 500,
		"MacAdress": "...",
		"ProtocolV": "3.0"
	},
	"Action": {
		"Power": 1,
		"FanSpeed": 0,
		"TargetHum": 49,
		"SleepMode": 1,
		"Automatic": 1,
		"BaLi": 10
	},
	"Info": {
		"OperationT": 31735,
		"ServiceT": 2016,
		"ServiceMax": 2016,
		"Warnings": 0,
		"SWMain": "1.0.0.6",
		"HwIndexMB": 1
	},
	"Measure": {
		"Temperature": 21.52857,
		"Humidity": 53.82925
	}
}

I wonder why yours fan is 0 in this case. Does it really change speed on sleep mode? Anyhow I would like to wait for one more person to check how this behaves because I can't really make the exception for your device since it's introducing itself in exactly the same way as others from this series.

Fan speed is 0 because it has reached target humidity, as you can see from the current humidity value.

I could send you the values with fan speed e.g. 1 by increasing target humidity before hand.

You can see here, that it does change often (0 to 1 for a few secs, then back to 0) to stay at target humidity, in sleep mode on or off:
Screenshot_2024-01-09-20-40-23-329_io.homeassistant.companion.android.jpg

Also @grzegor if you have time could you check what happens if you try similar request as above? I think we did not test cases without Power property.

Oh yeah - without passing the "Power" attribute it works:

curl -H "Content-Type: application/json" -X POST "$VENTA_LOCAL_IP/api/telemetry?request=set" -d '{"SleepMode": 1, "Action": "control"}'

It dimmed the display while staying on auto. Great find @Oxydation!

Funnily enough {"SleepMode": 0, "Action": "control"} doesn't seem to work if you'd want to brighten the display without issuing any action.

Also you're sure you have AH500? I don't think a device with this exact model ever existed in Venta lineup.
The AH5xx all report as "OriginalConnect AH500" in the Venta app, no matter what the actual model is.

Also you're sure you have AH500? I don't think a device with this exact model ever existed in Venta lineup. The AH5xx all report as "OriginalConnect AH500" in the Venta app, no matter what the actual model is.

@grzegor You are right - it's a Venta AH530 :-)

@grzegor Nice, thanks for checking! Looks like we can safely adjust turning on, but I am not sure what to do with turn off command since it doesn't work on your device :/

Also @Oxydation doesn't seems to use ?request=set when issuing the action, maybe this is important? Could you additionally try without it?

not sure what to do with turn off command

Probably just issue a command with the state the device is currently in. Without distinctly specifying SleepMode: 1 every command will double as turning off sleep mode as well.

@Oxydation Should be fixed in v0.4.1

Wait, so it wasn't in 0.4.0 already? 😮 I updated 2 days ago and tested the sleep mode button while in auto and it did appear to work! Can't retest it until Thursday tho as I'm 150 km away.

Wait, so it wasn't in 0.4.0 already? 😮 I updated 2 days ago and tested the sleep mode button while in auto and it did appear to work! Can't retest it until Thursday tho as I'm 150 km away.

In v0.4.0 sleep mode was always disabling auto mode. Not sure why it was behaving differently on your side :)

Ah, ok - maybe it disabled the auto then. Frankly I just pressed the button and noticed it got dimmed thinking the change was live already. Sorry for the mix-up then.

@grzegor what's that software you're using in this answer ? It looks sweet

SCR-20231216-ubvp

@pontos-dev I've no idea what you're referring to, your picture doesn't load.

Unavngivet

Oh.. hope this helps

Ohh.. it seems nice, thx for answer :)