yes, I know I can do this. My question was: is it possible to create one DDF that, based on the type or the value (255), only exposes tilt if it’s supported in the setup. Or whats the idea how an API Consumer (like the Home Assistant Integration) can find out if a specific device can tilt or not?
DDF is based on the device, and if I m right this device can use different blind, so different configuration ?
if I m right Home assistant ignore a field if the value is null ? What is the maximum value for lift 255 or 254 ? Can use a null value if the value is 255, but not sure it will work.
I don’t see how to make a field visible or no on the same DDF. Some bulbs have a special field to say wich one feature are available or not, “cap/color/capabilities” for exemple.
It’s possible to make many DDF, with a check to select wich one to use, but from my memory not possible to use an attribute value to select the DDF (because the attribute is asked after the DDF is selected)
If it work, you will probably need to remove and re-add the device to HA, the plugin make his “magic” when it detect the device, so if the field is created, it’s probably too late.
07:17:31:705 JS failed to set Item.val for state/tilt
07:17:31:706 failed to evaluate expression for 00:1f:ee:00:00:00:64:ce-01/state/tilt: if (Attr.val <= 100) { Item.val = Attr.val; } else { Item.val = null; }, err: TypeError: failed to set Item.val
07:17:33:023 JS failed to set Item.val for state/tilt
07:17:33:025 failed to evaluate expression for 00:1f:ee:00:00:00:5a:d1-01/state/tilt: if (Attr.val <= 100) { Item.val = Attr.val; } else { Item.val = null; }, err: TypeError: failed to set Item.val
06:51:53:478 JS failed to set Item.val for state/tilt
06:51:53:480 failed to evaluate expression for 00:1f:ee:00:00:00:51:4a-01/state/tilt: if (Attr.val <= 100) { Item.val = Attr.val; } else { Item.val = undefined; }, err: TypeError: failed to set Item.val
Yeah, in fact there is a C++ engine that run the JS code, but it have probably limitations not present in pure JS.
It seem one time the variable is created, here as int, it’s no more possible to “put” inside other type, like a bool or null type.