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

matter/fan.py: TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' #119735

Closed
lboue opened this issue Jun 15, 2024 · 5 comments

Comments

@lboue
Copy link
Contributor

lboue commented Jun 15, 2024

The problem

There seems to be a type issue in the Matter integration for the Fan device type.

  File "/usr/src/homeassistant/homeassistant/components/matter/fan.py", line 236, in _calculate_features
    self._attr_speed_count = int(
                             ^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

https://github.com/home-assistant/core/blob/dev/homeassistant/components/matter/fan.py#L236

Device

image

Full log

Logger: homeassistant.components.matter
Source: components/matter/__init__.py:151
integration: Matter (BETA) (documentation, issues)
First occurred: 1:35:01 PM (2 occurrences)
Last logged: 1:35:03 PM

Unexpected exception: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/matter/__init__.py", line 151, in _client_listen
    await matter_client.start_listening(init_ready)
  File "/usr/local/lib/python3.12/site-packages/matter_server/client/client.py", line 611, in start_listening
    self._handle_incoming_message(msg)
  File "/usr/local/lib/python3.12/site-packages/matter_server/client/client.py", line 649, in _handle_incoming_message
    self._handle_event_message(msg)
  File "/usr/local/lib/python3.12/site-packages/matter_server/client/client.py", line 674, in _handle_event_message
    self._signal_event(event, data=node, node_id=node.node_id)
  File "/usr/local/lib/python3.12/site-packages/matter_server/client/client.py", line 753, in _signal_event
    callback(event, data)
  File "/usr/src/homeassistant/homeassistant/components/matter/adapter.py", line 68, in node_added_callback
    self._setup_node(node)
  File "/usr/src/homeassistant/homeassistant/components/matter/adapter.py", line 148, in _setup_node
    self._setup_endpoint(endpoint)
  File "/usr/src/homeassistant/homeassistant/components/matter/adapter.py", line 225, in _setup_endpoint
    new_entity = entity_info.entity_class(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/matter/entity.py", line 75, in __init__
    self._update_from_device()
  File "/usr/src/homeassistant/homeassistant/components/matter/fan.py", line 172, in _update_from_device
    self._calculate_features()
  File "/usr/src/homeassistant/homeassistant/components/matter/fan.py", line 236, in _calculate_features
    self._attr_speed_count = int(
                             ^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

What version of Home Assistant Core has the issue?

2024.6.2

What was the last working version of Home Assistant Core?

N/A

What type of installation are you running?

Home Assistant OS

Integration causing the issue

python-matter-server

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Matter Fan control works fine with Apple Home app.

Additional information

Fan set to 75%

image

@home-assistant
Copy link

Hey there @home-assistant/matter, mind taking a look at this issue as it has been labeled with an integration (matter) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of matter can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign matter Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


matter documentation
matter source
(message by IssueLinks)

@marcelveldt
Copy link
Member

Can you please post the diagnostics dump here of that sample device ?

@lboue
Copy link
Contributor Author

lboue commented Jun 21, 2024

Can you please post the diagnostics dump here of that sample device ?

Hello. I can't because it fails before.

@marcelveldt
Copy link
Member

This is actually a device issue - the device lacks the "SpeedMax" attribute, while this is mandatory:

Scherm­afbeelding 2024-07-04 om 14 26 18

@lboue
Copy link
Contributor Author

lboue commented Jul 4, 2024

Thanks @marcelveldt. I will try to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants