rh1rich / esphome-ifan04

Sonoff IFAN04 with ESPHome
29 stars 10 forks source link

Default states do not seem to work? #6

Closed Linwood-F closed 3 months ago

Linwood-F commented 3 months ago

I've just set this up (modified slightly) on four fan controllers, and had the same buzzer issue mentioned elsewhere, but also am finding that the "RESTORE_DEFAULT_xxx" does not seem to be working properly elsewhere. I found it necessary to add

  on_boot:
    priority: 600
    then:
    - switch.turn_off: buzzer_enabled
    - output.turn_off: buzzer
    - switch.turn_on: light_enabled

The latter seemed to be needed sometimes not others - this morning two fans had light enabled, two did not, with it set to default on.

Setting these in the boot seems a complete fix, but I am unsure why the normal defaults are not working. I also didn't see a "discussion" place, so apologies for entering an issue if this is somehow expected behavior and I have screwed something up (mostly my modifications were to remove the i2c stuff and other items I did not need, or that duplicated stuff I have in a standard setup template -- which yes, could be a cause).

Is anyone else having trouble with light-enabled "sticking".

By the way, thank you for this template, it and the ifan04 solved a big problem at a new house wired without neutrals to switches and making it just generally difficult to deal with ceiling fans -- then I discovered all were AC and the ifan04 worked.

Linwood

PS. I don't see a version or anything to indicate but my issues were with code pulled about 5/11/2024 on an ifan04-L.

Linwood-F commented 3 months ago

I'm not sure my original conclusion is right. I did the set on-boot for light enabled, and found some of the devices in a day or so had it reset to not true, for no reason I could find. I ended up just removing the concept so the light was always enabled, but I do think there is something wrong in this area.