[VeSync] Outlet swaps power/energy units
## Expected Behavior
The `power` channel should report power (W) and the `energy` channel should report energy (Wh/kWh), matching the channel semantics.
## Current Behavior
For VeSync outlets the units are swapped: the `energy` channel is published in W and the `power` channel in kWh. Items linked to those channels with the matching dimension (`Number:Power` for power, `Number:Energy` for energy) reject the updates:
Failed to update item 'OutletWaschmaschineEnergy' because '10.52311611175537 W' could not be converted to the item unit 'kWh'
Failed to update item 'OutletWaschmaschinePower' because '1.42857861518859 kWh' could not be converted to the item unit 'W'
Source (current `main`, `VeSyncDeviceOutletHandler.java`):
```java
updateState(DEVICE_CHANNEL_ENERGY, new QuantityType<>(outletStatus.outletResult.result.energy, Units.WATT));
updateState(DEVICE_CHANNEL_POWER,
new QuantityType<>(outletStatus.outletResult.result.power, MetricPrefix.KILO(Units.WATT_HOUR)));
```
`DEVICE_CHANNEL_ENERGY` is sent with `Units.WATT` (W) and `DEVICE_CHANNEL_POWER` with `MetricPrefix.KILO(Units.WATT_HOUR)` (kWh). The units are inverted relative to the channel names.
## Steps to Reproduce (for Bugs)
1. Configure a VeSync outlet .
2. Link its `power` channel to a `Number:Power` item and its `energy` channel to a `Number:Energy` item:
```
Number:Energy OutletWaschmaschineEnergy "Waschmaschine Energy Today [%.2f %unit%]" { channel="vesync:outlet:vesyncServers:outletWaschmaschine:energy" }
Number:Power OutletWaschmaschinePower "Waschmaschine Power [%.0f %unit%]" { channel="vesync:outlet:vesyncServers:outletWaschmaschine:power" }
```
3. Wait for the poll interval. The log fills with unit-conversion warnings as shown above; the items never update.
## Context
Trying to read live power (W) and accumulated energy (kWh) from a VeSync smart outlet. Because of the swapped units the linked `Number:Power`/`Number:Energy` items reject every update, so no data is stored or shown in the UI.
## Your Environment
- Version used: openHAB 5.2.0 (Release Build), binding `org.openhab.binding.vesync` 5.2.0
- Environment: Temurin 21
- Operating System: Linux openHABian (trixie 13.6)
0 条评论