freeathome icon indicating copy to clipboard operation
freeathome copied to clipboard

Add support for wireless window sensor

Open Tho85 opened this issue 2 years ago • 5 comments

Closes #133

Tho85 avatar Aug 18 '22 19:08 Tho85

Hi, I put the Code in the HA AddIn, but I donn't get the Entity Status, I have only On/Off, which appears when the Sensor communicates with SysApp.

How do I get the Status of the Entity: open, closed, tilted Thanks for you support. When you need some more information, I will try to provide it.

Ingo

schlunzer avatar Feb 02 '23 15:02 schlunzer

Hi @Tho85, I tried the pr in my setup with three window sensors. But unfortunately all my events did stop to be recognized (listening for freeathome_event). No button press fires an event anymore.

The windows sensors seem to be initialized with the correct off/on depending an the status during reboot.

Any idea why that is happening and how to debug this further?

s-b-n avatar Jun 12 '23 14:06 s-b-n

Hi @Tho85

Sorry for asking the direct way. Any chance this will be added soon ?

Thanks

ziegi1982 avatar Dec 17 '23 21:12 ziegi1982

Hi, sorry, I currently do not have the time to look at it. Maybe someone else wants to pick up here?

Tho85 avatar Dec 17 '23 23:12 Tho85

Looks like nobody wants to pick it up. Any idea why events do not get recognized anymore when using these pr ?

ziegi1982 avatar Jan 21 '24 16:01 ziegi1982

I've added the changes manually on all 3 files and it's working (first attempt wasn't because of a mistake I made). @jheling Can we merge this to main? Is there something we can do to give these entities the correct device type (window)? I had to mark them manually.

oliverlinsenmaier avatar Sep 06 '24 08:09 oliverlinsenmaier

@oliverlinsenmaier . I have corrected the merge conflict. Could you test these last changes? After that i will make a new pr for the device type. Can this type be set in Free@Home? In homeassistant it can be typed as a door sensor or window sensor.

jheling avatar Sep 08 '24 18:09 jheling

I've tried your changes, but now no binary sensor is active in HA. grafik

oliverlinsenmaier avatar Sep 10 '24 08:09 oliverlinsenmaier

Are there any errors in the log?

jheling avatar Sep 10 '24 08:09 jheling


> 2024-09-10 10:44:54.864 WARNING (MainThread) [custom_components.freeathome] No switch_as_x option found in saved config, consider adding it
> 2024-09-10 10:44:55.098 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_default_certs with args (<ssl.SSLContext object at 0x7ff946e36c50>, <Purpose.SERVER_AUTH: _ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1')>) inside the event loop by custom integration 'freeathome' at custom_components/freeathome/fah/pfreeathome.py, line 220: slixmpp.ClientXMPP.__init__(self, jid, password, sasl_mech='SCRAM-SHA-1') (offender: /usr/local/lib/python3.12/ssl.py, line 713: context.load_default_certs(purpose)), please report it to the author of the 'freeathome' custom integration
> For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_default_certs
> Traceback (most recent call last):
>   File "<frozen runpy>", line 198, in _run_module_as_main
>   File "<frozen runpy>", line 88, in _run_code
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
>     sys.exit(main())
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
>     exit_code = runner.run(runtime_conf)
>   File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
>     return loop.run_until_complete(setup_and_run_hass(runtime_config))
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
>     self.run_forever()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
>     self._run_once()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
>     handle._run()
>   File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
>     self._context.run(self._callback, *self._args)
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 752, in async_setup_locked
>     await self.async_setup(hass, integration=integration)
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
>     result = await component.async_setup_entry(hass, self)
>   File "/config/custom_components/freeathome/__init__.py", line 82, in async_setup_entry
>     await sysap.connect()
>   File "/config/custom_components/freeathome/fah/pfreeathome.py", line 906, in connect
>     self.xmpp = Client(self._jid, self._password, self._host, self._port, fahversion, iterations, salt, self.reconnect)
>   File "/config/custom_components/freeathome/fah/pfreeathome.py", line 220, in __init__
>     slixmpp.ClientXMPP.__init__(self, jid, password, sasl_mech='SCRAM-SHA-1')
> 
> 2024-09-10 10:44:56.571 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_default_certs with args (<ssl.SSLContext object at 0x7ff9465c2450>, <Purpose.SERVER_AUTH: _ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1')>) in /usr/local/lib/python3.12/ssl.py, line 713: context.load_default_certs(purpose) inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue
> For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_default_certs
> Traceback (most recent call last):
>   File "<frozen runpy>", line 198, in _run_module_as_main
>   File "<frozen runpy>", line 88, in _run_code
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
>     sys.exit(main())
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
>     exit_code = runner.run(runtime_conf)
>   File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
>     return loop.run_until_complete(setup_and_run_hass(runtime_config))
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
>     self.run_forever()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
>     self._run_once()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
>     handle._run()
>   File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
>     self._context.run(self._callback, *self._args)
>   File "/usr/local/lib/python3.12/site-packages/pyeasee/easee.py", line 301, in _sr_connect_loop
>     await self.sr_connection.run()
>   File "/usr/local/lib/python3.12/site-packages/pysignalr/client.py", line 92, in run
>     await self._transport.run()
>   File "/usr/local/lib/python3.12/site-packages/pysignalr/transport/websocket.py", line 77, in run
>     await self._loop()
>   File "/usr/local/lib/python3.12/site-packages/pysignalr/transport/websocket.py", line 102, in _loop
>     async for conn in connection_loop:
>   File "/usr/local/lib/python3.12/site-packages/pysignalr/__init__.py", line 26, in __aiter__
>     async with self as protocol:
>   File "/usr/local/lib/python3.12/site-packages/websockets/legacy/client.py", line 629, in __aenter__
>     return await self
>   File "/usr/local/lib/python3.12/site-packages/websockets/legacy/client.py", line 647, in __await_impl_timeout__
>     return await self.__await_impl__()
>   File "/usr/local/lib/python3.12/site-packages/websockets/legacy/client.py", line 651, in __await_impl__
>     _transport, _protocol = await self._create_connection()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1149, in create_connection
>     transport, protocol = await self._create_connection_transport(
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1173, in _create_connection_transport
>     transport = self._make_ssl_transport(
>   File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 83, in _make_ssl_transport
>     ssl_protocol = sslproto.SSLProtocol(
>   File "/usr/local/lib/python3.12/asyncio/sslproto.py", line 295, in __init__
>     sslcontext = _create_transport_context(
>   File "/usr/local/lib/python3.12/asyncio/sslproto.py", line 55, in _create_transport_context
>     sslcontext = ssl.create_default_context()
>   File "/usr/local/lib/python3.12/ssl.py", line 713, in create_default_context
>     context.load_default_certs(purpose)
> 
> 2024-09-10 10:45:02.612 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'freeathome' calls async_forward_entry_setup for integration, freeathome with title: 192.168.178.165 and entry_id: f96344cb60e084583a1eb6cfbdb12a46, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/freeathome/__init__.py, line 87: hass.async_create_task(, please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:03.141 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7ff9412d4ad0>,) inside the event loop by custom integration 'gardena_smart_system' at custom_components/gardena_smart_system/__init__.py, line 85: await self.smart_system.authenticate() (offender: /usr/local/lib/python3.12/site-packages/httpx/_config.py, line 147: context.load_verify_locations(cafile=cafile)), please create a bug report at https://github.com/py-smart-gardena/hass-gardena-smart-system/issues
> For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations
> Traceback (most recent call last):
>   File "<frozen runpy>", line 198, in _run_module_as_main
>   File "<frozen runpy>", line 88, in _run_code
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
>     sys.exit(main())
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
>     exit_code = runner.run(runtime_conf)
>   File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
>     return loop.run_until_complete(setup_and_run_hass(runtime_config))
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
>     self.run_forever()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
>     self._run_once()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
>     handle._run()
>   File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
>     self._context.run(self._callback, *self._args)
>   File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component
>     result = await _async_setup_component(hass, domain, config)
>   File "/usr/src/homeassistant/homeassistant/setup.py", line 461, in _async_setup_component
>     await asyncio.gather(
>   File "/usr/src/homeassistant/homeassistant/setup.py", line 463, in <genexpr>
>     create_eager_task(
>   File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task
>     return Task(coro, loop=loop, name=name, eager_start=True)
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 752, in async_setup_locked
>     await self.async_setup(hass, integration=integration)
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
>     result = await component.async_setup_entry(hass, self)
>   File "/config/custom_components/gardena_smart_system/__init__.py", line 49, in async_setup_entry
>     await gardena_system.start()
>   File "/config/custom_components/gardena_smart_system/__init__.py", line 85, in start
>     await self.smart_system.authenticate()
> 
> 2024-09-10 10:45:04.117 ERROR (ImportExecutor_0) [homeassistant.loader] Unexpected exception importing platform custom_components.freeathome.binary_sensor
> Traceback (most recent call last):
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform
>     cache[full_name] = self._import_platform(platform_name)
>                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, in _import_platform
>     return importlib.import_module(f"{self.pkg_path}.{platform_name}")
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
>     return func(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 991, in exec_module
>   File "<frozen importlib._bootstrap_external>", line 1129, in get_code
>   File "<frozen importlib._bootstrap_external>", line 1059, in source_to_code
>   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
>   File "/config/custom_components/freeathome/binary_sensor.py", line 72
>     def extra_state_attributes(self):
> IndentationError: unexpected unindent
> 2024-09-10 10:45:04.149 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module with args ('custom_components.freeathome.binary_sensor',) in /usr/src/homeassistant/homeassistant/loader.py, line 1296: return importlib.import_module(f"{self.pkg_path}.{platform_name}") inside the event loop; This is causing stability issues. Please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue
> For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module
> Traceback (most recent call last):
>   File "<frozen runpy>", line 198, in _run_module_as_main
>   File "<frozen runpy>", line 88, in _run_code
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
>     sys.exit(main())
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
>     exit_code = runner.run(runtime_conf)
>   File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
>     return loop.run_until_complete(setup_and_run_hass(runtime_config))
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
>     self.run_forever()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
>     self._run_once()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
>     handle._run()
>   File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
>     self._context.run(self._callback, *self._args)
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2180, in async_forward_entry_setup
>     result = await self._async_forward_entry_setup(entry, domain, True)
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2211, in _async_forward_entry_setup
>     await integration.async_get_platform(domain)
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1100, in async_get_platform
>     platforms = await self.async_get_platforms((platform_name,))
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1165, in async_get_platforms
>     platforms.update(self._load_platforms(platform_names))
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1090, in _load_platforms
>     platform_name: self._load_platform(platform_name)
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform
>     cache[full_name] = self._import_platform(platform_name)
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, in _import_platform
>     return importlib.import_module(f"{self.pkg_path}.{platform_name}")
> 
> 2024-09-10 10:45:04.153 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform custom_components.freeathome.binary_sensor
> Traceback (most recent call last):
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform
>     cache[full_name] = self._import_platform(platform_name)
>                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, in _import_platform
>     return importlib.import_module(f"{self.pkg_path}.{platform_name}")
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
>     return func(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 991, in exec_module
>   File "<frozen importlib._bootstrap_external>", line 1129, in get_code
>   File "<frozen importlib._bootstrap_external>", line 1059, in source_to_code
>   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
>   File "/config/custom_components/freeathome/binary_sensor.py", line 72
>     def extra_state_attributes(self):
> IndentationError: unexpected unindent
> 2024-09-10 10:45:04.157 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
> Traceback (most recent call last):
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform
>     cache[full_name] = self._import_platform(platform_name)
>                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, in _import_platform
>     return importlib.import_module(f"{self.pkg_path}.{platform_name}")
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
>     return func(*args, **kwargs)
>            ^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 991, in exec_module
>   File "<frozen importlib._bootstrap_external>", line 1129, in get_code
>   File "<frozen importlib._bootstrap_external>", line 1059, in source_to_code
>   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
>   File "/config/custom_components/freeathome/binary_sensor.py", line 72
>     def extra_state_attributes(self):
> IndentationError: unexpected unindent
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2180, in async_forward_entry_setup
>     result = await self._async_forward_entry_setup(entry, domain, True)
>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2211, in _async_forward_entry_setup
>     await integration.async_get_platform(domain)
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1100, in async_get_platform
>     platforms = await self.async_get_platforms((platform_name,))
>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1177, in async_get_platforms
>     import_future.result()
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1165, in async_get_platforms
>     platforms.update(self._load_platforms(platform_names))
>                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1090, in _load_platforms
>     platform_name: self._load_platform(platform_name)
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/src/homeassistant/homeassistant/loader.py", line 1284, in _load_platform
>     raise ImportError(
> ImportError: Exception importing custom_components.freeathome.binary_sensor
> 2024-09-10 10:45:04.161 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.162 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.163 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.163 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.164 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.164 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.164 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.165 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.165 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.166 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.170 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.171 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.171 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.172 WARNING (MainThread) [homeassistant.components.climate] Entity None (<class 'custom_components.freeathome.climate.FreeAtHomeThermostat'>) implements HVACMode(s): heat_cool, off and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'freeathome' custom integration
> 2024-09-10 10:45:04.191 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration freeathome with title: 192.168.178.165 and entry_id: f96344cb60e084583a1eb6cfbdb12a46, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
> Stack (most recent call last):
>   File "<frozen runpy>", line 198, in _run_module_as_main
>   File "<frozen runpy>", line 88, in _run_code
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
>     sys.exit(main())
>   File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
>     exit_code = runner.run(runtime_conf)
>   File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
>     return loop.run_until_complete(setup_and_run_hass(runtime_config))
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
>     self.run_forever()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
>     self._run_once()
>   File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
>     handle._run()
>   File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
>     self._context.run(self._callback, *self._args)
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2184, in async_forward_entry_setup
>     _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
>   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1201, in _report_non_awaited_platform_forwards
>     report(
>   File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
>     _LOGGER.warning(msg, stack_info=True)

oliverlinsenmaier avatar Sep 10 '24 09:09 oliverlinsenmaier

The error is in the binary_sensor.py at line 72. Something seems to be wrong with the indentation. Did you replace the whole file or pasted the new lines in the original file?

jheling avatar Sep 10 '24 09:09 jheling

Now I found a way to download the raw files and now the sensors are shown as working. But there are no updates incoming.

2024-09-11 10:18:49.340 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.abb2dd662b51_ch0007 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
    await self.async_update()
  File "/config/custom_components/freeathome/binary_sensor.py", line 97, in async_update
    self._attributes = self.binary_device.attributes
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FahBinarySensor' object has no attribute 'attributes'
2024-09-11 10:18:58.801 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.garagentor fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
    await self.async_update()
  File "/config/custom_components/freeathome/binary_sensor.py", line 97, in async_update
    self._attributes = self.binary_device.attributes
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FahBinarySensor' object has no attribute 'attributes'
2024-09-11 10:18:59.860 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.windsensor fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update
    await self.async_update()
  File "/config/custom_components/freeathome/binary_sensor.py", line 97, in async_update
    self._attributes = self.binary_device.attributes
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FahBinarySensor' object has no attribute 'attributes'

oliverlinsenmaier avatar Sep 11 '24 08:09 oliverlinsenmaier

Could you comment out line 97 in binary_sensor.py by placing a # before the code? In a second commit there was some refactoring and this line is now obsolete

jheling avatar Sep 11 '24 09:09 jheling

Works now! Awesome! :)

oliverlinsenmaier avatar Sep 11 '24 11:09 oliverlinsenmaier

Nice. I'm curious, do you now also see the attribute 'window-position'?

jheling avatar Sep 11 '24 15:09 jheling

Nice. I'm curious, do you now also see the attribute 'window-position'?

No, only open and closed. But this the most important thing.

oliverlinsenmaier avatar Sep 11 '24 16:09 oliverlinsenmaier

If you go to the Developer tools, State and then go to one of your window sensors. There you should see the window-position attribute.

jheling avatar Sep 11 '24 17:09 jheling

IMG_2370 image

No attribute

oliverlinsenmaier avatar Sep 12 '24 20:09 oliverlinsenmaier