diff --git a/CHANGELOG.md b/CHANGELOG.md index 567c0907..b3f8aa49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,43 @@ steered it, and an owner whose fuse was overloaded had no way to see why. reported, and every request carries an FTW User-Agent. Written from Zaptec's API documentation. Not yet confirmed on hardware. +### Removed: local `easee` and local `zaptec` + +Both read a device API that does not exist, so the catalog stops listing +them. `easee` read an invented Modbus map: Easee documents no local Modbus or +REST API. `zaptec` read `/api/charger/state` over HTTP: Zaptec documents no +local API on Go, Go 2 or Pro. On a real charger they read nothing, and +`easee` then sent 0 W as if the charger had said so. Neither was ever run on +hardware. + +Use `easee_cloud` or `zaptec_cloud` instead. For local control, point the +charger's OCPP at FTW: Easee from firmware 344 and Zaptec Go, Go 2 and Pro +can connect to an OCPP 1.6J server of the owner's choice, and FTW has one +built in (FTW `docs/ocpp.md`). `driver-history.json` keeps their record, +as it did for `foxess`. + +### tesla_wall_connector 0.2.0 + +The driver says plainly that FTW can read the charger but not control it: +Tesla offers no way for another system to set its current or start and stop +it. Tesla's own current control is Dynamic Power Management, an installer +setting fed by a Tesla energy meter; its application note is now in +`upstream_docs`. Control goes through the car (`tesla_vehicle`) or a charger +FTW can control, such as one on OCPP. + +`driver_command` now refuses every control action with `false`. It used to +answer `true` to `ev_set_current`, `ev_pause`, `ev_resume` and `ev_start` +while writing nothing. FTW Core never sent those to this read-only driver, +so nothing changes there, but no host may now read a refusal as success. + +### teslamate_vehicle 0.2.1, home_assistant_vehicle 0.1.1, tesla_cloud 0.2.1 + +Each description and manifest note now says why FTW cannot control the car +through it, and where control goes instead. TeslaMate only logs data and +takes no commands. The Home Assistant driver only listens and sends nothing +back. Tesla's Fleet API accepts a command only when it is signed with a key +paired to the car, and a Lua driver cannot sign. To start a Tesla's charge, +add `tesla_vehicle` (BLE proxy). No behaviour changes. ### heishamon 0.8.1 diff --git a/SUPPORT_STATUS.md b/SUPPORT_STATUS.md index 11a8fd33..97aba4d7 100644 --- a/SUPPORT_STATUS.md +++ b/SUPPORT_STATUS.md @@ -44,8 +44,6 @@ Catalog source is not proof that a target can install or run a driver. | deye-svk | 0.2.2 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | deye | 2.1.1 | ftw-core | not_assessed | — | not_recorded | not_assessed | | deye | 2.1.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | -| easee | 1.0.4 | ftw-core | not_assessed | — | not_recorded | not_assessed | -| easee | 1.0.4 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | easee_cloud | 1.4.1 | ftw-core | not_assessed | — | not_recorded | not_assessed | | easee_cloud | 1.4.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | esphome_dsmr | 1.0.7 | ftw-core | not_assessed | — | not_recorded | not_assessed | @@ -80,8 +78,8 @@ Catalog source is not proof that a target can install or run a driver. | heishamon | 0.8.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | hello | 1.1.2 | ftw-core | not_assessed | — | not_recorded | not_assessed | | hello | 1.1.2 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | -| home_assistant_vehicle | 0.1.0 | ftw-core | not_assessed | — | not_recorded | not_assessed | -| home_assistant_vehicle | 0.1.0 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | +| home_assistant_vehicle | 0.1.1 | ftw-core | not_assessed | — | not_recorded | not_assessed | +| home_assistant_vehicle | 0.1.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | huawei | 2.1.3 | ftw-core | not_assessed | — | not_recorded | not_assessed | | huawei | 2.1.3 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | janitza | 1.0.5 | ftw-core | not_assessed | — | not_recorded | not_assessed | @@ -162,14 +160,14 @@ Catalog source is not proof that a target can install or run a driver. | sonnen | 2.0.3 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | sungrow | 1.6.1 | ftw-core | not_assessed | — | not_recorded | not_assessed | | sungrow | 1.6.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | -| tesla_cloud | 0.2.0 | ftw-core | not_assessed | — | not_recorded | not_assessed | -| tesla_cloud | 0.2.0 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | +| tesla_cloud | 0.2.1 | ftw-core | not_assessed | — | not_recorded | not_assessed | +| tesla_cloud | 0.2.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | tesla_vehicle | 0.2.6 | ftw-core | not_assessed | — | not_recorded | not_assessed | | tesla_vehicle | 0.2.6 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | -| tesla_wall_connector | 0.1.2 | ftw-core | not_assessed | — | not_recorded | not_assessed | -| tesla_wall_connector | 0.1.2 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | -| teslamate_vehicle | 0.2.0 | ftw-core | not_assessed | — | not_recorded | not_assessed | -| teslamate_vehicle | 0.2.0 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | +| tesla_wall_connector | 0.2.0 | ftw-core | not_assessed | — | not_recorded | not_assessed | +| tesla_wall_connector | 0.2.0 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | +| teslamate_vehicle | 0.2.1 | ftw-core | not_assessed | — | not_recorded | not_assessed | +| teslamate_vehicle | 0.2.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | tibber | 1.1.2 | ftw-core | not_assessed | — | not_recorded | not_assessed | | tibber | 1.1.2 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | vag_vehicle | 0.3.0 | ftw-core | not_assessed | — | not_recorded | not_assessed | @@ -184,8 +182,6 @@ Catalog source is not proof that a target can install or run a driver. | wallbox | 1.0.3 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | zap | 3.1.3 | ftw-core | not_assessed | — | not_recorded | not_assessed | | zap | 3.1.3 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | -| zaptec | 1.0.1 | ftw-core | not_assessed | — | not_recorded | not_assessed | -| zaptec | 1.0.1 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | zaptec_cloud | 0.2.0 | ftw-core | not_assessed | — | not_recorded | not_assessed | | zaptec_cloud | 0.2.0 | blixt-l1 | not_assessed | — | not_recorded | not_assessed | | zuidwijk_p1 | 1.1.2 | ftw-core | not_assessed | — | not_recorded | not_assessed | diff --git a/devices.yaml b/devices.yaml index 2bb49426..9e1429b1 100644 --- a/devices.yaml +++ b/devices.yaml @@ -321,17 +321,6 @@ manufacturers: notes: "Name-derived phase object_ids live-validated on SlimmeLezer+; explicit Sourceful aliases retained." - name: "Easee" model_families: - - name: "Easee" - variants: [Easee Charge, Easee Home] - regions: [] - protocols: - - protocol: modbus - driver: "easee" - version: "1.0.4" - ders: [v2x_charger] - control: false - firmware_versions: "" - notes: "Community driver, may require specific firmware for Modbus TCP" - name: "Easee Cloud" variants: [Charge, Home] regions: [] @@ -614,11 +603,11 @@ manufacturers: protocols: - protocol: mqtt driver: "home_assistant_vehicle" - version: "0.1.0" + version: "0.1.1" ders: [vehicle] control: false firmware_versions: "" - notes: "Read-only vehicle level, charge limit, charging state, charge cable and place from a JSON message a Home Assistant automation publishes. Tested with recorded messages from a Model Y on the Tesla Custom Integration; the cable and place fields have not run on a car. Does not wake or command the car." + notes: "Read-only. FTW reads the car's charge level, charge limit, charging state, charge cable and place from a message a Home Assistant automation publishes over MQTT. FTW cannot control the car through it: the driver only listens and sends nothing back to Home Assistant. Control the charge with a charger FTW can control. Tested with recorded messages from a Model Y on the Tesla Custom Integration; the cable and place fields have not run on a car. Does not wake the car." - name: "Hoymiles" model_families: - name: "HM Series" @@ -1841,33 +1830,33 @@ manufacturers: protocols: - protocol: http driver: "tesla_cloud" - version: "0.2.0" + version: "0.2.1" ders: [vehicle] control: false firmware_versions: "" - notes: "Read-only vehicle SoC, charge limit, charging state and charge cable via the official Tesla Fleet API. Grant the optional vehicle_location scope to report the car's distance from the site; the coordinates stay in the driver. Optional next to tesla_vehicle (BLE proxy). Does not wake or command the car. Not yet run against a car." + notes: "Read-only. FTW reads the car's charge level, charge limit, charging state and charge cable from the official Tesla Fleet API. FTW cannot control the car through it: Tesla accepts a command only when it is signed with a key paired to the car, and this driver cannot sign. Use tesla_vehicle (BLE proxy) to start the car's charge, or a charger FTW can control. Grant the optional vehicle_location scope to report the car's distance from the site; the coordinates stay in the driver. Does not wake the car. Not yet run against a car." - name: "Tesla Vehicle (TeslaMate)" variants: [Model 3, Model Y] regions: [] protocols: - protocol: mqtt driver: "teslamate_vehicle" - version: "0.2.0" + version: "0.2.1" ders: [vehicle] control: false firmware_versions: "" - notes: "Read-only vehicle SoC, charge limit, charging state, charge cable and place via TeslaMate MQTT. Set geofence to this site's TeslaMate geofence for the place. Optional next to tesla_vehicle (BLE proxy). Does not wake or command the car. Not yet run against a car." + notes: "Read-only. FTW reads the car's charge level, charge limit, charging state, charge cable and place from TeslaMate over MQTT. FTW cannot control the car through it: TeslaMate only logs data and takes no commands. Use tesla_vehicle (BLE proxy) to start the car's charge, or a charger FTW can control. Set geofence to this site's TeslaMate geofence for the place. Does not wake the car. Not yet run against a car." - name: "Tesla Wall Connector" variants: [Wall Connector Gen 3] regions: [] protocols: - protocol: http driver: "tesla_wall_connector" - version: "0.1.2" + version: "0.2.0" ders: [ev] control: false firmware_versions: "" - notes: "Tesla Wall Connector Gen 3 on the LAN. Observation only; no local current setpoint." + notes: "Read-only. FTW reads power, current and session energy from the charger on your network, with no cloud account. FTW cannot control it: Tesla offers no way for another system to set its current or start and stop it. Its own current control is an installer setting fed by a Tesla energy meter. Control goes through the car (tesla_vehicle) or a charger FTW can control, such as one on OCPP." - name: "Tibber" model_families: - name: "Tibber Pulse" @@ -2108,17 +2097,6 @@ manufacturers: notes: "Community driver, untested" - name: "Zaptec" model_families: - - name: "Zaptec" - variants: [Zaptec GO, Zaptec PRO] - regions: [] - protocols: - - protocol: http - driver: "zaptec" - version: "1.0.1" - ders: [v2x_charger] - control: false - firmware_versions: "" - notes: "Community driver, untested" - name: "Zaptec Cloud" variants: [Go, Go 2, Pro] regions: [] diff --git a/drivers/lua/easee.lua b/drivers/lua/easee.lua deleted file mode 100644 index 3ddb6fdc..00000000 --- a/drivers/lua/easee.lua +++ /dev/null @@ -1,116 +0,0 @@ --- Easee Home/Charge EV Charger Driver (community, untested) --- Emits: V2X Charger --- Register type: HOLDING (FC 0x03) --- Modbus TCP interface, port 502 --- Note: Easee uses F32 for power/energy, U16 for state - -PROTOCOL = "modbus" - --- IEEE-754 float32 from two big-endian registers. Kept in Lua so the driver --- does not depend on a host helper: this is arithmetic, not I/O. -local function decode_f32_be(hi, lo) - -- Work on the 16-bit halves. Combining them first overflows a 32-bit - -- integer build, where 0x80000000 is negative and every value then - -- decodes with a flipped sign. - local sign = 1 - if hi >= 0x8000 then sign = -1; hi = hi - 0x8000 end - local exponent = math.floor(hi / 128) - local mantissa = (hi % 128) * 65536 + lo - if exponent == 0 then - if mantissa == 0 then return 0 end - return sign * mantissa * 2^-149 - end - -- Infinity and NaN would poison every downstream sum; report nothing. - if exponent == 0xFF then return 0 end - return sign * (1 + mantissa / 0x800000) * 2^(exponent - 127) -end - --- Reading a register the charger does not have costs a failed read on every --- poll forever, and the host counts those against the poll whether or not Lua --- caught the error. Enough of them and the site is marked offline and reports --- nothing at all, which is worse than reporting one field less. So stop asking --- once a register has proved it is not there. Three tries, because one failure --- proves nothing -- the link may just have been slow. --- --- Safe to bound every read here: this driver has no driver_command, so no read --- below is on a control path where giving up could veto a later command. -local GIVE_UP_AFTER = 3 -local read_failures = {} - -local function probe_read(addr, count, kind) - if (read_failures[addr] or 0) >= GIVE_UP_AFTER then return nil end - local ok, regs = pcall(host.modbus_read, addr, count, kind) - if ok and regs and regs[1] ~= nil then - read_failures[addr] = nil - return regs - end - local failures = (read_failures[addr] or 0) + 1 - read_failures[addr] = failures - if failures == GIVE_UP_AFTER then - host.log("info", string.format( - "Easee: register %d did not answer %d times; leaving it alone " .. - "until restart", addr, GIVE_UP_AFTER)) - end - return nil -end - -function driver_init(config) - host.set_make("Easee") -end - -function driver_poll() - -- L1 current: 0 (F32, A), L2: 2 - local a_regs = probe_read(0, 4, "holding") - local l1_a, l2_a = 0, 0 - if a_regs then - l1_a = decode_f32_be(a_regs[1], a_regs[2]) - l2_a = decode_f32_be(a_regs[3], a_regs[4]) - end - - -- Active power: 4 (F32, W) - local w_regs = probe_read(4, 2, "holding") - local power_w = 0 - if w_regs then - power_w = decode_f32_be(w_regs[1], w_regs[2]) - end - - -- Session energy: 8 (F32, Wh) - local se_regs = probe_read(8, 2, "holding") - local session_wh = 0 - if se_regs then - session_wh = decode_f32_be(se_regs[1], se_regs[2]) - end - - -- Charger state: 10 (U16: 1=disconnected, 2=awaiting, 3=charging, 4=completed, 5=error) - local st_regs = probe_read(10, 1, "holding") - local raw_state = 0 - local state = 0 - if st_regs then - raw_state = st_regs[1] - -- Map Easee states to standard: 0=idle, 1=connected, 2=charging, 3=error - if raw_state == 1 then - state = 0 -- disconnected -> idle - elseif raw_state == 2 then - state = 1 -- awaiting -> connected - elseif raw_state == 3 then - state = 2 -- charging -> charging - elseif raw_state == 4 then - state = 0 -- completed -> idle - elseif raw_state == 5 then - state = 3 -- error -> error - end - end - - -- Emit V2X charger telemetry - host.emit("v2x_charger", { - w = power_w, - session_charge_wh = session_wh, - l1_a = l1_a, - l2_a = l2_a, - }) - - return 5000 -end - -function driver_cleanup() -end diff --git a/drivers/lua/home_assistant_vehicle.lua b/drivers/lua/home_assistant_vehicle.lua index d3b33eb3..cf0767d0 100644 --- a/drivers/lua/home_assistant_vehicle.lua +++ b/drivers/lua/home_assistant_vehicle.lua @@ -103,6 +103,18 @@ -- -- Publish non-retained: a retained message would replay an old reading at -- every reconnect. +-- +-- Why there is no control. Home Assistant can start and stop a car's charge +-- through the car integration's own entities (Tesla Fleet has a Charge +-- switch and Charge current and Charge limit numbers), and the FTW host +-- could reach them: host.http_post to Home Assistant's REST API +-- (POST /api/services//) or host.mqtt_publish to a topic +-- an automation acts on. This driver +-- does neither. Each needs a Home Assistant token or a second automation the +-- owner writes, entity names differ by integration, and over MQTT the driver +-- would never learn whether the car took the command. FTW Core sends a car +-- only charge_start and a telemetry wake_up today. Until that work is done, +-- it listens and nothing more. DRIVER = { host_api_min = 1, @@ -110,11 +122,11 @@ DRIVER = { id = "home_assistant_vehicle", name = "Vehicle (Home Assistant MQTT)", manufacturer = "Home Assistant", - version = "0.1.0", + version = "0.1.1", protocols = { "mqtt" }, capabilities = { "vehicle" }, read_only = true, - description = "Read-only vehicle level, charge limit, charging state, charge cable and place from a JSON message a Home Assistant automation publishes over MQTT. Does not wake or command the car.", + description = "Reads a car's charge level, limit, charging state, cable and place from a message a Home Assistant automation publishes over MQTT. Read-only: the driver only listens and sends nothing back, so FTW cannot start or stop charging through it. Control the charge with a charger FTW can control.", homepage = "https://www.home-assistant.io/integrations/mqtt/", authors = { "FTW contributors" }, tested_models = { "Model Y" }, diff --git a/drivers/lua/tesla_cloud.lua b/drivers/lua/tesla_cloud.lua index e68e7eb2..a890b4ba 100644 --- a/drivers/lua/tesla_cloud.lua +++ b/drivers/lua/tesla_cloud.lua @@ -30,6 +30,16 @@ -- vehicle_device_data. Do not grant vehicle_cmds / vehicle_charging_cmds for -- this driver; it never posts a command. -- +-- Why there is no control. Fleet API has charge_start, charge_stop, +-- set_charging_amps and set_charge_limit, but a current car rejects any +-- command not signed with a virtual key paired to that car, and does +-- nothing. Tesla's Vehicle Command Proxy or SDK does the signing; only +-- pre-2021 Model S and X still take unsigned commands. Signing needs a key +-- exchange and authenticated encryption that a sandboxed Lua driver cannot +-- do. Commands are also billed. tesla_vehicle already sends charge_start, +-- signed, through a local BLE proxy. +-- https://developer.tesla.com/docs/fleet-api/endpoints/vehicle-commands +-- -- Which car is plugged in (FTW docs/cars.md, rule 2). The same charge_state -- read says whether a cable is in (conn_charge_cable, else charging_state). -- The driver sends no plugged_since_ms: it reads the car minutes apart, so @@ -70,12 +80,12 @@ DRIVER = { id = "tesla_cloud", name = "Tesla Vehicle (Fleet API)", manufacturer = "Tesla", - version = "0.2.0", + version = "0.2.1", protocols = { "http" }, capabilities = { "vehicle" }, read_only = true, auth_post_path = "/oauth2/v3/token", - description = "Read-only Tesla vehicle SoC, charge limit and charging state via the official Fleet API. Optional next to the local BLE-proxy driver. Does not wake or command the car.", + description = "Reads a Tesla's charge level, limit, charging state and cable from Tesla's Fleet API. Read-only: Tesla accepts a command only when it is signed with a key paired to the car, and this driver cannot sign. Use tesla_vehicle (BLE) to start the car's charge, or a charger FTW can control.", homepage = "https://developer.tesla.com/docs/fleet-api", http_hosts = { "fleet-auth.prd.vn.cloud.tesla.com", diff --git a/drivers/lua/tesla_wall_connector.lua b/drivers/lua/tesla_wall_connector.lua index 85e67b73..40be8fa7 100644 --- a/drivers/lua/tesla_wall_connector.lua +++ b/drivers/lua/tesla_wall_connector.lua @@ -7,10 +7,14 @@ -- this testdata file is the in-tree source until that pin lands. Operators -- can drop the same file in the user-drivers directory in the meantime. -- --- The wall connector has no local current setpoint. ev_set_current, --- ev_pause and ev_resume are accepted so the planner does not mark the --- driver failed; they do not write hardware. Steer a Tesla through --- tesla_vehicle. Sign convention: positive W is charging. +-- Read-only. Tesla documents no way for another system to set this +-- charger's current or to start and stop it over the network: /api/1/vitals +-- only reports. Its own current control is Dynamic Power Management, an +-- installer setting fed by a Tesla energy meter on RS-485 (Tesla's +-- application note, in the manifest's upstream_docs). So the driver refuses +-- every command. FTW controls the charge through the car (tesla_vehicle) or +-- through a charger it can control, such as one on OCPP. +-- Sign convention: positive W is charging. -- -- Config: -- host LAN hostname or IP (no scheme) @@ -26,11 +30,11 @@ DRIVER = { id = "tesla_wall_connector", name = "Tesla Wall Connector", manufacturer = "Tesla", - version = "0.1.2", + version = "0.2.0", protocols = { "http" }, capabilities = { "ev" }, read_only = true, - description = "Tesla Wall Connector Gen 3 on the LAN. Observation only; no cloud account.", + description = "Reads a Tesla Wall Connector Gen 3 on your network. FTW can read it but not control it: Tesla offers no way for another system to set its current. Control goes through the car (tesla_vehicle) or a charger FTW can control, such as one on OCPP.", homepage = "https://www.tesla.com/support/charging/wall-connector", authors = { "FTW contributors" }, tested_models = { "Wall Connector Gen 3" }, @@ -240,26 +244,24 @@ function driver_poll() return 5000 end +-- FTW Core never sends a command to a read_only driver. A host that does +-- gets a plain refusal: nothing was written, so nothing may be reported as +-- done. init and deinit are a host's lifecycle steps, not device writes. function driver_command(action, power_w, cmd) if action == "init" or action == "deinit" then return true end - if action == "ev_set_current" or action == "ev_pause" - or action == "ev_resume" or action == "ev_start" then - if not warned_readonly then - host.log("warn", - "Tesla Wall Connector has no local current setpoint; " .. - "steer a Tesla through tesla_vehicle") - warned_readonly = true - end - return true + if not warned_readonly then + host.log("warn", + "Tesla Wall Connector: read-only, refused " .. tostring(action) .. + "; Tesla offers no way to set its current from another system") + warned_readonly = true end - host.log("warn", "Tesla Wall Connector: unknown action " .. tostring(action)) return false end function driver_default_mode() - -- Observation-only: the box keeps charging at the car's last request. + -- Nothing to hand back: the driver never takes control. end function driver_cleanup() diff --git a/drivers/lua/teslamate_vehicle.lua b/drivers/lua/teslamate_vehicle.lua index b7d911b5..f2a5ca56 100644 --- a/drivers/lua/teslamate_vehicle.lua +++ b/drivers/lua/teslamate_vehicle.lua @@ -11,7 +11,9 @@ -- plug-in slider. -- -- Telemetry only. No wake, charge_start, or other vehicle command. TeslaMate --- MQTT is subscribe-only; this driver never publishes. +-- is a data logger: its MQTT integration publishes values and has no command +-- topic, so there is nothing to send a command to. This driver never +-- publishes. -- -- TeslaMate does not publish VIN on MQTT (privacy). Bind identity from YAML: -- host.set_make("Tesla"), host.set_sn(VIN). Car id selects the topic prefix. @@ -73,11 +75,11 @@ DRIVER = { id = "teslamate_vehicle", name = "Tesla Vehicle (TeslaMate)", manufacturer = "Tesla", - version = "0.2.0", + version = "0.2.1", protocols = { "mqtt" }, capabilities = { "vehicle" }, read_only = true, - description = "Read-only Tesla vehicle SoC, charge limit and charging state via TeslaMate MQTT. Optional next to tesla_vehicle (BLE). Does not wake or command the car.", + description = "Reads a Tesla's charge level, limit, charging state, cable and place from TeslaMate over MQTT. Read-only: TeslaMate only logs the car and takes no commands, so FTW cannot start or stop charging through it. Use tesla_vehicle (BLE) to start the car's charge, or a charger FTW can control.", homepage = "https://docs.teslamate.org/docs/integrations/mqtt", authors = { "FTW contributors" }, tested_models = { "Model Y", "Model 3" }, diff --git a/drivers/lua/zaptec.lua b/drivers/lua/zaptec.lua deleted file mode 100644 index 5e7d5042..00000000 --- a/drivers/lua/zaptec.lua +++ /dev/null @@ -1,74 +0,0 @@ --- Zaptec EV Charger HTTP Driver (community, untested) --- Emits: V2X Charger --- HTTP REST API, port 80 --- Endpoint: GET /api/charger/state --- Returns JSON with ChargingPower, TotalChargingEnergy, ChargingCurrent, --- Voltage, ChargerState - -PROTOCOL = "http" - --- Module state -local base_url = nil - ----------------------------------------------------------------------------- --- Helpers ----------------------------------------------------------------------------- - --- HTTP GET + JSON decode with error handling -local function http_get_json(path) - local ok, body = pcall(host.http_get, base_url .. path) - if not ok or not body then return nil end - local ok2, data = pcall(host.json_decode, body) - if not ok2 or not data then return nil end - return data -end - --- Map Zaptec state strings to standard numeric: 0=idle, 1=connected, 2=charging, 3=error -local function map_state(charger_state) - if not charger_state then return 0 end - local s = string.lower(tostring(charger_state)) - if s == "charging" then - return 2 - elseif s == "connected" or s == "waiting" or s == "ready" then - return 1 - elseif s == "error" or s == "fault" then - return 3 - else - return 0 -- disconnected, completed, unknown -> idle - end -end - ----------------------------------------------------------------------------- --- Driver interface ----------------------------------------------------------------------------- - -function driver_init(config) - local port = config.port or 80 - base_url = "http://" .. config.host .. ":" .. port - host.set_make("Zaptec") -end - -function driver_poll() - local data = http_get_json("/api/charger/state") - if not data then return 5000 end - - local power_w = tonumber(data.ChargingPower) or 0 - local session_wh = tonumber(data.TotalChargingEnergy) or 0 - local current_a = tonumber(data.ChargingCurrent) or 0 - local voltage_v = tonumber(data.Voltage) or 0 - local state = map_state(data.ChargerState) - - -- Emit V2X charger telemetry - host.emit("v2x_charger", { - w = power_w, - session_charge_wh = session_wh, - l1_a = current_a, - l1_v = voltage_v, - }) - - return 5000 -end - -function driver_cleanup() - base_url = nil -end diff --git a/drivers/tests/invented-number-baseline.json b/drivers/tests/invented-number-baseline.json index 2c0de0f6..ab11272a 100644 --- a/drivers/tests/invented-number-baseline.json +++ b/drivers/tests/invented-number-baseline.json @@ -25,7 +25,6 @@ "ctek_hybrid": 9, "ctek_v2": 9, "deye": 28, - "easee": 4, "etrel": 8, "ferroamp_modbus": 18, "fronius": 11, diff --git a/drivers/tests/lua_harness/test_all_drivers.lua b/drivers/tests/lua_harness/test_all_drivers.lua index a032fc84..23e5dba2 100644 --- a/drivers/tests/lua_harness/test_all_drivers.lua +++ b/drivers/tests/lua_harness/test_all_drivers.lua @@ -70,7 +70,6 @@ local DRIVER_SPECS = { goe = { protocol = "modbus", ders = {"v2x_charger"} }, keba = { protocol = "modbus", ders = {"v2x_charger"} }, wallbox = { protocol = "modbus", ders = {"v2x_charger"} }, - easee = { protocol = "modbus", ders = {"v2x_charger"} }, mennekes = { protocol = "modbus", ders = {"v2x_charger"} }, schrack_ev = { protocol = "modbus", ders = {"v2x_charger"} }, etrel = { protocol = "modbus", ders = {"v2x_charger"} }, @@ -84,7 +83,6 @@ local DRIVER_SPECS = { -- HTTP EV chargers goe_http = { protocol = "http", ders = {"v2x_charger"}, port = 8080 }, openevse = { protocol = "http", ders = {"v2x_charger"} }, - zaptec = { protocol = "http", ders = {"v2x_charger"} }, hardybarth = { protocol = "http", ders = {"v2x_charger"} }, -- MQTT drivers @@ -252,18 +250,7 @@ local function setup_modbus_data(driver_name) --------------------------------------------------------------------------- -- Per-driver Modbus overrides for special cases --------------------------------------------------------------------------- - if driver_name == "easee" then - -- Easee uses F32 at low addresses (0-9) and U16 at 10 - hi, lo = host.encode_f32(16.0) - holding[0] = hi; holding[1] = lo - hi, lo = host.encode_f32(15.0) - holding[2] = hi; holding[3] = lo - hi, lo = host.encode_f32(3500.0) - holding[4] = hi; holding[5] = lo - hi, lo = host.encode_f32(5000.0) - holding[8] = hi; holding[9] = lo - holding[10] = 3 -- charging state - elseif driver_name == "goe" then + if driver_name == "goe" then -- go-e Modbus: U16 values at low addresses holding[0] = 2 -- state: charging holding[3] = 160 -- max current 0.1A -> 16A @@ -372,9 +359,6 @@ local function setup_http_data(driver_name, port) elseif driver_name == "goe_http" then host._http_responses[base .. "/api/status"] = '{"nrg":[230,229,231,0,5.2,4.8,5.0,1196,1099,1155,0,3450,0.98,0.97,0.99,0],"wh":5000,"car":2,"amp":16}' - elseif driver_name == "zaptec" then - host._http_responses[base .. "/api/charger/state"] = - '{"ChargingPower":7200,"TotalChargingEnergy":3500,"ChargingCurrent":31.3,"Voltage":230,"ChargerState":"charging"}' elseif driver_name == "hardybarth" then host._http_responses[base .. "/api/status"] = '{"power":3500,"energy":2500,"current":15.2,"voltage":230,"state":"charging"}' diff --git a/drivers/tests/lua_harness/test_tesla_wall_connector.lua b/drivers/tests/lua_harness/test_tesla_wall_connector.lua index 1831c39e..f659bc03 100644 --- a/drivers/tests/lua_harness/test_tesla_wall_connector.lua +++ b/drivers/tests/lua_harness/test_tesla_wall_connector.lua @@ -127,4 +127,32 @@ r = poll([[{"vehicle_connected":true,"evse_state":11,"grid_v":230,"vehicle_curre near(r.w, 3680, 0.01, "no contactor field, charging state") assert(r.charging == true) +-- Read-only: Tesla offers no way for another system to set this charger's +-- current. Every control action is refused, and nothing is written. +assert(DRIVER.read_only == true, "the wall connector must stay read_only") +local desc = DRIVER.description +assert(desc:find("not control it", 1, true), "description must say FTW cannot control it") +assert(desc:find("tesla_vehicle", 1, true) and desc:find("OCPP", 1, true), + "description must say where control goes instead") + +poll(idle) +host._calls = {} +for _, action in ipairs({ "ev_set_current", "ev_pause", "ev_resume", "ev_start", "curtail" }) do + local ok = driver_command(action, 3680, { action = action, power_w = 3680, max_amps_per_phase = 16 }) + assert(ok == false, action .. " must be refused, got " .. tostring(ok)) +end +assert(driver_command("init") == true and driver_command("deinit") == true, + "host lifecycle steps write nothing and succeed") +driver_default_mode() +for _, call in ipairs(host._calls) do + assert(call.func ~= "http_post" and call.func ~= "http_patch" + and call.func ~= "http_request", + "a read-only driver wrote: " .. call.func) +end +local warnings = 0 +for _, line in ipairs(host._logs) do + if line:find("read-only, refused", 1, true) then warnings = warnings + 1 end +end +assert(warnings == 1, "one refusal warning per run, got " .. warnings) + print("tesla_wall_connector: all cases pass") diff --git a/drivers/tests/test_ev_read_only_reason.py b/drivers/tests/test_ev_read_only_reason.py new file mode 100644 index 00000000..8b167f53 --- /dev/null +++ b/drivers/tests/test_ev_read_only_reason.py @@ -0,0 +1,47 @@ +"""Read-only EV and vehicle drivers say plainly why FTW cannot control them. + +People read the catalog and expect a listed device to be controllable. A +driver that can command its device ships with control on; one that cannot +says so in its DRIVER description and in its manifest notes, in words a +novice understands, and says where control goes instead. + +`vag_vehicle` belongs here too. Its wording waits for the open PR on that +driver (#213), which has right of way. +""" +import re + +import pytest + +from conftest import read_driver, read_manifest + +# Driver id -> why FTW cannot control the device through it. +READ_ONLY_REASONS = { + "tesla_wall_connector": "Tesla offers no way for another system to set its current", + "teslamate_vehicle": "TeslaMate only logs", + "home_assistant_vehicle": "only listens", + "tesla_cloud": "this driver cannot sign", +} + + +def driver_field(source, field): + match = re.search(rf'^\s*{field}\s*=\s*(.+?),?\s*$', source, re.M) + assert match, f"DRIVER has no {field}" + return match.group(1) + + +@pytest.mark.parametrize("driver_id", sorted(READ_ONLY_REASONS)) +def test_read_only_driver_says_why(driver_id): + source = read_driver(driver_id) + assert driver_field(source, "read_only") == "true" + description = driver_field(source, "description").strip('"') + reason = READ_ONLY_REASONS[driver_id] + assert reason in description, description + assert re.search(r"\b(cannot|not control)\b", description), description + # Where control goes instead. + assert re.search(r"charger (FTW|it) can control", description), description + + manifest = read_manifest(driver_id) + assert re.search(r"^control:\s*false\s*$", manifest, re.M) + notes = re.search(r'^\s*notes:\s*"(.*)"\s*$', manifest, re.M).group(1) + assert notes.startswith("Read-only."), notes + assert "FTW cannot control" in notes, notes diff --git a/index.yaml b/index.yaml index 2d2f3ede..737a1eea 100644 --- a/index.yaml +++ b/index.yaml @@ -183,15 +183,6 @@ drivers: control: false size_bytes: 23467 sha256: "5fdc1acd72f881ff02696e765df0528a68f300fa9ca557a4fba068874f0129df" - - name: "easee" - version: "1.0.4" - tier: community - protocol: modbus - connectivity: local - ders: [v2x_charger] - control: false - size_bytes: 4054 - sha256: "4a2cd1efb4a5583468ce897ebd88a000e348917295c40210e86ecf834c0ba543" - name: "easee_cloud" version: "1.4.1" tier: core @@ -350,15 +341,15 @@ drivers: size_bytes: 1362 sha256: "4f273fa6aaff3bb462c3ac141f1773a2b6985421633d002578ce647726aa0ba9" - name: "home_assistant_vehicle" - version: "0.1.0" + version: "0.1.1" tier: community protocol: mqtt connectivity: local setup: [bridge] ders: [vehicle] control: false - size_bytes: 12635 - sha256: "a61c473a0f984f0cc8229e15472222e1c135b39c38ab2d2630b173afa8b7ca25" + size_bytes: 13488 + sha256: "5916c510d6d646a34516d7a887dab4518ba7587be160e16c788a6081e0334eab" - name: "huawei" version: "2.1.3" tier: core @@ -728,15 +719,15 @@ drivers: size_bytes: 56325 sha256: "b89fd9cd70ea67be3c7f0089a3c6d5552d8bbc994e39b8720dbd8d4d9892261b" - name: "tesla_cloud" - version: "0.2.0" + version: "0.2.1" tier: community protocol: http connectivity: cloud setup: [vendor_portal] ders: [vehicle] control: false - size_bytes: 22431 - sha256: "deab2cc377cdae9bbc32a14e686b05830b1e094154a090a401d60f666646653e" + size_bytes: 23174 + sha256: "37864e9194a05607ca193c2f50202e3da801a446ff93597fc92a1a1260132449" - name: "tesla_vehicle" version: "0.2.6" tier: core @@ -748,24 +739,24 @@ drivers: size_bytes: 10096 sha256: "d1b8a2cbea20630dcab3cb306df0f6924b0f9ad7f31bcf367fb1d41ca7833350" - name: "tesla_wall_connector" - version: "0.1.2" + version: "0.2.0" tier: community protocol: http connectivity: local ders: [ev] control: false - size_bytes: 8786 - sha256: "c365aad2a1216fad870b7dadb32e87feed75627714eeb8160f22cec4db651a80" + size_bytes: 9242 + sha256: "eccb983120f597a8256b5dacdd20ca456f3152dba571f45c2bff942cfc052d02" - name: "teslamate_vehicle" - version: "0.2.0" + version: "0.2.1" tier: community protocol: mqtt connectivity: local setup: [bridge] ders: [vehicle] control: false - size_bytes: 18280 - sha256: "b9f50760f46ab5e5f41f7a552136a77b44ba0d5fa3a85a2d6976f60a9d1e3679" + size_bytes: 18520 + sha256: "28ad494dbebea9a02e11bc5d2c028cbfeb4b81e7cc13c8777c1b57baf8f0359e" - name: "tibber" version: "1.1.2" tier: core @@ -831,15 +822,6 @@ drivers: control: false size_bytes: 30379 sha256: "b11198e45d761599939b8201c0969514bbbbc6c2571dcf56d12959cf9ade2b5d" - - name: "zaptec" - version: "1.0.1" - tier: community - protocol: http - connectivity: local - ders: [v2x_charger] - control: false - size_bytes: 2281 - sha256: "78d66d1af8f8169a7fa3adaa914f27475907930dc733ea58757d7b394e5a9802" - name: "zaptec_cloud" version: "0.2.0" tier: community diff --git a/manifests/easee.yaml b/manifests/easee.yaml deleted file mode 100644 index d6ba07c1..00000000 --- a/manifests/easee.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: "easee" -version: "1.0.4" -tier: community -author: "Sourceful Labs AB" -protocol: modbus -connectivity: local -ders: [v2x_charger] -control: false -tested_devices: - - manufacturer: "Easee" - model_family: "Easee" - variants: [Easee Home, Easee Charge] - regions: [] - firmware_versions: "" - notes: "Community driver, may require specific firmware for Modbus TCP" - min_driver_version: "1.0.0" -min_host_version: "2.0.0" -size_bytes: 4054 -dkb_id: "" -sha256: "4a2cd1efb4a5583468ce897ebd88a000e348917295c40210e86ecf834c0ba543" -signature: "" - -bytecode_sha256: "" -bytecode_signature: "" -bytecode_size: 0 -changelog: "" diff --git a/manifests/home_assistant_vehicle.yaml b/manifests/home_assistant_vehicle.yaml index b8f185d4..c5cd9770 100644 --- a/manifests/home_assistant_vehicle.yaml +++ b/manifests/home_assistant_vehicle.yaml @@ -1,5 +1,5 @@ name: "home_assistant_vehicle" -version: "0.1.0" +version: "0.1.1" tier: community author: "Sourceful Labs AB" protocol: mqtt @@ -13,12 +13,12 @@ tested_devices: variants: [Model Y] regions: [] firmware_versions: "" - notes: "Read-only vehicle level, charge limit, charging state, charge cable and place from a JSON message a Home Assistant automation publishes. Tested with recorded messages from a Model Y on the Tesla Custom Integration; the cable and place fields have not run on a car. Does not wake or command the car." + notes: "Read-only. FTW reads the car's charge level, charge limit, charging state, charge cable and place from a message a Home Assistant automation publishes over MQTT. FTW cannot control the car through it: the driver only listens and sends nothing back to Home Assistant. Control the charge with a charger FTW can control. Tested with recorded messages from a Model Y on the Tesla Custom Integration; the cable and place fields have not run on a car. Does not wake the car." min_driver_version: "0.1.0" min_host_version: "2.0.0" -size_bytes: 12635 +size_bytes: 13488 dkb_id: "home_assistant_vehicle" -sha256: "a61c473a0f984f0cc8229e15472222e1c135b39c38ab2d2630b173afa8b7ca25" +sha256: "5916c510d6d646a34516d7a887dab4518ba7587be160e16c788a6081e0334eab" signature: "" bytecode_sha256: "" diff --git a/manifests/tesla_cloud.yaml b/manifests/tesla_cloud.yaml index 1882f956..b7808a75 100644 --- a/manifests/tesla_cloud.yaml +++ b/manifests/tesla_cloud.yaml @@ -1,5 +1,5 @@ name: "tesla_cloud" -version: "0.2.0" +version: "0.2.1" tier: community author: "Sourceful Labs AB" protocol: http @@ -13,12 +13,12 @@ tested_devices: variants: [Model Y, Model 3] regions: [EU, NA, CN] firmware_versions: "" - notes: "Read-only vehicle SoC, charge limit, charging state and charge cable via the official Tesla Fleet API. Grant the optional vehicle_location scope to report the car's distance from the site; the coordinates stay in the driver. Optional next to tesla_vehicle (BLE proxy). Does not wake or command the car. Not yet run against a car." + notes: "Read-only. FTW reads the car's charge level, charge limit, charging state and charge cable from the official Tesla Fleet API. FTW cannot control the car through it: Tesla accepts a command only when it is signed with a key paired to the car, and this driver cannot sign. Use tesla_vehicle (BLE proxy) to start the car's charge, or a charger FTW can control. Grant the optional vehicle_location scope to report the car's distance from the site; the coordinates stay in the driver. Does not wake the car. Not yet run against a car." min_driver_version: "0.1.0" min_host_version: "2.0.0" -size_bytes: 22431 +size_bytes: 23174 dkb_id: "tesla_cloud" -sha256: "deab2cc377cdae9bbc32a14e686b05830b1e094154a090a401d60f666646653e" +sha256: "37864e9194a05607ca193c2f50202e3da801a446ff93597fc92a1a1260132449" signature: "" bytecode_sha256: "" diff --git a/manifests/tesla_wall_connector.yaml b/manifests/tesla_wall_connector.yaml index a2870a1f..e97063f1 100644 --- a/manifests/tesla_wall_connector.yaml +++ b/manifests/tesla_wall_connector.yaml @@ -1,5 +1,5 @@ name: "tesla_wall_connector" -version: "0.1.2" +version: "0.2.0" tier: community author: "Sourceful Labs AB" protocol: http @@ -12,12 +12,17 @@ tested_devices: variants: [Wall Connector Gen 3] regions: [] firmware_versions: "" - notes: "Tesla Wall Connector Gen 3 on the LAN. Observation only; no local current setpoint." + notes: "Read-only. FTW reads power, current and session energy from the charger on your network, with no cloud account. FTW cannot control it: Tesla offers no way for another system to set its current or start and stop it. Its own current control is an installer setting fed by a Tesla energy meter. Control goes through the car (tesla_vehicle) or a charger FTW can control, such as one on OCPP." min_driver_version: "0.1.0" +upstream_docs: + - url: "https://energylibrary.tesla.com/docs/Public/Charging/WallConnector/ApplicationNote/DynamicPowerManagement/EMEA/en-GB/smart_current_limits_en-GB.pdf" + title: "Wall Connector Application Note: Dynamic Power Management (current limits come from a Tesla energy meter, not a network API)" + kind: manual + url_stability: stable min_host_version: "2.0.0" -size_bytes: 8786 +size_bytes: 9242 dkb_id: "tesla_wall_connector" -sha256: "c365aad2a1216fad870b7dadb32e87feed75627714eeb8160f22cec4db651a80" +sha256: "eccb983120f597a8256b5dacdd20ca456f3152dba571f45c2bff942cfc052d02" signature: "" bytecode_sha256: "" diff --git a/manifests/teslamate_vehicle.yaml b/manifests/teslamate_vehicle.yaml index 547a85d6..85886c25 100644 --- a/manifests/teslamate_vehicle.yaml +++ b/manifests/teslamate_vehicle.yaml @@ -1,5 +1,5 @@ name: "teslamate_vehicle" -version: "0.2.0" +version: "0.2.1" tier: community author: "Sourceful Labs AB" protocol: mqtt @@ -13,7 +13,7 @@ tested_devices: variants: [Model Y, Model 3] regions: [] firmware_versions: "" - notes: "Read-only vehicle SoC, charge limit, charging state, charge cable and place via TeslaMate MQTT. Set geofence to this site's TeslaMate geofence for the place. Optional next to tesla_vehicle (BLE proxy). Does not wake or command the car. Not yet run against a car." + notes: "Read-only. FTW reads the car's charge level, charge limit, charging state, charge cable and place from TeslaMate over MQTT. FTW cannot control the car through it: TeslaMate only logs data and takes no commands. Use tesla_vehicle (BLE proxy) to start the car's charge, or a charger FTW can control. Set geofence to this site's TeslaMate geofence for the place. Does not wake the car. Not yet run against a car." min_driver_version: "0.1.0" upstream_docs: - url: "https://docs.teslamate.org/docs/integrations/mqtt" @@ -21,9 +21,9 @@ upstream_docs: kind: api_docs url_stability: stable min_host_version: "2.0.0" -size_bytes: 18280 +size_bytes: 18520 dkb_id: "teslamate_vehicle" -sha256: "b9f50760f46ab5e5f41f7a552136a77b44ba0d5fa3a85a2d6976f60a9d1e3679" +sha256: "28ad494dbebea9a02e11bc5d2c028cbfeb4b81e7cc13c8777c1b57baf8f0359e" signature: "" bytecode_sha256: "" diff --git a/manifests/zaptec.yaml b/manifests/zaptec.yaml deleted file mode 100644 index f0d57f60..00000000 --- a/manifests/zaptec.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: "zaptec" -version: "1.0.1" -tier: community -author: "Sourceful Labs AB" -protocol: http -connectivity: local -ders: [v2x_charger] -control: false -tested_devices: - - manufacturer: "Zaptec" - model_family: "Zaptec" - variants: [Zaptec GO, Zaptec PRO] - regions: [] - firmware_versions: "" - notes: "Community driver, untested" - min_driver_version: "1.0.0" -min_host_version: "2.1.0" -size_bytes: 2281 -dkb_id: "" -sha256: "78d66d1af8f8169a7fa3adaa914f27475907930dc733ea58757d7b394e5a9802" -signature: "" - -bytecode_sha256: "" -bytecode_signature: "" -bytecode_size: 0 -changelog: "" diff --git a/support-status.json b/support-status.json index ff3e555d..5ea693bb 100644 --- a/support-status.json +++ b/support-status.json @@ -420,27 +420,6 @@ } } }, - { - "catalog_source": true, - "catalog_version": "1.0.4", - "driver_id": "easee", - "targets": { - "blixt-l1": { - "hil": "not_recorded", - "historical_signed_beta_version": null, - "legacy_parity": "not_assessed", - "note": "", - "target_conformance": "not_assessed" - }, - "ftw-core": { - "hil": "not_recorded", - "historical_signed_beta_version": null, - "legacy_parity": "not_assessed", - "note": "", - "target_conformance": "not_assessed" - } - } - }, { "catalog_source": true, "catalog_version": "1.4.1", @@ -800,7 +779,7 @@ }, { "catalog_source": true, - "catalog_version": "0.1.0", + "catalog_version": "0.1.1", "driver_id": "home_assistant_vehicle", "targets": { "blixt-l1": { @@ -1661,7 +1640,7 @@ }, { "catalog_source": true, - "catalog_version": "0.2.0", + "catalog_version": "0.2.1", "driver_id": "tesla_cloud", "targets": { "blixt-l1": { @@ -1703,7 +1682,7 @@ }, { "catalog_source": true, - "catalog_version": "0.1.2", + "catalog_version": "0.2.0", "driver_id": "tesla_wall_connector", "targets": { "blixt-l1": { @@ -1724,7 +1703,7 @@ }, { "catalog_source": true, - "catalog_version": "0.2.0", + "catalog_version": "0.2.1", "driver_id": "teslamate_vehicle", "targets": { "blixt-l1": { @@ -1890,27 +1869,6 @@ } } }, - { - "catalog_source": true, - "catalog_version": "1.0.1", - "driver_id": "zaptec", - "targets": { - "blixt-l1": { - "hil": "not_recorded", - "historical_signed_beta_version": null, - "legacy_parity": "not_assessed", - "note": "", - "target_conformance": "not_assessed" - }, - "ftw-core": { - "hil": "not_recorded", - "historical_signed_beta_version": null, - "legacy_parity": "not_assessed", - "note": "", - "target_conformance": "not_assessed" - } - } - }, { "catalog_source": true, "catalog_version": "0.2.0",