Repository navigation
Description
Describe the bug.
After switching off a named schedule outside Home Assistant (Plugwise app), the Smile reports <active>false</active> but keeps the location in the rule's contexts.
Selecting that schedule with select.select_option returns success, but the select stays off and the schedule remains inactive. climate.set_hvac_mode with auto goes through the same path.
Steps to reproduce:
- Switch off an active schedule outside HA.
- Confirm in
/core/domain_objectsthat the rule hasactive=falsewhile its contexts still include the thermostat's location. - Select that schedule in HA.
- The service call succeeds, but the rule stays
active=falseand HA still showsoff.
Expected behavior
Selecting a schedule activates its rule, and HA shows the selected schedule / auto after polling.
What version of Home Assistant Core has the issue?
core-2026.10.2
What type of installation are you running?
Home Assistant OS
How and which version of the integration do you have installed?
Home Assistant Core (python-plugwise 1.14.7)
What kind of Plugwise device is having issues?
Smile: Anna
What firmware version is your Plugwise product at?
Smile Anna gateway 4.4.4 (AME Smile 2.0 board); Anna ThermoTouch
Home Assistant Logging (optional)
No error is logged; the service call returns success.
Diagnostics information
Verified on the real device on 2026-10-23. Condensed, redacted /core/domain_objects fixture:
<domain_objects>
<location id="LIVINGROOM_LOC_ID"><name>Living room</name></location>
<rule id="RULE_ID">
<name>Daily routiner</name>
<active>false</active>
<template id="TEMPLATE_ID" tag="zone_preset_based_on_time_and_presence_with_override"/>
<directives><when time="[mo 07:00,mo 08:00)"><then preset="home"/></when></directives>
<contexts><context><zone><location id="LIVINGROOM_LOC_ID"/></zone></context></contexts>
</rule>
</domain_objects>In plugwise/smile.py, SmileAPI.set_schedule_state() (approximately lines 360–414 in 1.14.7) proceeds because _schedules() reports OFF from active=false, leaving _schedule_old_states[loc][name] == "off".
determine_contexts() (approximately lines 416–430) finds the existing location element and appends that same element, leaving the contexts unchanged. The PUT to /core/rules;id=RULE_ID contains <name>, <template id="TEMPLATE_ID" .../> and the unchanged <contexts>, but no <active> element. The Smile returns HTTP 200 and leaves the rule inactive. This code was also unchanged on main when checked on 2026-10-23.
An offline reproduction against the real 1.14.7 wheel captures the request from set_schedule_state("LIVINGROOM_LOC_ID", "Daily routine", "on") with the fixture above and _schedule_old_states = {"LIVINGROOM_LOC_ID": {"Daily routine": "off"}}. The unpatched request satisfies:
assert "<active>" not in sent[0] # reproduces the missing activationAdditional information
On the real device, sending the same PUT body with <active>true</active> inserted between <template .../> and <contexts> returned HTTP 200 and changed the rule to active=true, with the location linked. HA showed the selected schedule / auto on the next poll.
A local HA custom integration now wraps SmileAPI.determine_contexts() and prefixes <active>true</active> when state == "on"; the off path is unchanged. End-to-end verification: force the rule back to active=false while keeping the location, call HA select.select_option, then observe active=true and the schedule selected. The offline test also passes with this workaround and checks that the off path remains unchanged.
Suggested fix: include <active>true</active> in the rule body when switching a schedule on. Consider including <active>false</active> when switching off so both states are explicit; that off change has not been tested here.
As supporting context, another named rule has active=true with no location in its contexts. The firmware therefore does not keep active and contexts in sync on its own. This is an observation relevant to the activation logic, not a separate bug claim.
Activity
bouwew commentedon Oct 24, 2026
@voidzero Thanks for reporting!
I have a look at this during the weekend.
voidzero commentedon Oct 24, 2026
Thank you, @bouwew. This part of the module was not functioning for me for a long time, and finally this got it fixed. I turn off the schedule often, for example when I am only in my living room burning wood, and the rest of the house does not need to be heated. But at the end of the day i want to automatically resume the schedule if it's off, so my family won't be cold in the morning. 🙂 Thanks for taking a look.
bouwew commentedon Oct 24, 2026
I've had a quick look at my Adam, when I create a new schedule and not assign it to a Zone yet, the
activekey showstrueWhen I link it to a Zone or unlink it to a Zone, the
activekey does not change.I now realize that I miss this information for an Anna or Emma. What Plugwise device do you have?
voidzero commentedon Oct 24, 2026
I only have the Anna.
bouwew commentedon Oct 24, 2026
I had a look at some Anna userdata, it looks like the Anna (software) does the same: remove the
location idkey from therule idthat represents the schedule, when the schedule is made inactive.Can you please look at your Smile xml-data to confirm if you see this as well?
activealwaystruewhen no active schedule, and
when the schedule is active.
voidzero commentedon Oct 24, 2026
Confirmed on my Anna (Smile 4.4.4, AME Smile 2.0 board), read from
/core/domain_objectsa few minutes ago:So yes: I see your inactive state too. That is exactly what I get when I switch the schedule off from the Plugwise app - the Anna empties the contexts. Yesterday I got a different result from the same action though: the rule came out with
active=falseand the location still linked.In that state HA's
selectandhvac_mode: autodo nothing: the PUT carries the same contexts and no<active>, the Smile returns 200 and the rule stays as it is. The same PUT with<active>true</active>added between<template/>and<contexts>activates it.So
activeis not always true here either ("Thermostat schedule" has been sitting atactive=falsesince 2025), and contexts are not always emptied. The two deactivations gave me two different states, and I cannot say what caused the difference - both were done from the app as far as I know.If it helps: I can deactivate it deliberately both ways (Plugwise app and long press on the Anna) and send you the rule XML after each. That should show whether the firmware behaves differently per path.
bouwew commentedon Oct 24, 2026
I've captured the data between my computer and the Adam with Wireshark, I could see that in the PUT the
activekey was never included.I will have a look at the code, update it based on what we know now.
bouwew commentedon Oct 24, 2026
@voidzero please see the linked PR #933, this should fix the issue.
Can you test this update in some way?
Merge pull request #934 from plugwise/schedule_active
bouwew commentedon Oct 24, 2026
Fixed in release v1.14.8
voidzero commentedon Oct 24, 2026
Works for me, @bouwew, much thanks for getting this fixed. Have a good weekend. 🙂