GithubHelp home page GithubHelp logo

anko kmart fan about tuya-local HOT 20 CLOSED

make-all avatar make-all commented on June 18, 2024
anko kmart fan

from tuya-local.

Comments (20)

make-all avatar make-all commented on June 18, 2024

Take a look at the custom_components/tuya_local/devices directory. It will need a yaml file similar to the ones in there now - probably closest to the goldair_fan.yaml. Minimal would be a primary_entity of entity:fan, and each dps specified with its id, type, and name which should match the names for specific functions in custom_components/tuya_local/generic/fan.py.
It is best if you can specify all DPS in the yaml file, even if you don't know what the functions are for some of them, as it will help with device detection. With just 1 - 6, I think there might be a heater or two that clash.

from tuya-local.

make-all avatar make-all commented on June 18, 2024

Generally I would write a test for it as well, to make sure everything works as expected, the tests are in tests/devices, but to get it going quickly, it can be done later. Also, if it cannot be auto-detected due to DPS clashing with another device, I think it will need some work in the config related files, as currently they have a fixed list of options, and haven't yet been modified to take that list from the config files.

from tuya-local.

hazell20 avatar hazell20 commented on June 18, 2024

Thank for the quick reply I had stated to look if I could edit the golder fan file. I will have a bit off a play with it post back if I have success so it can be added.

from tuya-local.

make-all avatar make-all commented on June 18, 2024

Based on the information you provided so far, and the manual here: https://www.kmart.com.au/wcsstore/Kmart/pdfs/42779896_Manual.pdf

I think the following should work (filename anko_fan.yaml)

name: Anko Fan
primary_entity:
  entity: fan
  dps:
    - id: 1
      type: boolean
      name: switch
    - id: 2
      type: string
      name: preset_mode
      mapping:
        - dps_val: normal
          value: normal
        - dps_val: nature
          value: nature
        - dps_val: sleep
          value: sleep
    - id: 3
      type: integer
      name: speed
      range:
        min: 1
        max: 8
      mapping:
        - scale: 0.08
    - id: 4
      type: string
      name: oscillate
      mapping:
        - dps_val: "auto"
          value: true
        - dps_val: "off"
          value: false
    - id: 6
      type: integer
      name: timer

from tuya-local.

hazell20 avatar hazell20 commented on June 18, 2024

hey mate
thank you for creating that file. had not played with it yet also that is the fans manual
will try the file tonight

regards
rhys

from tuya-local.

hazell20 avatar hazell20 commented on June 18, 2024

Hey mate is their a log I can look at to make sure its using the new configuration I think its trying to use the goldair one as it does strange things

from tuya-local.

make-all avatar make-all commented on June 18, 2024

There should be some indication of what is going on in the Home Assistant Core log. It may require INFO level logging to be enabled.

Make sure you set the type to Auto, not fan. "fan" is for the Goldair fan, definitely, but I don't think it will misdetect this one as the Goldair fan if it is on auto, more likely is one of the heaters.

from tuya-local.

hazell20 avatar hazell20 commented on June 18, 2024

hey mate
I have managed to test your file I could do everything except for speed changing and the fan freaks out when you try change.

this what I manged to grab from the logs

ogger: homeassistant.components.websocket_api.http.connection
Source: custom_components/tuya_local/helpers/device_config.py:391
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 9:14:38 AM (1 occurrences)
Last logged: 9:14:38 AM

[2747037296] Target speed (12) must be between 1 and 8
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 760, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
await result
File "/config/custom_components/tuya_local/generic/fan.py", line 158, in async_set_percentage
await self._speed_dps.async_set_value(self._device, percentage)
File "/config/custom_components/tuya_local/helpers/device_config.py", line 228, in async_set_value
settings = self.get_values_to_set(device, value)
File "/config/custom_components/tuya_local/helpers/device_config.py", line 391, in get_values_to_set
raise ValueError(
ValueError: Target speed (12) must be between 1 and 8

regards
rhys

from tuya-local.

make-all avatar make-all commented on June 18, 2024

How are you setting the speed? By the UI, or by a service call or Developer UI?

The range of the speed should be 1 to 8, which is translated in the UI to 0-100% (since Google, Alexa and Apple Homekit all work with percentages, but their abilities vary in dealing with smaller ranges). Or is the range 1-8 wrong for this fan, and the 12 comes from the fan itself?

from tuya-local.

hazell20 avatar hazell20 commented on June 18, 2024

it was just in the lovelace ui i will give it a go by a service call and test all the speeds again.

from tuya-local.

hazell20 avatar hazell20 commented on June 18, 2024

its strange here is the output i get from tuya-cli when list the device .

{ '1': true, '2': 'normal', '3': '3', '4': 'auto', '6': '0' }
{ '1': true, '2': 'normal', '3': '8', '4': 'auto', '6': '0' }

but when I try set the speed with tuya-cli set command --dps 3 --set 2
i get a Error [ERR_UNHANDLED_ERROR]: Unhandled error

from tuya-local.

make-all avatar make-all commented on June 18, 2024

Can you check if setting the speed works if you add quotes around the 2?

tuya-cli set --id xxxx -key xxxx --dps 3 --set '2'

from tuya-local.

hazell20 avatar hazell20 commented on June 18, 2024

hi mate
sorry had a busy weekend just put in that command and it timesout. i am about to read through the goldair fan you have mentioned to see if I can find anything useful

regards
rhys

from tuya-local.

hazell20 avatar hazell20 commented on June 18, 2024

its strange i can set other dps but when I try do the speed it timesout

from tuya-local.

make-all avatar make-all commented on June 18, 2024

Thanks for trying anyway. I guess I'll push out what I have with a note in the README about speed not working for now. If anyone figures it out, I can update it later.

from tuya-local.

hazell20 avatar hazell20 commented on June 18, 2024

that is alright mate I appreciate all the effort you have put in.

regards
rhys

from tuya-local.

make-all avatar make-all commented on June 18, 2024

If I understand correctly, the issues with speed were fixed by commits 1afc5d9 and db17ab4 (maybe some other commits to improve handling of scale).

from tuya-local.

mfx0r avatar mfx0r commented on June 18, 2024

Sorry to reopen, not sure if this helps at all.

fan:

  • platform: mqtt
    name: "Bedroom Fan"
    state_topic: "bedfan/stat/POWER1"
    command_topic: "bedfan/cmnd/POWER1"
    oscillation_state_topic: "bedfan/cmnd/TuyaSend1"
    oscillation_command_topic: "bedfan/cmnd/TuyaSend1"
    speed_state_topic: "bedfan/stat/speed"
    speed_command_topic: "bedfan/cmnd/TuyaSend4"
    qos: 0
    payload_on: 'ON'
    payload_off: 'OFF'
    payload_oscillation_on: '5,1'
    payload_oscillation_off: '5,0'
    payload_low_speed: '3,0'
    payload_medium_speed: '3,5'
    payload_high_speed: '3,11'

payload_highest_speed '3,5'

payload_max_speed: '3.4'

availability_topic: "bedfan/tele/LWT"
payload_available: Online
payload_not_available: Offline
speeds:
- 'off'
- low
- medium
- high
- highest

- max

from tuya-local.

make-all avatar make-all commented on June 18, 2024

That mess of numbers doesn't really help, but this did trigger me to relook at this early issue, and I realised that the speed is a string, not integer, so the config is wrong, and only works because of some fault tolerance that tries to detect quoted integers and allow them to pass as integers.

from tuya-local.

mfx0r avatar mfx0r commented on June 18, 2024

Sorry wasn't trying to confuse things. Thanks for responding though.

from tuya-local.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.