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 Integration for Insteon not responding as expected after update to core 2021.3.0 #47387

Closed
brucek1642 opened this issue Mar 4, 2021 · 13 comments · Fixed by #47603 or #47765
Closed

Comments

@brucek1642
Copy link

The problem

Setting fan speed to 100 percent or off works as expected with the fan.set_percentage call. Setting speed to 33 percent, displays 25 percent when observed in developer tools --> state. Setting speed to 66 percent results in 100 percent. As a comparison I also have sonoff ifan03 with tasmota integration, those fan speeds seem to set properly.

What is version of Home Assistant Core has the issue?

core-2021.3.0

What was the last working version of Home Assistant Core?

core-2021.2.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

fan/insteon

Link to integration documentation on our website

https://www.home-assistant.io/integrations/insteon

Example YAML snippet

  - service: fan.set_percentage
    target:
      entity_id: fan.fanlinc_47_e6_94_fan
    data:
      percentage: 33
mode: single

Anything in the logs that might be useful for us?

no errors in logs

states from developer tools

speed_list:
  - 'off'
  - low
  - medium
  - high
preset_modes: []
speed: low
percentage: 25
percentage_step: 33.333333333333336
preset_mode: null
insteon_address: 47.E6.94
insteon_group: 2
friendly_name: Kitchen Island Fan
icon: 'mdi:fan'
supported_features: 1

@probot-home-assistant
Copy link

insteon documentation
insteon source
(message by IssueLinks)

@bdraco
Copy link
Member

bdraco commented Mar 5, 2021

We may need to set the speed_count to 100 for these devices as I believe they actually support 255 states. I'm using Insteon though an ISY so I can't test this directly. Can you try adding a speed_count property of 100 to fan.py?

@brucek1642
Copy link
Author

The environment I have is vanilla Home Assistant OS running on rpi4, I am not sure I can actually edit fan.py or know how to. That being said I am willing to try.

I did some additional testing with remote mini configured as controller, and fanlinc as responder. It's my backup control method. All the results in developer tools are as expected

  • pressing low on mini keypad results in developer displaying speed : low percentage: 33
  • pressing medium on mini keypad results in developer displaying speed : medium percentage: 66
  • pressing high on mini keypad results in developer displaying speed : high percentage: 100

The attached user manual on page 9 implies the speed range is 0-100

2475f-en.pdf

@bdraco
Copy link
Member

bdraco commented Mar 5, 2021

I ordered one of these and I'll do some testing when it comes in https://www.smarthome.com/products/insteon-2448a7-portable-usb-adapter

@bdraco
Copy link
Member

bdraco commented Mar 8, 2021

IMG_1070

SmartHome was quick with the shipping. Testing this now

@bdraco bdraco mentioned this issue Mar 8, 2021
21 tasks
@bdraco
Copy link
Member

bdraco commented Mar 8, 2021

@brucek1642 can you try the change in #47603 ?

@brucek1642
Copy link
Author

I have tried it

The update changed the symptoms.
set speed low or medium, set percentage 33 or 66 all work as expected
turn off is also fine

set speed high, or percentage 100 locks up so no insteon devices can be controlled by HA.
I left it in this state overnight, and was still in the same state in this morning
power cycling Insteon PLM .. no change
while in a locked state up, pressing on / off on the actual dimmer / speed does turn on / off and forwards the updated status to HA
restart of core 2021.3.3 restores the ability to control Insteon devices

@bdraco
Copy link
Member

bdraco commented Mar 9, 2021

Are there any errors in the log?

@brucek1642
Copy link
Author

Sorry I should have looked.

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:93
First occurred: 16:50:41 (1 occurrences)
Last logged: 16:50:41

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyinsteon/protocol/protocol.py", line 187, in _write_messages
    await self._transport.async_write(msg)
  File "/usr/local/lib/python3.8/site-packages/pyinsteon/protocol/serial_transport.py", line 72, in async_write
    self.write(data)
  File "/usr/local/lib/python3.8/site-packages/pyinsteon/protocol/serial_transport.py", line 59, in write
    msg_bytes = bytes(data)
  File "/usr/local/lib/python3.8/site-packages/pyinsteon/protocol/messages/__init__.py", line 38, in __bytes__
    return vars_to_bytes(data)
  File "/usr/local/lib/python3.8/site-packages/pyinsteon/utils.py", line 99, in vars_to_bytes
    msg.extend(bytes([val]))
ValueError: bytes must be in range(0, 256)

@bdraco
Copy link
Member

bdraco commented Mar 9, 2021

        on_level = math.ceil(percentage_to_ranged_value(SPEED_RANGE, percentage))
        await self._insteon_device.async_on(group=2, on_level=on_level)
>>> math.ceil(percentage_to_ranged_value(SPEED_RANGE, 100))
256

It looks somehow its sending something > 256 but I can't see how that can happen unless somehow percentage > 100

@bdraco
Copy link
Member

bdraco commented Mar 9, 2021

@teharris1 It would help to get another set of eyes on this if you can.

@bdraco bdraco reopened this Mar 9, 2021
@bdraco
Copy link
Member

bdraco commented Mar 10, 2021

@brucek1642 If you change the top speed range to 0xFE instead of 0xFF does it solve it?

@brucek1642
Copy link
Author

I have tested all the settings for both percentage and speed. All looks good. Thanks to all for getting this resolved.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants