render_template broken with AppDaemon 4.4
What happened?
render_template is no longer working in the latest version.
Version
4.4.2
Installation type
Docker container
Relevant log output
ERROR HASS: Unexpected error during call_plugin_service()
ERROR HASS: Service: default.template.render Arguments: {'template': "{{ states('sun.sun') }}"}
ERROR HASS: ------------------------------------------------------------
ERROR HASS: Traceback (most recent call last):
File "/usr/local/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/local/lib/python3.10/site-packages/aiohttp/client.py", line 508, in _request
req = self._request_class(
File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 305, in __init__
self.update_host(url)
File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 364, in update_host
raise InvalidURL(url)
aiohttp.client_exceptions.InvalidURL: /api/template
Relevant code in the app or config file that caused the issue
class TestApp(AppBase):
def initialize(self):
template = "{{ states('sun.sun') }}"
x = self.render_template(template)
self.log(x)
Anything else?
No response
just wanted to open the exact same issue :) with the 0.12.0 version of the HA Addon this now also hit HA OS Users
Thanks for reporting, I’ll take a look.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Johannes @.> Sent: Tuesday, April 11, 2023 12:36:38 PM To: AppDaemon/appdaemon @.> Cc: Subscribed @.***> Subject: Re: [AppDaemon/appdaemon] render_template broken with AppDaemon 4.4 (Issue #1747)
just wanted to open the exact same issue :) with the 0.12.0 version of the HA Addon this now also hit HA OS Users
— Reply to this email directly, view it on GitHubhttps://github.com/AppDaemon/appdaemon/issues/1747#issuecomment-1503742252, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACLE7JFLRGMKFJF7JJPNQI3XAWCBNANCNFSM6AAAAAAW2GW5CQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>
I created a PR that hopefully resolves this issue.
I created a PR that hopefully resolves this issue.
when will this come out or can it already be installed on home assistant?
It is currently available in dev but I don't know when a release will be pushed out.
It is currently available in dev but I don't know when a release will be pushed out.
can't go into dev mode ? or is that not possible?
Just revert to the previous version ...
Just revert to the previous version ...
If only it were that easy it's not like choosing the previous version reinstalling just like on hacs this one has to be backed up that won't work for me I've been messing around today unfortunately otherwise I've done it a long time ago
Thanks @joBr99, restoring previous AppDaemon backup has worked and nspanel-lovelace output now displays as expected.
Thanks @joBr99, restoring previous AppDaemon backup has worked and nspanel-lovelace output now displays as expected.
yes I wanted to do that too but my backup says very long backup does not exist very unfortunate so I can't go back so wait for a new update
@jrspowers You might be able to workaround by editing your local version of hassplugin.py and restarting the daemon with the following fix merged to dev:

@jrspowers You might be able to workaround by editing your local version of hassplugin.py and restarting the daemon with the following fix merged to dev:
hello so if i understand correctly i need to put what in green & remove red & then restart appdaemon & then what about dev mode ? thanks
hello so if i understand correctly i need to put what in green & remove red & then restart appdaemon & then what about dev mode ? thanks
Hi, I'm in the same situation so here is my hotfix:
- login to your home assistant vm
ssh -p22222 root@<IP> - After login grep the id of the appdaemon docker instance
docker ps | grep appdaemon | awk '{ print $1}' - Use the id to start a shell into this appdaemon docker instance
docker exec -ti <docker-id> bash - Inside the docker instance find the relevant file
find / -iname "hassplugin.py" - Edit the file with vi as shown here #1750 commit
- After saving the find the appdaemon process id and kill it
kill $(ps aux | grep /usr/bin/appdaemon | grep -v grep | awk '{ print $1 }') - Now the fixed version of appdaemon should be active and you can leave the docker instance via Ctrl-D
Yes, don't worry about "dev" comment as just referring to this fix being pushed into the AppDaemon dev branch. This manual local adjustment will get overwritten when next version of AppDaemon is released.
Please see @xiconfjs much more detailed explanation above
Hi, I'm in the same situation so here is my hotfix:
login to your home assistant vm ssh -p22222 root@
After login grep the id of the appdaemon docker instance docker ps | grep appdaemon | awk '{ print $1}' Use the id to start a shell into this appdaemon docker instance docker exec -ti bash Inside the docker instance find the relevant file find / -iname "hassplugin.py" Edit the file with vi as shown here #1750 commit After saving the find the appdaemon process id and kill it kill $(ps aux | grep /usr/bin/appdaemon | grep -v grep | awk '{ print $1 }') Now the fixed version of appdaemon should be active and you can leave the docker instance via Ctrl-D
everything first thanks for this nice explanation but I have a few questions
1 I don't have it running in docker but in ha itself
2 who log in to ssh via login & password that I always use to mean ssh or the ones you put here?
3 where can I find that ID? thanks in advance!
everything first thanks for this nice explanation but I have a few questions 1 I don't have it running in docker but in ha itself
perhaps I'm mistaken, but usually all addons are running in separated docker containers with running inside the ha vm
2 who log in to ssh via login & password that I always use to mean ssh or the ones you put here?
for accessing the home assistant vm via ssh (and not the ssh addon container) follow this guide
3 where can I find that ID? thanks in advance!
the "docker-id" can be found with the command I posted before and here again:
docker ps | grep appdaemon | awk '{ print $1}'
If you have further questions, it would be better to discuss this outside of this issue.
everything first thanks for this nice explanation but I have a few questions
1 I don't have it running in docker but in ha itself
perhaps I'm mistaken, but usually all addons are running in separated docker containers with running inside the ha vm
2 who log in to ssh via login & password that I always use to mean ssh or the ones you put here?
for accessing the home assistant vm via ssh (and not the ssh addon container) follow this guide
3 where can I find that ID? thanks in advance!
the "docker-id" can be found with the command I posted before and here again:
docker ps | grep appdaemon | awk '{ print $1}'If you have further questions, it would be better to discuss this outside of this issue.
okay i understand the benefit how can i contact you i think discord ? my name jarne#4016
1 I don't have it running in docker but in ha itself
I think you are in the same boat as I am. My understanding is that if you are using HAOS, you can't access the individual addon docker containers.
I think you are in the same boat as I am. My understanding is that if you are using HAOS, you can't access the individual addon docker containers.
this could help: https://community.home-assistant.io/t/add-on-hassos-ssh-port-22222-configurator/264109
this could help:
That did indeed help (after a bit of Googling on how to use vi and a large amount of PEBCAK). However, after setting up that addon, I wonder if it is needed as I still had to turn off Protection Mode on the HA SSH plugin. Perhaps turning off Protection Mode on its own would be sufficient.
Anyway, many thanks for offering a solution.