JeffSteinbok / hass-dreo

Dreo Smart Device Integration for Home Assistant
MIT License
119 stars 34 forks source link

DR-HTF004S: Missing option for oscillation angle #125

Closed manacker closed 2 months ago

manacker commented 2 months ago

I'd like to set the oscillation angle for my fan via Home Assistant. In the attached device log the options are found under "device_control_oscillation" (id: 120), but there seems to be no way to access this in HA.

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.7.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "6.6.31-haos-raspi",
    "supervisor": "2024.06.2",
    "host_os": "Home Assistant OS 12.4",
    "docker_version": "26.1.4",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "dreo": {
      "documentation": "https://github.com/jeffsteinbok/hass-dreo/blob/master/README.md",
      "version": "0.1.3",
      "requirements": [
        "websockets"
      ]
    }
  },
  "integration_manifest": {
    "domain": "dreo",
    "name": "Dreo",
    "codeowners": [
      "jeffsteinbok",
      "andy-cooper"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/jeffsteinbok/hass-dreo/blob/master/README.md",
    "iot_class": "cloud_push",
    "issue_tracker": "https://github.com/jeffsteinbok/hass-dreo/issues",
    "loggers": [
      "dreo",
      "pydreo"
    ],
    "requirements": [
      "websockets"
    ],
    "version": "0.1.3",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 3.296299837529659e-05
    },
    "75947b1ce8daf12b5b1081d8fe7bebdf": {
      "wait_import_platforms": -0.008162689162418246,
      "config_entry_setup": 2.398392234928906
    }
  },
  "data": {
    "dreo": {
      "fan_count": 1,
      "heater_count": 0,
      "acs_count": 0,
      "raw_devicelist": {
        "code": 0,
        "msg": "OK",
        "data": {
          "currentPage": 1,
          "pageSize": 100,
          "totalNum": 1,
          "totalPage": 1,
          "list": [
            {
              "deviceId": "1789219179416072194",
              "sn": "1453300621256003586-20b8b5e2ce3d1c29:001:0000000000s",
              "brand": "Dreo",
              "model": "DR-HTF004S",
              "productId": "1453300621256003586",
              "productName": "Tower Fan",
              "deviceName": "Tower Fan",
              "shared": false,
              "series": null,
              "seriesName": "Pilot Max S",
              "color": "s",
              "controlsConf": {
                "template": "DR-HTF004S",
                "lottie": {
                  "key": "poweron",
                  "frames": [
                    {
                      "value": 0,
                      "frame": [
                        0
                      ]
                    },
                    {
                      "value": 1,
                      "frame": [
                        2
                      ]
                    }
                  ]
                },
                "schedule": {
                  "modes": [
                    {
                      "icon": "ic_normal_wind_color",
                      "title": "device_fans_mode_straight",
                      "cmd": "windtype",
                      "value": 1,
                      "valueType": 1,
                      "isSelected": true,
                      "attention": [
                        "windtype",
                        "windlevel",
                        "poweron",
                        "shakehorizon",
                        "shakehorizonangle"
                      ],
                      "controls": [
                        {
                          "type": 0,
                          "title": "device_control_mode_manual_level",
                          "startColor": "#0051CF",
                          "endColor": "#0051CF",
                          "cmd": [
                            "windlevel"
                          ],
                          "value": 9,
                          "valueType": 1,
                          "startValue": 1,
                          "endValue": 12,
                          "groupId": 0,
                          "icon": "ic_sch_wind_speed",
                          "isSelected": false
                        }
                      ]
                    },
                    {
                      "icon": "ic_natural_wind_color",
                      "title": "device_fans_mode_natural",
                      "cmd": "windtype",
                      "value": 2,
                      "valueType": 1,
                      "isSelected": false,
                      "attention": [
                        "windtype",
                        "windlevel",
                        "poweron",
                        "shakehorizon",
                        "shakehorizonangle"
                      ],
                      "controls": [
                        {
                          "type": 0,
                          "valueType": 1,
                          "title": "device_control_mode_manual_level",
                          "startColor": "#0051CF",
                          "endColor": "#0051CF",
                          "cmd": [
                            "windlevel"
                          ],
                          "value": 9,
                          "startValue": 1,
                          "endValue": 12,
                          "groupId": 0,
                          "icon": "ic_sch_wind_speed",
                          "isSelected": false
                        }
                      ]
                    },
                    {
                      "icon": "ic_sleep_wind_color",
                      "title": "device_fans_mode_sleep",
                      "cmd": "windtype",
                      "value": 3,
                      "valueType": 1,
                      "isSelected": false,
                      "attention": [
                        "windtype",
                        "windlevel",
                        "poweron",
                        "shakehorizon",
                        "shakehorizonangle"
                      ],
                      "controls": [
                        {
                          "type": 0,
                          "title": "device_control_mode_manual_level",
                          "startColor": "#0051CF",
                          "endColor": "#0051CF",
                          "cmd": [
                            "windlevel"
                          ],
                          "value": 9,
                          "valueType": 1,
                          "startValue": 1,
                          "endValue": 12,
                          "groupId": 0,
                          "isSelected": false,
                          "icon": "ic_sch_wind_speed"
                        }
                      ]
                    },
                    {
                      "icon": "ic_auto_wind_color",
                      "title": "device_control_mode_auto",
                      "cmd": "windtype",
                      "value": 4,
                      "valueType": 1,
                      "isSelected": false,
                      "attention": [
                        "windtype",
                        "windlevel",
                        "poweron",
                        "shakehorizon",
                        "shakehorizonangle"
                      ],
                      "controls": [
                        {
                          "type": 0,
                          "title": "device_control_mode_manual_level",
                          "startColor": "#0051CF",
                          "endColor": "#0051CF",
                          "cmd": [
                            "windlevel"
                          ],
                          "value": 9,
                          "valueType": 1,
                          "startValue": 1,
                          "endValue": 12,
                          "groupId": 0,
                          "isSelected": false,
                          "icon": "ic_sch_wind_speed"
                        }
                      ]
                    }
                  ]
                },
                "cards": [
                  {
                    "type": 2,
                    "title": "device_control_temp",
                    "icon": "",
                    "image": "",
                    "url": "",
                    "show": true
                  },
                  {
                    "type": 8,
                    "title": "",
                    "icon": "",
                    "image": "",
                    "url": "dreo://nav/device/schedule?deviceSn={sn}",
                    "show": true,
                    "key": "",
                    "minVersion": "2.5.0"
                  },
                  {
                    "type": 6,
                    "title": "device_settings_title",
                    "icon": "ic_setting",
                    "image": "",
                    "url": "dreo://nav/device/setting?deviceSn=${sn}",
                    "show": true,
                    "key": "setting"
                  },
                  {
                    "type": 6,
                    "title": "base_clean_tutorial",
                    "icon": "https://resources.dreo-cloud.com/app/202312/4/c06d58240e114f019c92abf5d3bd6f8c.png",
                    "image": "",
                    "url": "https://fe.dreo.com/guides/product-clean/pilot-max-s",
                    "show": true,
                    "minVersion": "2.6.8"
                  }
                ],
                "feature": {
                  "schedule": {
                    "enable": true,
                    "localSupport": false,
                    "module": [
                      {
                        "type": "HeFi",
                        "version": "3.2.1"
                      }
                    ]
                  }
                },
                "preference": [
                  {
                    "id": "200",
                    "type": "Panel Sound",
                    "title": "device_control_panelsound",
                    "image": "ic_mute",
                    "reverse": false,
                    "cmd": "voiceon"
                  },
                  {
                    "id": "220",
                    "type": "Light Detection",
                    "title": "device_control_lightdetection",
                    "image": "ic_lightsensoron",
                    "reverse": false,
                    "cmd": "lightsensoron"
                  },
                  {
                    "id": "230",
                    "type": "Temperature Unit",
                    "title": "device_control_temp_unit",
                    "image": "ic_temp_unit"
                  },
                  {
                    "id": "250",
                    "type": "Temperature Calibration",
                    "title": "device_control_temp_calibration",
                    "image": "ic_temp_cal"
                  }
                ],
                "control": [
                  {
                    "id": "100",
                    "type": "Mode",
                    "title": "device_mode",
                    "items": [
                      {
                        "text": "device_fans_mode_straight",
                        "textColors": [
                          "#D5D6D7",
                          "#D5D6D7"
                        ],
                        "image": "ic_normal_wind",
                        "imageColors": [
                          "#D5D6D7",
                          "#25D7E4"
                        ],
                        "cmd": "windtype",
                        "value": 1
                      },
                      {
                        "text": "device_fans_mode_natural",
                        "textColors": [
                          "#D5D6D7",
                          "#D5D6D7"
                        ],
                        "image": "ic_natural_wind",
                        "imageColors": [
                          "#D5D6D7",
                          "#2CDD96"
                        ],
                        "cmd": "windtype",
                        "value": 2
                      },
                      {
                        "text": "device_control_mode_sleep",
                        "textColors": [
                          "#D5D6D7",
                          "#D5D6D7"
                        ],
                        "image": "ic_sleep_wind",
                        "imageColors": [
                          "#D5D6D7",
                          "#6249DF"
                        ],
                        "cmd": "windtype",
                        "value": 3
                      },
                      {
                        "text": "device_control_mode_auto",
                        "textColors": [
                          "#D5D6D7",
                          "#D5D6D7"
                        ],
                        "image": "ic_auto_wind",
                        "imageColors": [
                          "#D5D6D7",
                          "#0A80F5"
                        ],
                        "cmd": "windtype",
                        "value": 4
                      }
                    ]
                  },
                  {
                    "id": "110",
                    "type": "Speed",
                    "title": "device_control_speed",
                    "items": [
                      {
                        "text": "1",
                        "cmd": "windlevel",
                        "value": 1
                      },
                      {
                        "text": "12",
                        "cmd": "windlevel",
                        "value": 12
                      }
                    ]
                  },
                  {
                    "id": "120",
                    "type": "Oscillation",
                    "title": "device_control_oscillation",
                    "items": [
                      {
                        "text": "30\u00b0",
                        "cmd": "shakehorizonangle",
                        "value": 30
                      },
                      {
                        "text": "60\u00b0",
                        "cmd": "shakehorizonangle",
                        "value": 60
                      },
                      {
                        "text": "90\u00b0",
                        "cmd": "shakehorizonangle",
                        "value": 90
                      },
                      {
                        "text": "120\u00b0",
                        "cmd": "shakehorizonangle",
                        "value": 120
                      }
                    ],
                    "cmd": "shakehorizon"
                  }
                ],
                "category": "Tower Fan",
                "setting": [
                  {
                    "text": "Firmware Version",
                    "image": "image.png",
                    "value": "1.0.0",
                    "url": "dreo://control"
                  }
                ]
              },
              "mainConf": {
                "isSmart": true,
                "isWifi": true,
                "isBluetooth": true,
                "isVoiceControl": true
              },
              "resourcesConf": {
                "imageSmallSrc": "https://resources.dreo-cloud.com/app/202309/875e6941e87fa45a0b1adff97c54e34a5.png",
                "imageFullSrc": "https://resources.dreo-cloud.com/app/202309/81dff85f94e94402785a26a33c340a16b.zip",
                "imageSmallDarkSrc": "",
                "imageFullDarkSrc": ""
              },
              "servicesConf": [
                {
                  "key": "user_manual",
                  "value": "https://resources.dreo-cloud.com/app/202310/1277cfb68e9cd04f57bddae603da118f41.pdf"
                }
              ],
              "userManuals": [
                {
                  "url": "https://resources.dreo-cloud.com/app/202310/1277cfb68e9cd04f57bddae603da118f41.pdf",
                  "icon": null,
                  "desc": "User Manual",
                  "lang": "en"
                }
              ]
            }
          ]
        }
      }
    },
    "devices": {
      "fans": [
        {
          "_device_definition": {
            "__type": "<class 'custom_components.dreo.pydreo.models.DreoDeviceDetails'>",
            "repr": "DreoDeviceDetails(preset_modes=['normal', 'natural', 'sleep', 'auto'], range={'speed_range': (1, 12)}, hvac_modes=None, swing_modes=None)"
          },
          "_name": "Tower Fan",
          "_device_id": "1789219179416072194",
          "_sn": "**REDACTED**",
          "_brand": "Dreo",
          "_model": "DR-HTF004S",
          "_productId": "1453300621256003586",
          "_productName": "Tower Fan",
          "_deviceName": "Tower Fan",
          "_shared": false,
          "_series": null,
          "_seriesName": "Pilot Max S",
          "_color": "s",
          "_dreo": {
            "__type": "<class 'custom_components.dreo.pydreo.PyDreo'>",
            "repr": "<custom_components.dreo.pydreo.PyDreo object at 0x7f80790ef0>"
          },
          "_is_on": true,
          "_feature_key_names": {},
          "raw_state": {
            "code": 0,
            "msg": "OK",
            "data": {
              "mixed": {
                "mcu_hardware_model": {
                  "state": "midea-eur",
                  "timestamp": 1718850861
                },
                "wifi_ssid": "**REDACTED**",
                "windlevel": {
                  "state": 2,
                  "timestamp": 1719830938
                },
                "wifi_rssi": {
                  "state": -36,
                  "timestamp": 1719450252
                },
                "poweron": {
                  "state": true,
                  "timestamp": 1720188290
                },
                "windtype": {
                  "state": 2,
                  "timestamp": 1719659735
                },
                "shakehorizonangle": {
                  "state": 30,
                  "timestamp": 1719621865
                },
                "timeron": {
                  "state": {
                    "du": 0,
                    "ts": 1718850860
                  },
                  "timestamp": null
                },
                "voiceon": {
                  "state": false,
                  "timestamp": 1719450252
                },
                "wrong": {
                  "state": 0,
                  "timestamp": 1719450252
                },
                "module_firmware_version": {
                  "state": "1.2.52",
                  "timestamp": 1719450252
                },
                "mcuon": {
                  "state": true,
                  "timestamp": 1718850861
                },
                "connected": {
                  "state": true,
                  "timestamp": 1719450252
                },
                "timeroff": {
                  "state": {
                    "du": 0,
                    "ts": 1718850860
                  },
                  "timestamp": null
                },
                "shakehorizon": {
                  "state": true,
                  "timestamp": 1719450252
                },
                "network_latency": {
                  "state": 94,
                  "timestamp": 1719450252
                },
                "module_hardware_model": {
                  "state": "PAI-051",
                  "timestamp": 1719450252
                },
                "mcu_firmware_version": {
                  "state": "0.0.1",
                  "timestamp": 1718850861
                },
                "lightsensoron": {
                  "state": true,
                  "timestamp": 1719450252
                },
                "temperature": {
                  "state": 80,
                  "timestamp": 1720205575
                },
                "module_hardware_mac": "**REDACTED**"
              },
              "sn": "**REDACTED**",
              "productId": "1453300621256003586",
              "region": "eu-central-1"
            }
          },
          "_attr_cbs": [
            {
              "__type": "<class 'function'>",
              "repr": "<function DreoBaseDeviceHA.async_added_to_hass.<locals>.update_state at 0x7f63e4b060>"
            },
            {
              "__type": "<class 'function'>",
              "repr": "<function DreoBaseDeviceHA.async_added_to_hass.<locals>.update_state at 0x7f65771940>"
            },
            {
              "__type": "<class 'function'>",
              "repr": "<function DreoBaseDeviceHA.async_added_to_hass.<locals>.update_state at 0x7f63fe6980>"
            },
            {
              "__type": "<class 'function'>",
              "repr": "<function DreoBaseDeviceHA.async_added_to_hass.<locals>.update_state at 0x7f638a7ba0>"
            }
          ],
          "_lock": {
            "__type": "<class '_thread.lock'>",
            "repr": "<unlocked _thread.lock object at 0x7f66859b80>"
          },
          "_fan_speed": 5,
          "_wind_type": 1,
          "_wind_mode": null,
          "_shakehorizon": true,
          "_osc_mode": null,
          "_horizontally_oscillating": null,
          "_vertically_oscillating": null,
          "_temperature": 79,
          "_led_always_on": null,
          "_voice_on": false,
          "_light_sensor_on": true,
          "_mute_on": null,
          "_fixed_conf": null
        }
      ],
      "heaters": [],
      "acs": []
    }
  }
}
depeo commented 2 months ago

Same here, its too bad! I use that quite a lot.

JeffSteinbok commented 2 months ago

Should be in 0.7.0