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

Getting "unavailable" #270

Open
4 tasks done
WardinT opened this issue Jan 23, 2025 · 3 comments
Open
4 tasks done

Getting "unavailable" #270

WardinT opened this issue Jan 23, 2025 · 3 comments
Labels
bug Something isn't working waiting for feedback Issue is waiting for feedback from reporter

Comments

@WardinT
Copy link

WardinT commented Jan 23, 2025

System Health details

System Information

version core-2025.1.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.13.1
os_name Linux
os_version 6.6.66-haos
arch x86_64
timezone Europe/Berlin
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 5000
Installed Version 2.0.3
Stage running
Available Repositories 1563
Downloaded Repositories 15
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 14.1
update_channel stable
supervisor_version supervisor-2024.12.3
agent_version 1.6.0
docker_version 27.2.0
disk_total 17.6 GB
disk_used 12.8 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Advanced SSH & Web Terminal (20.0.0), File editor (5.8.0)
Dashboards
dashboards 4
resources 7
views 4
mode storage
Recorder
oldest_recorder_run 12. Januar 2025 um 10:06
current_recorder_run 23. Januar 2025 um 15:16
estimated_db_size 1512.08 MiB
database_engine sqlite
database_version 3.47.1
Solcast PV Forecast
can_reach_server ok

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

I want to trigger a action when the device is switched off. But in the log, I see that it is getting unavailable before the switch-off event. Seems like the order is reversed.

Reproduction steps

This is the automation I want to use

alias: Stehlampe automatisch aus
description: ""
triggers:

  • type: changed_states
    device_id: b9ef440c662edb7bced405f2fb95b428
    entity_id: ec3ec3f995d5291612e900a4ab3fe52f
    domain: media_player
    metadata:
    secondary: false
    trigger: device
    conditions:
  • condition: state
    entity_id: media_player.wohnzimmer_401
    state: "off"
  • condition: device
    type: is_on
    device_id: 7ba02e1330aafe5608c1835ffb5b7b64
    entity_id: e981328e7615ce66a6831b18ab19f9eb
    domain: switch
    actions:
  • type: turn_off
    device_id: 7ba02e1330aafe5608c1835ffb5b7b64
    entity_id: e981328e7615ce66a6831b18ab19f9eb
    domain: switch
    mode: single

Debug logs

as descrubed

Diagnostics dump

No response

@Xyaren
Copy link
Owner

Xyaren commented Jan 23, 2025

Hi, thanks for the report.
I unfortunately can not reporduce it.

Image

What shutdown/standby mode is receiver set to ?

Do you switch it off via HA or via the remote ?

Please attach debug logs of the integration.

@Xyaren Xyaren added the bug Something isn't working label Jan 23, 2025
@WardinT
Copy link
Author

WardinT commented Jan 24, 2025

I switch it to standby via remote control. Logfile renamed.

error_log.txt

@Xyaren
Copy link
Owner

Xyaren commented Jan 24, 2025

Thank you for the log file!

I can see some errors regarding parsing the events the MR sends to the integration:

2025-01-24 00:38:19.717 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/xml/etree/ElementTree.py", line 1713, in feed
    self.parser.Parse(data, False)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 4, column 951

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/magentatv/api/notify_server.py", line 286, in _handle_request
    status = await self._handle_notify(headers, body)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/magentatv/api/notify_server.py", line 304, in _handle_notify
    el_root = Et.fromstring(stripped_body)
  File "/usr/local/lib/python3.13/site-packages/defusedxml/common.py", line 126, in fromstring
    parser.feed(text)
    ~~~~~~~~~~~^^^^^^
  File "/usr/local/lib/python3.13/xml/etree/ElementTree.py", line 1715, in feed
    self._raiseerror(v)
    ~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/xml/etree/ElementTree.py", line 1622, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 4, column 951

I'll need to improve the logging and come back to you.

--

Please try updating using the main branch, restart HA and try again.
This does not solve the issue but improves logging so I can hopefully see what's going on.

Please provide another log.

@Xyaren Xyaren added the waiting for feedback Issue is waiting for feedback from reporter label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for feedback Issue is waiting for feedback from reporter
Projects
None yet
Development

No branches or pull requests

2 participants