Add missing off_wait_time
to light_onoff_brightness
converter
#8175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I successfully used the
onWithTimedOff
command for relays and smart plugs in my automations. For some devices, it's enough only to provide anon_time
value in the payload, but for some devices (such as the Sonoff ZBMINI, see note here), it's also required to provide anoff_wait_time
value. In Koenkk/zigbee2mqtt.io#2392, a documentation section was added for all devices supportingon_time
about the "on with timed off" feature, in which it is mentioned that the device may require to also provide anoff_wait_time
value. This documentation section is also shown for lights (example), so as a user, I would expect it to work.on_time
works¹ for lights (I tried some IKEA LEDxxxxGx lights), but I noticed thatoff_wait_time
produces the following error:¹ "works" in the sense that it doesn't produce an error in Z2M. However, for some models, it actually works, but for some, it doesn't, that's why I started experimenting with
off_wait_time
.In this PR, I added the
off_wait_time
key to thelight_onoff_brightness
converter. As far as I understand the code, this works when abrightness
value is not provided, andlight_onoff_brightness
delegates toon_off
, according to this part of the code:zigbee-herdsman-converters/src/converters/toZigbee.ts
Lines 1152 to 1154 in 7e8a807
Some history:
on_time
was added to the same line of code in ef35333 by @Koenkk after @sjorge reported Koenkk/zigbee2mqtt#12276