Promote Deye, JK200, and ST802 MODBUS scripts to production#193
Closed
orlin369 wants to merge 56 commits intoALLTERCO:mainfrom
Closed
Promote Deye, JK200, and ST802 MODBUS scripts to production#193orlin369 wants to merge 56 commits intoALLTERCO:mainfrom
orlin369 wants to merge 56 commits intoALLTERCO:mainfrom
Conversation
- Reorganize JK200 BMS script under JKESS brand subdirectory - No code changes; path rename only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Implement Modbus RTU master for LinkedGo ST802 Youth Smart Thermostat - Support FC03 (read), FC06 (write single), CRC-16 table-based framing - Cover control registers 0x1001-0x1019 and read-only 0x2101-0x211A - Add 8 BMS simulation scenarios (morning heat, cooling, economy, etc.) - Add ENABLE flag object for individually toggling poll actions and scenarios - Status: under construction; tested on live device at 9600/8N1 RS485 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Document upload workflow: non-ASCII sanitization, 4000-char chunking, stored-length verification, and log streaming pattern - Include error table for HTTP 413 and 500 with root causes and fixes - Include full Python deploy+monitor reference script Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add entry for LinkedGo ST802 Modbus RTU BMS client - Add entry for Shelly deploy/monitor skill document - Add entry for JK200 → JKESS/JK200-MBS path rename Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove stale JK200-MBS old path from manifest - Add JKESS/JK200-MBS new path to manifest - Regenerate SHELLY_MJS.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- @status changed from 'under construction' to 'production' - @link added pointing to orlin369/shelly-script-examples main branch - POLL_MODE, POLL_FAN_SPEED, POLL_HUMIDITY enable flags added - readMode, readFanSpeed, readHumidity functions added - pollStatus chain extended with doMode, doFanSpeed, doHumidity steps - Manifest entry added; SHELLY_MJS.md regenerated - CHANGELOG updated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces skills/modbus-device-template.md as the canonical reference for writing new Modbus RTU device drivers on Shelly (mJS) or plain software (Node.js). Covers: - Concepts table (addr, rtype, itype, bo/wo, scale, rights, vcId/vcHandle, handle) - JSDoc file header convention (@title, @description, @status, @link) - CONFIG block structure (UART, Modbus, poll settings) - Full ENTITIES array with nested reg: { addr, rtype, itype, bo, wo } sub-object - Runtime STATE skeleton and poll-next loop - Shelly vs software platform shim (Timer.set / setTimeout, print / console.log) - Bring-up checklist Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the flat { addr, itype, scale } per-entity shape with the canonical
nested structure from skills/modbus-device-template.md:
reg: { addr, rtype: 0x03, itype, bo: "BE", wo: "BE" }
scale, rights: "R", vcId: null, handle: null, vcHandle: null
Changes:
- Added group comments (Solar/Battery, Grid, Battery, DC Input, AC Output)
- Updated pollEntities/readNext: entity.addr -> entity.reg.addr,
entity.itype -> entity.reg.itype
- Marked @status under development (pending Monday field test)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Same structural change as the_pill_mbsa_deye.shelly.js but for the
Virtual Component variant that pushes values to Shelly virtual number slots.
Changes:
- Nested reg: { addr, rtype: 0x03, itype, bo, wo } per entity
- vcId retains real slot assignments ("number:200" .. "number:208")
- handle/vcHandle initialised to null (populated at runtime)
- rights: "R" added to all entries
- Updated pollEntities: entity.addr -> entity.reg.addr,
entity.itype -> entity.reg.itype
- init() VC handle loop unchanged (uses ent.vcId as before)
- Marked @status under development (pending Monday field test)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… map
JK200 uses bulk block reads rather than per-register polls, so the existing
REG block-coord constants (CELLS_BASE, MAIN_BASE, MAIN_QTY) are preserved
unchanged for the actual UART transactions.
A new ENTITIES array is added purely as a documentation / metadata layer
for the 9 logical values extracted from Block B (0x128A-0x1298):
- MOSFET Temperature (0x128A, i16, *0.1, degC)
- Pack Voltage (0x128D, u32, *1, mV)
- Pack Power (0x128F, i32, *1, mW)
- Pack Current (0x1291, i32, *1, mA)
- Temperature 1/2 (0x1293/4, i16, *0.1, degC)
- Alarm Bitmask (0x1295, u32, *1, -)
- Balance Current (0x1297, i16, *1, mA)
- State of Charge (0x1298, u16, *1, %)
Each entry follows the canonical template shape:
reg: { addr, rtype: 0x04, itype, bo: "BE", wo: "BE" }
scale, rights: "R", vcId: null, handle: null, vcHandle: null
The long register-layout comment before parseMainBlock is replaced with
a concise cross-reference to ENTITIES with block offsets.
parseCellBlock / parseMainBlock logic is unchanged.
Marked @status under development (pending Monday field test).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The old MB308V = { DI_COUNT, DO_COUNT, AI_COUNT, AO_COUNT, AI_MAX_VALUE,
AO_MAX_VALUE } object is removed and replaced with:
1. Standalone calibration constants:
var AI_MAX_VALUE = 10216;
var AO_MAX_VALUE = 24000;
2. A 32-entry ENTITIES array covering all four I/O types, each with the
canonical template shape (reg.rtype encodes the Modbus FC):
DI 0-7 : rtype 0x02 (Read Discrete Inputs), itype "bool", rights "R"
DO 0-11 : rtype 0x01 (Read Coils), itype "bool", rights "RW"
AI 0-7 : rtype 0x04 (Read Input Registers), itype "u16", rights "R"
AO 0-3 : rtype 0x03 (Read Holding Registers), itype "u16", rights "RW"
3. entitiesByRtype(rtype) helper — filters ENTITIES by FC code, used by all
API functions to get both the count and per-channel addresses.
API function updates (logic preserved, counts/addresses now from ENTITIES):
readDigitalInputs -> entitiesByRtype(0x02)
readDigitalOutputs -> entitiesByRtype(0x01)
writeDigitalOutput -> entitiesByRtype(0x01)[channel].reg.addr
readAnalogInputs -> entitiesByRtype(0x04)
readAnalogOutputs -> entitiesByRtype(0x03)
writeAnalogOutput -> entitiesByRtype(0x03)[channel].reg.addr
aiToMilliamps / aiToVoltage / milliampsToAo / voltageToAo
-> standalone AI_MAX_VALUE / AO_MAX_VALUE
Already @status under development — no status change needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The flat REG object (14 raw address constants) is replaced with:
1. An ENTITIES array (14 entries) each carrying a key field, full canonical
template shape, and semantic metadata:
Control registers (rights "RW"):
POWER 0x1001, SYS_TYPE 0x1003, MODE 0x1004, HC_SELECT 0x1006,
FAN_SPEED 0x1007, SETPOINT 0x1008 (scale 0.1 degC),
HUMIDITY_SP 0x1009 (scale 0.1 %), MIN_SP 0x1018, MAX_SP 0x1019
Sensor registers (rights "R"):
ROOM_TEMP 0x2101, HUMIDITY 0x2102, FLOOR_TEMP 0x2103,
RELAY_STATE 0x2110, ALARM 0x211A
2. A load-time loop that rebuilds REG from ENTITIES:
var REG = {};
for (var _ei = 0; _ei < ENTITIES.length; _ei++) {
REG[ENTITIES[_ei].key] = ENTITIES[_ei].reg.addr;
}
All 20+ API functions (setPower, setMode, readTemperatures, etc.) that
reference REG.* constants are left completely unchanged.
Marked @status under development (pending Monday field test).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces a canonical ENTITIES table structure (from skills/modbus-device-template.md) across all Modbus RTU device scripts in the_pill/MODBUS/: - skills/modbus-device-template.md — new skill file (canonical reference) - Deye/the_pill_mbsa_deye.shelly.js — flat ENTITIES -> nested reg sub-object - Deye/the_pill_mbsa_deye_vc.shelly.js — same; vcId slots preserved - JKESS/JK200-MBS/the_pill_mbsa_jk200.shelly.js — ENTITIES metadata layer added; block-read REG coords unchanged - ComWinTop/mb308v.shelly.js — MB308V object replaced with typed ENTITIES + entitiesByRtype() helper - LinkedGo/ST802/st802_bms.shelly.js — ENTITIES + load-time REG derivation; all API functions unchanged All modified device scripts marked @status under development for Monday testing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename the_pill_mbsa_deye.shelly.js -> deye.shelly.js to match the naming convention used by other device scripts in the project. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename the_pill_mbsa_deye_vc.shelly.js -> deye_vc.shelly.js to match the naming convention used by other VC scripts in the project. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename the_pill_mbsa_jk200.shelly.js -> jk200.shelly.js to match the naming convention used by other device scripts in the project. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds jk200_vc.shelly.js with 9 VCs (number:200-208) covering all BMS telemetry: MOSFET temperature, pack voltage/current/power, cell temps, alarm bitmask, balance current, and state of charge. One group:200 bundles all VCs in the Shelly web UI. VC updates are emitted from parseMainBlock() after each value is computed, using the same updateVc() pattern as the Deye VC script. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds mb308v_vc.shelly.js with a focused 9-VC demo layout in one group: button:200/201 relay toggle buttons (press to flip DO 0/1) number:200/201 DI 0/1 live displays (read-only, script writes) number:202/203 AO 0/1 sliders (persisted; user sets, script reads) number:204/205 AI 0/1 progress bars (read-only, script writes) group:200 MB308V Demo Relay toggling via Shelly.addEventHandler (button push events). AO slider writes are debounced: hardware is only written when the slider value changes from the previous poll cycle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds st802_bms_vc.shelly.js with 9 VCs (number:200-208) covering key thermostat state and controls: room temperature, humidity, floor temperature, relay state, alarm, mode, fan speed, setpoint, and power. One group:200 bundles all VCs in the Shelly web UI. VCs are updated from each read callback (readTemperatures, readRelayStatus, readAlarm, readMode, readFanSpeed) and from write functions after a successful register write. Two new poll stages (doSetpoint / doPower) extend the poll chain to keep setpoint and power state current. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds skills/modbus-vc-deploy.md describing the complete workflow for
deploying any *_vc.shelly.js MODBUS script:
1. Read VC requirements from the JS file (vcId fields + header comment)
2. Verify device reachability (gen-3, firmware >= 1.3.0)
3. Create VCs via curl — per-device tables for Deye, JK200, MB308V, ST802
including the mixed button+number layout used by the MB308V demo
4. Upload script via tools/put_script.py (falls back to chunked curl)
5. Monitor logs; expected output patterns for each device
6. Verify VC values via Virtual.GetStatus HTTP call
Also includes an automated Python helper (modbus_vc_setup.py) that
parses vcId values from the JS file, provisions all VCs, and calls
put_script.py to upload and start the script.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds Virtual Component variants for all MODBUS device scripts and a deployment skill: - Rename Deye/JK200 scripts to shorter filenames (deye.shelly.js, deye_vc.shelly.js, jk200.shelly.js) - jk200_vc.shelly.js: 9 VCs (number:200-208), all BMS telemetry - mb308v_vc.shelly.js: mixed layout — 2 relay buttons, 2 DI displays, 2 AO sliders, 2 AI progress bars, 1 group (group:200) - st802_bms_vc.shelly.js: 9 VCs covering thermostat sensors + controls - skills/modbus-vc-deploy.md: step-by-step VC provisioning guide with per-device curl tables and a Python automation helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace generic RS485 module references with The Pill 5-Terminal Add-on pin mapping: IO1 (TX) → B (D-), IO2 (RX) → A (D+), IO3 → DE/RE direction control (handled automatically by the hardware). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace generic RS485 module references with The Pill 5-Terminal Add-on pin mapping: IO1 (TX) → B (D-), IO2 (RX) → A (D+), IO3 → DE/RE direction control (automatic). Also adds wiring block to deye_vc.shelly.js which previously had none. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace RS485 transceiver (e.g. MAX485) wiring references with The Pill 5-Terminal Add-on pin mapping: IO1 (TX) → B (D-), IO2 (RX) → A (D+), IO3 → DE/RE direction control (automatic). Applied to both CLI and VC variants. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace generic RS485 module references with The Pill 5-Terminal Add-on pin mapping: IO1 (TX) → B (D-), IO2 (RX) → A (D+), IO3 → DE/RE direction control (automatic). Applied to both CLI and VC variants. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace generic RS485 module references with The Pill 5-Terminal Add-on pin mapping: IO1 (TX) → B (D-), IO2 (RX) → A (D+), IO3 → DE/RE direction control (automatic). Applied to both CLI and VC variants. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updates hardware wiring comments in all 9 MODBUS scripts to use The Pill
5-Terminal Add-on pin naming instead of generic RS485 module references:
IO1 (TX) ─── B (D-) ──> device RS485 B (D-)
IO2 (RX) ─── A (D+) ──> device RS485 A (D+)
IO3 ─── DE/RE ── direction control (automatic)
Covers: modbus_rtu library, Deye CLI+VC, JK200 CLI+VC,
MB308V CLI+VC, ST802 CLI+VC.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add LinkedGo R290 MODBUS script under LinkedGo/R290 - Standardize MODBUS README files with Story and Persona sections - Add missing README files for JKESS and LinkedGo subfolders - Align RS485 wiring guidance to The Pill 5-terminal mapping - Record documentation and script additions in CHANGELOG Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add skills/manifest-verify-tools.md for tools-driven manifest workflows - Document strict no-manual-edits rule for generated manifest/index files - Record the new skill in CHANGELOG.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove legacy SDS011 setup and VC scripts - Rename and standardize SDS011 VC cycle script headers - Add init() startup flow and update SDS011 documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename finance script to stock-monitor.shelly.js and add standard script metadata headers - Add finance-yahoo README with Problem (The Story), Persona, and usage notes - Update http-integrations README index and changelog entries Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add skill file for commit, merge, push, and feature branch cleanup workflow - Add pre-commit documentation verification rule to the skill - Record the new skill in CHANGELOG for 2026-03 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename and standardize open windows BLE example as ble-open-windows.shelly.js - Add metadata headers and align script structure/style with repository conventions - Update BLE README and changelog entries for the new script Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add skill for converting non-standard JS scripts to .shelly.js format - Define required metadata headers and standard section structure - Record the new skill in CHANGELOG under 2026-03 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
HTTP endpoint that bridges MODBUS RTU over UART. Accepts a register descriptor as JSON (name, units, scale, rights, reg.addr/rtype/itype/ bo/wo, value), performs the RTU read or write via The Pill RS485, and returns the result as JSON with value and human_readable populated. Supports all register types (holding, input, coil, discrete), all common data types (u16, i16, u32, i32, f32), byte/word order config, and both GET (URL-encoded) and POST (JSON body) requests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Mark Deye, JK200, and ST802 scripts as production with corrected header links - Sync manifest and SHELLY_MJS index after production promotions - Update JK200 units/scales (V, W, A) and VC deploy skill guidance - Add screenshot sections and captions to Deye/JK200/ST802 README files Co-Authored-By: Claude Opus 4.5 <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.
Promotes tested MODBUS scripts to production and syncs docs/index. Includes Deye (deye.shelly.js, deye_vc.shelly.js), JK200 (jk200.shelly.js, jk200_vc.shelly.js), and ST802 (st802_bms.shelly.js, st802_bms_vc.shelly.js). Updates manifest/SHELLY_MJS, VC skill guidance, and adds README screenshots/captions.