deconz-rest-plugin: Syntax error in DDF for HUE lightsensor R.item('state/lux').val after 2.16.1 (also present on 2.18.1)

Describe the bug

All versions after 2.16.1 (including yesterdays 2.18.1) have the Philips HUE Motion-sensor light-sensor Item broken. None of dark/daylight/lux is longer updated. Enabling the DDF log and hitting cluster Read produces this:

image

Seems like a syntax error:

Item.val = v
R.item('state/dark').val = v <= tholddark
R.item('state/daylight').val = v > tholddark + tholdoffset
R.item('state/lux').val = Math.round(Math.pow(10, (Math.max(0, Math.min(v, 60001)) - 1) / 10000))
, err: SyntaxError: Syntax error

Steps to reproduce the behavior

This error has been persistent for me since 2.16.1

Expected behavior

No syntax error in code and the sensor to work.

Screenshots

See description above

Environment

image

  • Hostsystem: omr@shs2: uname -a Linux shs2 4.15.0-66-generic 75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux omr@shs2: cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 69 model name : Intel® Celeron® 2957U @ 1.40GHz stepping : 1 microcode : 0x26 cpu MHz : 1396.831 cache size : 2048 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer xsave rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust erms invpcid xsaveopt dtherm arat pln pts md_clear flush_l1d bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs bogomips : 2793.53 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management:

  • Running method: (Raspbian / Ubuntu / Home Assistent deCONZ Add-on / Marthoc Docker container / Windows / Virtual Machine) Happens both under systemctl and GUI

  • Firmware version: (26xxyy00) 26400500

  • deCONZ version: (2.xx.yy) 2.18.1 and all version after 2.16.1

  • Device: (ConBee I / ConBee II / RaspBee I / RaspBee II) ConBee I

  • Do you use an USB extension cable: (yes / no) – only relevant for ConBee I/II Yes, a powered USB HUB

  • Is there any other USB or serial devices connected to the host system? If so: Which? Yes, the HUB and a Z-Wave stick

deCONZ Logs

Item.val = v
R.item('state/dark').val = v <= tholddark
R.item('state/daylight').val = v > tholddark + tholdoffset
R.item('state/lux').val = Math.round(Math.pow(10, (Math.max(0, Math.min(v, 60001)) - 1) / 10000))
, err: SyntaxError: Syntax error

–>

Additional context

Network size is ~113 devices, most powered routers Mix of HUE, Ikea, Aqara, Lumi and Namron (Sunricher) Also mentioned here: https://forum.phoscon.de/t/philips-hue-outdoor-light-sensor-broken-since-2-17-0-still-a-problem-on-2-18-1-ddf-syntax-error/2429?u=omr

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28

Most upvoted comments

On Ubuntu 22.04.1 jammy everything works fine even with const (as expected):

omr@shs2:~$ apt show -a libqt5core5a
Package: libqt5core5a
Version: 5.15.3+dfsg-2ubuntu0.1
18:53:54:251 00:17:88:01:06:44:01:13-02-0400/state/lightlevel expression: /* global Attr, Item, R */

const v = Attr.val
const tholddark = R.item('config/tholddark').val
const tholdoffset = R.item('config/tholdoffset').val

Item.val = v
R.item('state/dark').val = v <= tholddark
R.item('state/daylight').val = v > tholddark + tholdoffset
R.item('state/lux').val = Math.round(Math.pow(10, (Math.max(0, Math.min(v, 60001)) - 1) / 10000))
 --> 889

But why does a downgrade to 2.16.1 make it work again?

Because that didn’t yet use a DDF for these sensors (or the DDF status was Draft).