home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.56k stars 30.74k forks source link

'NoneType' object has no attribute 'get_home_mode_status' #98715

Closed Caros2017 closed 1 year ago

Caros2017 commented 1 year ago

The problem

I had Synology DSM working for over a year. I am aware of this part on the plugin, therefor I have disabled SSDP:

If you have two or more NICs with different IP addresses from the same subnet and SSDP is activated, this leads to problems with this integration, as the NAS is detected several times with different IPs and the integration always adopts the new “detected” IP address in its configuration and then reloads it. In this case, it is recommended to use NIC bonding instead or to deactivate SSDP.

Today I have changed some network settings. I wanted to have a seperate VLAN for docker, using macvlan:

ip link add link eth0 name eth0.200 type vlan id 200
ip link set dev eth0.200 up

Docker vlan creation:

docker network create -d macvlan --subnet=192.168.xx.0/23 --gateway=192.168.xx.1 --ipv6 --subnet=2A02:xxx:6D0E:2::/64 --gateway=2A02:xxx:6D0E:2:xxx:AAFF:FE51:E000 -o parent=eth0.200 macvlan200

Since then my integration isn't working anymore. My eth0.200 doesn't have an IPv4 address, since it is not needed. But I think the problem resides there:

eth0      Link encap:Ethernet  HWaddr 90:09:xx:xx:xx:8D
          inet addr:192.168.xx.10  Bcast:192.168.xx.255  Mask:255.255.255.0
          inet6 addr: fe80::xx:d0ff:xx:188d/64 Scope:Link
          inet6 addr: 2a02:xx:6d0e:1:xx:d0ff:fe0b:188d/64 Scope:Global
          inet6 addr: fd79:xx:8928:1:xx:d0ff:fe0b:188d/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17941324 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7079680 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22074240345 (20.5 GiB)  TX bytes:13737073804 (12.7 GiB)
          Interrupt:94 base 0x2000

eth0.200  Link encap:Ethernet  HWaddr 90:09:xx:xx:xx:8D
          inet6 addr: fd88:xx:5269:2:xx:d0ff:fe0b:188d/64 Scope:Global
          inet6 addr: fe80::xx:d0ff:xx:188d/64 Scope:Link
          inet6 addr: 2a02:xx:6d0e:2:xx:d0ff:fe0b:188d/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8015161 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4789645 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15044078763 (14.0 GiB)  TX bytes:13585627050 (12.6 GiB)

It seems like the integration is trying to communicate to eth0.200 but failes. I have also tried to add the integration on the IPv6 address of eth0.200[2a02:xx:6d0e:2:xx:d0ff:fe0b:188d], but this gives me the same error.

The whole network itself is working fine with both IPv4 and IPv6. I don't really understand what is happening, since the integration is connected to a static IPv4 address.

Is my situation not supported, or is there anything possible to fix this?

Note1: If I add a second NIC with the same DHCP settings as eth0 it works when this nic (eth1) is up Note2: HomeAssistant itself is running as container on the synology itself

What version of Home Assistant Core has the issue?

2023.8.3

What was the last working version of Home Assistant Core?

2023.8.3

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Synology DSM

Link to integration documentation on our website

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

Diagnostics information

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/synology_dsm/coordinator.py", line 73, in _async_update_data
    "switches": {"home_mode": await surveillance_station.get_home_mode_status()}
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_home_mode_status'

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @hacf-fr, @quentame, @mib1185, mind taking a look at this issue as it has been labeled with an integration (synology_dsm) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `synology_dsm` 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 synology_dsm` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


synology_dsm documentation synology_dsm source (message by IssueLinks)

mib1185 commented 1 year ago

Hi @Caros2017

Sorry for late reply, but we use GitHub for tracking issues with Home Assistant Core itself, not for providing support. If you are in need of support, you should try our Community Forum or join our Discord chat server.

Thanks! 👍