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

ISY994 raising a lot of HomeAssistantError(f"Unable to turn off switch {self._node.address}") #87644

Closed
olyashok opened this issue Feb 7, 2023 · 13 comments
Assignees
Labels
integration: isy994 problem in dependency problem in device Issue lies within the device, such firmware, software, or user customization/config stale

Comments

@olyashok
Copy link

olyashok commented Feb 7, 2023

The problem

Since last upgrade ISY raises a lot of these errors. It has to do with this commit 3aad153#commitcomment-99657098

What version of Home Assistant Core has the issue?

2023.2

What was the last working version of Home Assistant Core?

2022.11

What type of installation are you running?

Home Assistant OS

Integration causing the issue

isy994

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-02-07 02:00:33.806 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall light.turn_off (c:01GRNAS6JZA0P2AQBKTS4R2YKM): entity_id=all, params=>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1805, in catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1824, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 968, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 721, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 582, in async_handle_light_off_service
    await light.async_turn_off(**filter_turn_off_params(light, params))
  File "/usr/src/homeassistant/homeassistant/components/switch/light.py", line 84, in async_turn_off
    await self.hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1787, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1824, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 968, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 721, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/isy994/switch.py", line 87, in async_turn_off
    raise HomeAssistantError(f"Unable to turn off switch {self._node.address}")

Additional information

3aad153#commitcomment-99657098

@home-assistant
Copy link

home-assistant bot commented Feb 7, 2023

Hey there @bdraco, @shbatm, mind taking a look at this issue as it has been labeled with an integration (isy994) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of isy994 can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign isy994 Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


isy994 documentation
isy994 source
(message by IssueLinks)

@shbatm
Copy link
Contributor

shbatm commented Feb 7, 2023

The change was made to comply with the Integration Quality expectations:

raise HomeAssistantError for other failures such as a problem communicating with a device.

Can you clarify: is it raising the error but the switch is actually being controlled correctly? Or is the switch not responding?

@olyashok
Copy link
Author

olyashok commented Feb 7, 2023 via email

@shbatm
Copy link
Contributor

shbatm commented Feb 7, 2023

There are some upcoming changes that will throttle commands and retry if the ISY is busy but:

Recommended practice is to use an ISY Scene to control more than a couple devices at the same time (e.g. Add all your devices to an All Off scene in the ISY and call switch.turn_off in Home Assistant).

This is for a few reasons: first, it's a single command to the ISY and for Insteon, a single command to the Insteon network which drastically reduces traffic. Second, the original ISY994 is terrible at handling too much Insteon traffic and sends 404 errors when the network is busy (this can't be differentiated from an actual bad command, hence the exceptions). FWIW, this appears to be fixed in the Polisy (and I'm guessing EISY), but still better practice to use a Scene.

@olyashok
Copy link
Author

olyashok commented Feb 7, 2023 via email

@shbatm
Copy link
Contributor

shbatm commented Feb 8, 2023

Recommended practice is nice and all but i have 2 light systems mixed on the property and it's not possible to group devices in a logical way

Do what works for you.

See some suggestions in this discussion.

Two other things not mentioned in that discussion, but sharing from personal experiences: don't be afraid to create situation specific scenes in the ISY (e.g. A dedicated scene for your 'all off at 2am') and just hide them in HA and use them only for your automations. Also, you can use the general homeassistant.turn_on and turn_off services for mixed (legacy) groups with switches and lights.

@shbatm
Copy link
Contributor

shbatm commented Feb 8, 2023

@bdraco you can tag this with problem-in-dependency and I'll close it with the wait-for-not-busy pyisy update listed above.

It's not a true "fix" since it's an inherent hardware issue, but will help reduce some of the errors thrown on a busy network.

@bdraco bdraco added problem in dependency problem in device Issue lies within the device, such firmware, software, or user customization/config labels Feb 8, 2023
@olyashok
Copy link
Author

olyashok commented Feb 8, 2023 via email

@shbatm
Copy link
Contributor

shbatm commented Feb 8, 2023

Here's an example of a service call to turn off all lights that are currently on except those provided by the ISY:

service: light.turn_off
data: {}
target:
  entity_id: |-
    {{ states.light 
       | selectattr('state','eq','on') 
       | map(attribute='entity_id')
       | reject('in', integration_entities("isy994")) 
       | list
    }}

Further troubleshooting should be via the community forum.

@olyashok
Copy link
Author

olyashok commented Feb 9, 2023 via email

@shbatm
Copy link
Contributor

shbatm commented Feb 9, 2023

You could also turn the ISY lights off first, then lights on in Home Assistant will only be what's left.

@olyashok
Copy link
Author

olyashok commented Feb 9, 2023 via email

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
integration: isy994 problem in dependency problem in device Issue lies within the device, such firmware, software, or user customization/config stale
Projects
None yet
Development

No branches or pull requests

4 participants