hassio-addons / addon-appdaemon

AppDaemon4 - Home Assistant Community Add-ons
https://addons.community
MIT License
149 stars 46 forks source link

AppDaemon 4.4 has issue rendering templates #250

Closed mikosoft83 closed 1 year ago

mikosoft83 commented 1 year ago

Problem/Motivation

Apps fail when there are templates present

Expected behavior

Templates should render

Actual behavior

They don't render

Steps to reproduce

Use any app that uses templates, it produces "None" as output and there's an error in the log:

2023-04-12 12:23:04.502306 ERROR HASS: ------------------------------------------------------------
2023-04-12 12:23:04.504398 ERROR HASS: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py", line 556, in call_plugin_service
    r = await self.session.post(api_url, json=data)
  File "/usr/lib/python3.10/site-packages/aiohttp/client.py", line 508, in _request
    req = self._request_class(
  File "/usr/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 305, in __init__
    self.update_host(url)
  File "/usr/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 364, in update_host
    raise InvalidURL(url)
aiohttp.client_exceptions.InvalidURL: /api/template
2023-04-12 12:23:04.506098 ERROR HASS: ------------------------------------------------------------

Proposed changes

Rollback to 4.3 until 1747 gets resolved.

frenck commented 1 year ago

This is an AppDaemon issue, not an add-on issue. Please keep track of

https://github.com/AppDaemon/appdaemon/issues/1747

../Frenck

joBr99 commented 1 year ago

You can configure the following command in the appdaemon addon settings, until there is a fixed version of appdaemon released.

sed -i 's:"/api/template":f"{self.ha_url}/api/template":g' /usr/lib/python3.10/site-packages/appdaemon/plugins/hass/hassplugin.py

image

mikosoft83 commented 1 year ago

Always can count on you @joBr99 !

frenck commented 1 year ago

That is modifying signed sources and thus not recommend or supported. It may cause issues and even may cause HA to consider your whole system as unsuported dur to source modifications.

If this upstream bug causes an issue for your use case, please downgrade to the previous version using the backup that is created on upgrading the addon.

../Frenck