Add device-control commands to the CLI (setpoint, mode, hold, resume schedule)#7
Open
jgordner wants to merge 1 commit into
Open
Add device-control commands to the CLI (setpoint, mode, hold, resume schedule)#7jgordner wants to merge 1 commit into
jgordner wants to merge 1 commit into
Conversation
The README noted that setpoint/schedule control "should be pretty easy to
add"; this wires the documented msg:44 command into the `mysotherm` CLI:
--set-point TEMP [-F/--fahrenheit] set target temperature
--mode {off,on,floor,ambient} set operating mode (handles the INF
floor tracked-sensor variants)
--resume-schedule clear a manual hold, follow the schedule
--hold hold indefinitely (until changed)
--hold-until UNIXTIME hold until a time, then resume schedule
--command-timeout SECS ack wait (default: 30)
Each control option publishes a msg:44 command to the device's /in topic,
waits for the device's msg:44 acknowledgement (matched by resp_id), and exits
0 only if every --device acknowledged -- so it is scriptable. The per-model
command `type` code is selected automatically, so mixed fleets (baseboard,
floor, V2, V2 Lite) work. Control commands require an explicit --device list.
Reusable helpers (COMMAND_TYPE_BY_MODEL, command_body_for_model, make_command)
live in mysa_stuff.py. A bare --set-point mirrors the app (the setpoint holds
only until the next scheduled change); --hold / --hold-until make it persist.
Tested live against BB-V2-0 and INF-V1-0 devices.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The README notes that setpoint/schedule control "should be pretty easy to add to the CLI as well." This wires the
msg:44command (already documented inmysa_messages.md) intomysothermso the CLI can control thermostats, not just inspect them.New options (all require an explicit
--devicelist):--set-point TEMP(-F/--fahrenheit){sp, tm:-1}--mode {off,on,floor,ambient}{md[, tr]}floor/ambienthandle theINF-V1-0tracked sensor--resume-schedule{ho:1, tm:-1}--hold{ho:2, tm:-1}--hold-until UNIXTIME{ho:1, tm:T}Each command is published to the device's
/intopic, then the tool waits for the device'smsg:44acknowledgement (matched byresp_id) and exits 0 only if every targeted device acked — so it's safe to use from scripts/automations. The per-model commandtypecode is selected automatically, so mixed fleets (baseboard / floor / V2 / V2 Lite) work in one invocation.Reusable helpers (
COMMAND_TYPE_BY_MODEL,command_body_for_model,make_command) live inmysa_stuff.py.Tested live against
BB-V2-0andINF-V1-0devices: setpoint, indefinite hold, and resume-schedule round-trip all confirmed (and the on-deviceScheduleModeflag flips 1↔2 as expected).