Hi Everyone!
Well it’s been a while, but AppDaemon has been chugging along nicely. working great but has been a little quiet on the dev front, with the result that I looked up and it’s been a couple of years since the last release! That clearly won’t do, and the plan is to release less and more often moving forwards. In particular, we were getting to a point where older packages were refusing to work or install, and we weren’t up to date with the latest pythons.
In addition, we have some fresh blood in AppDaemon in the shape of @jsl12. John has revitalized the development process and has driven a lot of new work on some of the core parts of AppDaemon that are now nearly 10 years old. As a result, we have done some modernization on the code base resulting in some much better management for module imports, support for returning of data from Home Assistant service calls, and user input validation with Pydantic.
Some things to be aware of:
While we have made avery effort to test the code, the wide variety of installs and usages of AppDaemon may throw up some unanticipated issues. For this reason, we recommend that upgrades to 4.5 are done with caution, and ideally with a backout plan. We will be releasing fixes for any issues with a rapid cadence until we are confident that things are stable again, however, those for whom stability is important might want to wait for one or two point releases before upgrading to 4.5.x.
Areas that have been affected include:
- Loading and dependencies of apps: we believe that the new system is practically identical to the old, but it is entirely new code
- The reason for the above is that we now handle dependencies in global python modules without the need to mark them as such, and correctly reload all apps. This functionality never worked correctly in previous versions of AppDaemon, but should now be a seamless experience
- Because of the above, although we don’t enforce specific app hierarchies, some work better than others, especially if you are using global modules. The new guidelines are published in the Appdir Structure of the docs.
- Most user input is now validated using Pydantic. This means that any input files such as
appdaemon.yaml
andapps.yaml
will now produce warnings if additional or incorrectly named fields are present. In some cases this may result in AppDaemon’s refusal to start. We will log reasons for such events to the standard log files to enable you to troubleshoot - Please note that in cases where errors occur before the
AppDaemon.yaml
file has been processed, these errors will be logged to standard out, since we cannot rely on configuration info to tell us where the logs should go. For this reason, if AppDaemon does not start after the upgrade, and you get no logging CHECK STANDARD OUT FOR ANY ERRORS:- For a standard venv install this could be on the terminal
- For docker, you will need to look at docker logs
- For the HomeAssistant addon, you should check the addon logs.
- The Home Assistant plugin has been rewritten to enable return information from HomeAssistamt service calls. This required some large changes under the hood but should be seamless. As a result of this it is now possible to configure AppDaemon to obtain return information from all service calls whether they return data or not. Although this is not the defualt behavior, if enabled this may reveal issues with slow to complete service calls to for instance ZWave items that were not apparent before.
If you find any issues, please log them at AppDaemon’s Github:
Or drop into our Discord Server:
Either way, we will do our best to assist you!
–
4.5.0
Features
- Project updates
- Remove support for Python 3.8 and 3.9
- Added support for Python 3.12
- Update docker image to Alpine 3.21/Python 3.12
- App Management rewrite - contributed by John Lancaster
- AppDaemon automatically detects dependencies between app files by parsing them with the
ast
module. - Makes all the global module stuff obsolete.
- AppDaemon automatically detects dependencies between app files by parsing them with the
- HASS Plugin rewrite - contributed by John Lancaster
- Upgraded HASS plugin to use the aiohttp websocket client
- Upgraded HASS plugin to use the Websocket API where possible
- Implemented value return for HASS Service Calls
- Added additional functions based on rendering templates for Areas, Devices, and Labels
- Configuration validation - Added pydantic validation to most user input
- Added Pirateweather widget - contributed by Dave Dixon
- Added ability to know the topic associated with an MQTT message decode error
- Added
import_path
directive to enable python imports from arbitary paths - Added access to the request object for both async and non-async http callbacks - contributed by Eric Severance
- Added option for N deg rising|setting to Scheduler._parse_time
- Added
silent
parameter tocancel_listen_state()
- contributed by Daniel Rocha - added the
--write_toml
as an AppDaemon startup parameter to force AD to use theTOML
format when creating new apps using the - Upgraded Material Design icons to 7.4.47 - - contributed by Daniel Rocha
- Rewrote app dependency tracking and added automatic tracking of global modules, deprecated associated global directoves in apps.yaml
Fixes
- baseicon set_service_call fix - contributed by lancasterJ
- HTTP module now correctly honors the provided host name instead of binding to 0.0.0.0, and should also now work for IPv6 - contributed by bitstacker
- Fix for baseweather direction icon - contributed by carawan
- Fix for bug in pathname checking for hidden files and pycache - contributed by David Warde-Farley- contributed by Roman Andriadi
- ADAPI Sleep now accepts a float as documented
Breaking Changes
- AppDaemon no longer supports versions of Python prior to 3.10. This is in line with other packages, and allows us to keep the code base up to date and current with the latest developments
Changes in Behavior
- The fix to honor the host name in the HTTP URL may cause AppDaemon to fail to start, if the hostname provided is not valid. In particular, docker users will need to switch their URL to either use localhost, explicitly, or “0.0.0.0” which will bind to any available interface, or use command line tools to discover the correct IP address and use that.
- The timer for internal function timeouts has been increased from 10 seconds to 60 to allow for the fact that service calls to hass can now be synchronous and may take longer
- AppDaemon will now discard any events that it attempts to process for an App that is initializing. This is intended to prevent race conditions during App Initialization
- The
--toml
flag has been deprecated. AppDaemon will now work transparently with either yaml or toml files, allowing the user to mix and match and convert from one format to another over time. In the event of a conflict, the yaml file will take precedence.