Upgrading
Stewart is one version for everything: the packages in composer.json, the runtime image, and the Home Assistant
integration. Upgrade them together.
How to upgrade
Section titled “How to upgrade”- Read the notes for every version between yours and the new one, below and in the changelog.
- On your machine, run
make updatefor the newest release of your version, ormake upgrade VERSION=x.yto move to another version.make upgradealso changes the image tags inDockerfileand the compose files. - Run
make generate,make stanandmake test, and follow the notes. - Commit
composer.lockand the changed files, and deploy as usual. - If you use the Stewart integration in Home Assistant, update it to the same version.
Within a major version, such as 1.x, a new release does not break your apps. Notes appear here only when a release asks you to do something.
Upgrade notes
Section titled “Upgrade notes”- Run
make upgrade VERSION=1.0. Protocols are unchanged, so a 0.11 daemon,stewartCLI and Home Assistant integration work with 1.0. - Change the image tag in
Dockerfileand the compose files fromruntime:1.0toruntime:1(1-devincompose.dev.yaml), so the image keeps getting PHP and Alpine fixes after 1.1. Copybin/upgrade-stewart.shfrom the skeleton so later upgrades do the same.
Before 1.0
Section titled “Before 1.0”Each 0.x version could break apps; these notes are kept for old projects.
- Run
make upgrade VERSION=0.11, thenmake generate. Upgrade the daemon, thestewartCLI and the Home Assistant integration together; older versions refuse to talk to 0.11. - Replace
->whenChangedTo('on')->from('off')with->whenChangedTo('on', from: 'off'), and->fromAnyState()withfromAnyState: true. - Replace
runAtSunrise()andrunAtSunset()withrunAtSunEvent(SunEvent::Sunrise, …)orSunEvent::Sunset. - Replace an injected
StewartIdentitywith$ha->wasCausedByStewart($change). - Replace removed exception factories with
createForReason(),fromWire()withrestoreFromWire(), and removed collection factories such asfromIds()withfromList(). - Import classes that moved out of
stewart-php/contractsfromStewart\Support\…. - Custom implementations of
Timers,EventStream,HaContextorEntityExposureadd the new methods. - An app option variable ending in
_FILEis now read as a file; set the option instewart.yamlto keep passing the path itself.
- Run
make upgrade VERSION=0.10. Control and IPC protocols are unchanged, but broker, workers andstewartcommands should all run 0.10. - Update the
stewartintegration to 0.10.0 in Home Assistant. - Optionally take over the skeleton’s
.github/workflows/*.ymlandDockerfilechanges.
- Run
make upgrade VERSION=0.9. Broker, workers andstewartcommands must all run 0.9;stewart statusagainst a 0.8 daemon is refused (control protocol 28). - Install the
stewartintegration 0.9.0 in Home Assistant 2026.4 or newer before an app callsexpose*(); without it,expose*()throwsExposureException. Apps that expose nothing need no integration. - Daemons sharing one Home Assistant set a different
expose.instanceeach.
- Run
make upgrade VERSION=0.8. Broker, workers andstewartcommands must all run 0.8;stewart statusagainst a 0.7 daemon is refused (control protocol 24). - A git deployment whose
composer.lockstill holds runtime 0.7 setscode.git.poll: off(or dropsSTEWART_DEPLOY__GIT__POLLfromcompose.git.yaml) until it upgrades; 0.7 stops on the unknown variable. - A compose git volume from 0.7 is converted on the first start: the old checkout is removed and the release layout created, with one full dependency install.
- Code calling
BrokerLifecycle::run()directly gets aBrokerStopOutcomeback instead of nothing.
- Run
make upgrade VERSION=0.7. Broker, workers andstewartcommands must all run 0.7. - Code that constructs
StateChangesorStateTransitionsdirectly now passes aCurrentStateReader. - Custom
ClockandSchedulerimplementations addisWithin()andrunAtEntityTime(). - Tests comparing whole
EntityStateobjects fromRecordingHaContextwithassertEqualsnow see the stampedlastChangedAtandlastUpdatedAt.
- Run
make upgrade VERSION=0.6. Broker, workers andstewartcommands must all run 0.6. - Rename any app whose id is longer than 100 characters.
- On Kubernetes, the chart now probes port 8080 (
probes.port); setprobes.mode: execto keep exec probes.
- Run
make upgrade VERSION=0.5. Broker and workers must both run 0.5 (IPC protocol 21). - Run
make generate.
- Add
->fromAnyState()after anywhenChangedTo()that must also fire when an entity comes back fromunavailableorunknown. - Run
make generate.
- Remove
codegen.renamefromstewart.yamland anySTEWART_CODEGEN__RENAMEfrom.env; both are now refused. - Run
make generate. - Replace
$entities-><domain>-><entity>with$entities-><domain>->getEntity('<entity id>').
To make life easier in long term, I added an upgrade script, that script needs to be added manually, later on upgrades can be made by executing only one make target.
-
Fetch the upgrade script and keep it out of the production image:
Terminal window mkdir -p bincurl -fsSLo bin/upgrade-stewart.sh \https://raw.githubusercontent.com/stewart-php/skeleton/v0.2.0/bin/upgrade-stewart.shecho bin >> .dockerignore -
Add the target to your
Makefile, next toupdate; the recipe lines start with a tab:.PHONY: upgradeupgrade: ## Move to another Stewart release line, then pull its images and install it [VERSION=0.2]$(RUN) sh bin/upgrade-stewart.sh $(VERSION)$(DEV) pull$(RUN) composer update 'stewart-php/*' --with-all-dependencies --no-interaction -
To use MQTT, add
"stewart-php/mqtt": "^0.2"torequireincomposer.json. -
Upgrade. This points every
stewart-php/*requirement and runtime image tag at 0.2, pulls the images and installs:Terminal window make upgrade VERSION=0.2 -
If you added MQTT, set
STEWART_MQTT__URLin.env, such asmqtt://user:password@homeassistant.local:1883, and check themqttsection withmake config. Without the URL nothing changes. -
Check it with
make doctorandmake run. On the server, commit and push, then runmake deploy.