Turns out that z2m has some custom logic to handle the turn off with transition so it stores the last known brightness and transitions back to that value when turning back on. We can easily bypass this extra logic that ends up transforming a regular ON command into a moveToLevelWithOnOff
by patching the converter. I am not totally confident in the solution yet but so far it’s behaving the way I expect it to.
Edit \zigbee2mqtt\node_modules\zigbee-herdsman-converters\devices\inovelli.js
at around line 992:
if (state === 'on' &&
globalStore.getValue(entity, 'turnedOffWithTransition') === true
) {
/**
* In case the bulb it turned OFF with a transition and turned ON WITHOUT
* a transition, the brightness is not recovered as it turns on with brightness 1.
* https://github.com/Koenkk/../issues/1073
*/
Change state === 'on'
to state === 'ignore'
so it completely skips that section and always falls back to the inovelliOnOffConvertSet
logic.
This fix cannot be committed to the repo as is yet and thus must be performed (and updated manually again on updates).
Hope this helps.