Open bluemoehre opened 1 week ago
Hey @bluemoehre, thanks for your pull request!
[!TIP] Modified bundles can be downloaded here.
eva/powermeter.json
: Meter Reader :heavy_check_mark:
legrand/Contactor.json
: Contactor :heavy_check_mark:
Jasco-GE/GE45856_wall_switch.json
: GE ZigBee in-wall smart switch (45856GE) :heavy_check_mark:
bosch/plug_compact.json
: Plug compact EU (BSP-FZ2) :heavy_check_mark:
develco/zhemi101_external_meter_interface.json
: Electricity meter interface (ZHEMI101) :heavy_check_mark:
legrand/cable_outlet.json
: Cable outlet 3000W (064879) :curly_loop: (unvalidated)
immax/07048L_smart_plug.json
: Neo smart plug (07048L) :heavy_check_mark:
lixee/zlinky_tic_historique_mono_base.json
: ZLinky_TIC mode historique base :heavy_check_mark:
lixee/zlinky_tic_historique_mono_hphc.json
: ZLinky_TIC mode historique HPHC :heavy_check_mark:
lixee/zlinky_tic_standard_mono_base.json
: ZLinky_TIC mode standard base :heavy_check_mark:
sengled/e1c-nb7.json
: Smart plug with power monitoring (E1C-NB7) :heavy_check_mark:
sonoff/ck-bl702-swp-01(7020)_plug.json
: Smart Plug (eWeLink) :heavy_check_mark:
third_reality/3RSP02028BZ_smart_plug.json
: Smart plug (3RSP02028BZ) :heavy_check_mark:
tuya/_TZE204_ac0fhfiq_energy_meter.json
: BiDirectional zigbee energy meter (TS0601) :heavy_check_mark:
adeo/ldsenk02f_plug.json
: Plug 16A :heavy_check_mark:
develco/emizb-141_electricity_meter_interface_2.json
: Electricity meter interface 2 EMIZB-141 :heavy_check_mark:
frient/emizb-141_electricity_meter_interface_2.json
: Electricity meter interface 2 EMIZB-141 :heavy_check_mark:
lixee/zlinky_tic_histo_tri_hphc.json
: ZLinky_TIC mode historique HPHC triphase :heavy_check_mark:
lixee/zlinky_tic_standard_tri_hphc.json
: ZLinky_TIC mode standard HPHC triphase :heavy_check_mark:
robb_smarrt/rob_200-017-0_plug.json
: Smart plug 3680W (ROB_200-017-0) :heavy_check_mark:
aubess/aubess_plug_TZ3000_hdopuwv6.json
: Smart plug 16A EU (TS011F) :heavy_check_mark:
heiman/smartplug.json
: Metering Plug (HS2SK) :heavy_check_mark:
innr/sp_120.json
: Smart plug (SP 120) :heavy_check_mark:
innr/sp_240.json
: Smart plug (SP 240) :heavy_check_mark:
innr/sp_234.json
: Smart plug (SP 234) :heavy_check_mark:
niko/170-33505_170-33605_smart_socket.json
: Smart socket (170-33505/170-33605) :heavy_check_mark:
sinope/sp2610zb_smart_switch.json
: Smart in-wall outlet US (SP2610ZB) :heavy_check_mark:
third_reality/3RSPE01044BZ_smart_plug.json
: Smart plug :heavy_check_mark:
tuya/_TZ3000_cehuw1lw_smartplug_EU.json
: Standard plug (TS011F) :heavy_check_mark:
wiser/fuga_socket_outlet.json
: LK Fuga Wiser wireless socket outlet 16A (545D6115) :heavy_check_mark:
wiser/smart-plug-single-16A.json
: Wiser smart plug 16A (CCT711119) :heavy_check_mark:
wiser/socket-outlet-double-16A-connected.json
: Elko smart socket double 16A plus PW (EKO09738) :heavy_check_mark:
xiaomi/xiaomi_dcm-k01_t2_dual_relay.json
: Aqara Dual Relay Module T2 (DCM-K01) :heavy_check_mark:
xiaomi/xiaomi_wp-p01d_h2_wall_outlet.json
: Aqara wall outlet H2 EU (WP-P01D) :heavy_check_mark:
blitzwolf/bw_shp13_smart_plug.json
: Electricity metering 16A EU plug (BW-SHP13) :heavy_check_mark:
blitzwolf/bw_shp15_smart_plug.json
: Power monitoring 16A 3680W EU plug (BW-SHP15) :heavy_check_mark:
develco/splzb-131_smart_plug.json
: Smart plug mini type F - Schuko (SPLZB-131) :heavy_check_mark:
frient/splzb-131_smart_plug.json
: Smart plug mini (SPLZB-131/SPLZB-134/SPLZB-141) :heavy_check_mark:
lidl/hg08673.json
: SilverCrest smart plug (HG08673) :heavy_check_mark:
neo/NAS-WR01B_TS011F.json
: Smart plug 16A with power monitoring EU (NAS-WR01B) :heavy_check_mark:
tuya/_TZ3000_TS011F_smart_plug.json
: Smart plug power monitor (TS011F) :heavy_check_mark:
tuya/_TZ3000_typdpbpg_smart_plug_eu.json
: Smart plug EU (TS011F) :heavy_check_mark:
tuya/_TZE200_byzdayie_din_enrgy_meter.json
: Single phase 65A DIN rail smart energy meter (TS0601) :heavy_check_mark:
tuya/nous_a1z_smart_plug.json
: Smart zigbee socket (A1Z) :heavy_check_mark:
xiaomi/xiaomi_zncz12lm_smart_plug.json
: Smart plug (ZNCZ12LM) :heavy_check_mark:
namron/4512737_thermostat.json
: Thermostat touch zigbee 16A (4512737/4512738) :heavy_check_mark:
xiaomi/xiaomi_sp-euc01_smart_plug.json
: Smart plug (SP-EUC01) :heavy_check_mark:
xiaomi/xiaomi_lumi.relay.c2acn01.json
: 2 way control module wireless relay :heavy_check_mark:
namron/5401395_heater.json
: Panel heater 1000W (5401395/5401399) :heavy_check_mark:
xiaomi/xiaomi_ws-euk04_h1_switch.json
: H1 dual rocker switch neutral wire (WS-EUK04) :heavy_check_mark:
xiaomi/xiaomi_zncz04lm_smart_plug.json
: Smart plug (ZNCZ04LM) :heavy_check_mark:
xiaomi/xiaomi_zncz04lm_smart_plug_v24.json
: Smart plug (ZNCZ04LM) :heavy_check_mark:
ubisys/s1_5501_s1r_5601.json
: Power switch (S1 (5501)/S1-R (5601)) :heavy_check_mark:
ubisys/s2_5502.json
: Power switch (S2 (5502)) :heavy_check_mark:
ubisys/s2r_5602.json
: Power switch (S2-R (5602)) :heavy_check_mark:
xiaomi/xiaomi_ws-euk03_h1_switch.json
: H1 single rocker switch neutral wire (WS-EUK03) :heavy_check_mark:
xiaomi/xiaomi_ssm-u01_t1_switch.json
: T1 single rocker switch with neutral wire (SSM-U01) :heavy_check_mark:
bosch/bmct-slz_shutter_light_control2.json
: Light and shutter control II (BMCT-SLZ) :heavy_check_mark:
ubisys/j1_5502.json
: Cover controller (J1 (5502)) :heavy_check_mark:
ubisys/j1r_5602.json
: Cover controller (J1-R (5602)) :heavy_check_mark:
icasa/ICZB-IW21D.json
: Zigbee Dimmer PRO :heavy_check_mark:
ouellet/OTH4000-ZB.json
: Smart thermostat (OTH4000-ZB) :heavy_check_mark:
sinope/th1124zb.json
: Smart thermostat for electric heating (TH1123ZB/TH1124ZB) :heavy_check_mark:
ubisys/d1_5503_d1r_5603.json
: Universal dimmer (D1 (5503)/D1-R (5603)) :heavy_check_mark:
[!TIP] Everything is fine !
:clock430: Updated for commit ffdb8f39abc7b05bc7a53eb3f1b6cfe3c2c7fc83
@ebaauw FYI
While this is technically correct, there's devices out there depending on this check to discard blips. Given the fact that this check doesn't hurt and there is a necessity, we should keep this untouched.
While this is technically correct, there's devices out there depending on this check to discard blips.
Do we know which ones?
Given the fact that this check doesn't hurt and there is a necessity, we should keep this untouched.
That's bad practice. Like @ebaauw asked me to change this (at least for the generic one), and I found the same "error" in other files, it may happen again that people reading the code want to fix that, because it looks like a bug. If only a few people have that hidden knowledge, it's a risk. \ I would recommend to make the generic one correct and then take care about the the blippy bloppy devices. We should also leave a comment in the code or add a test, so everyone can understand why it's like that and prevent accidentally breaking something.\ What do you think?
I'm afraid I cannot follow you to a certain extend. Where is the bad practice? We're discussing a valid boundaries check here being there for a reason. This is neither a bug (which is by definition a programatical misbehavior), nor an error (as nothing is working falsely) so there is nothing to fix in my view.
Leaving the code as is has 0 risk, changing the code as proposed introduces an unneccessary risk of breaking functionality of an unknown number of devices, hence I prefer avoiding that risk.
Regarding your suggesting to add a respective comment in the code, I'd fully buy in. ~Although this possibility is not given yet (I find the "description"
key not really suitable for this purpose and placement is restricted), we should introduce a "comment"
key to allow for some (important) documentation within a DDF at the place specifically required.~ "comment"
key is available and usable, however, not displayed in DDF editor.
It's technically not possible for an s16
to report a value >= 32768; it simply doesn't fit the 16 bits. Any device depending on this check would have to use a different data type. That alone is reason enough to override the default item definition in the device's DDF.
Where is the bad practice?
"Given the fact that this check doesn't hurt" [...] "we should keep this untouched"
It's bad practice to keep a workaround in a generic file just because it doesn't hurt. Especially if only a few devices are to be fixed with it. The generic files should kept clean all the time, since the amount of devices will continuously keep growing. (Imagine having in there all workarounds for all types of devices - that won't work out.)
Also we should not keep this untouched, since the workaround is not documented at all.
Undocumented workarounds will lead to copies pasted somewhere. If you need to clean this up in the future, it will take a lot of effort.
We're discussing a valid boundaries check
It is not, as @ebaauw already described. 1 Bit is used for the sign, 15 Bits remaining for the magnitude: 0111 1111 1111 1111 = 32,767
According to the specification the value always must also be an s16
: \
ZigBee Cluster Library
I checked all the devices that were changed by this PR and their commits to see if there was any information about special treatment required. If there really was a problem, it was unfortunately not documented. But you may check yourself:
That's all I can do at this point to convince everyone that we are doing the best possible here. \ Please let me know how we continue with this PR, because it's affecting the device request #7959.
Signed s16 integer supports values from
-32768
to32767
, soAttr.val != 32768
is superfluous. Typically the lowest value,-32768
is used to indicate an invalid value.