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

Fan component not working #205

Open
1 task done
tukey42 opened this issue Apr 10, 2024 · 0 comments
Open
1 task done

Fan component not working #205

tukey42 opened this issue Apr 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tukey42
Copy link

tukey42 commented Apr 10, 2024

!!! Before you start !!!

  • I have verified that there is not already an issue with the same problem
  • [ not really sure] This is really a bug of current code, not an enhancement request (f.e. adding support for a new device type). There is a dedicated template for feature-requests.

Describe the bug
When using a fan component in ESPHome, the adapter just creates one readonly state in ioBroker instead of multiple states (e.g. speed, direction, ...). See the log below.

In the adapter code I see the following call:

case 'Fan':
	await this.handleRegularState(`${host}`, entity, state, false);
	break;

I don't know, if the call should be replaced by a call to async handleStateArrays(host, entity, state)

To Reproduce
Steps to reproduce the behavior:

  1. Create a new device with given yaml.
  2. compile and flash the device
  3. see the states in ioBroker

Minimal! Yaml config to reproduce.
Keep all that is required to copy-paste, compile, flash and reproduce the issue - but try to remove as much as possible that is not relevant to this issue!
Just an example, insert you own yaml!:

esphome:
  name: test
  friendly_name: Test

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "verysecretapipassword"

ota:
  password: "verysecretotapassword"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
 
    
web_server:
  port: 80   

captive_portal:
    
output:
  - platform: esp8266_pwm
    id: motor_forward_pin
    pin: GPIO12
#    name: forward
  - platform: esp8266_pwm
    id: motor_reverse_pin
    pin: GPIO13
#    name: backward

fan:
  - platform: hbridge
    id: my_fan
    name: "Living Room Fan"
    pin_a: motor_forward_pin
    pin_b: motor_reverse_pin
    # enable_pin: motor_enable
    decay_mode: slow   # slow decay mode (coasting) or fast decay (braking).

Expected behavior
At least three states (state, direction, speed), which can control the fan, should be created in ioBroker

Logs (as screenshot and in text-form)

Create_state called for : 18FE34D64BD8.Fan.774144226.state with value : false
[entityStateData] {"key":774144226,"state":false,"oscillating":false,"speed":0,"direction":0,"speedLevel":54}
[entityStateConfig] {"config":{"objectId":"living_room_fan","key":774144226,"name":"Living Room Fan","uniqueId":"testfanliving_room_fan","supportsOscillation":false,"supportsSpeed":true,"supportsDirection":true,"supportedSpeedLevels":100,"disabledByDefault":false,"icon":"","entityCategory":0},"name":"Living Room Fan","type":"Fan","unit":""}

Versions:

  • Adapter version: 0.5.0-beta.8
  • ESPHome Dashboard version: 2024.3.1 (not sure, if this is really the version number)
  • JS-Controller version: 5.0.19
  • Node version: 18.19.1
  • Operating system: Debian Docker Image running on PhotonOS
  • Installation Method: Docker.
@tukey42 tukey42 added the bug Something isn't working label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants