Giter Club home page Giter Club logo

aiobafi6's People

Contributors

bdraco avatar dependabot[bot] avatar jfroy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aiobafi6's Issues

Support light-only devices

Since I don't have a light-only device, I don't know which Capabilities field indicates the presence of a fan.

Soft White and Bright White Light?

Hi! Great work on this integration. I was wondering if you would consider adding some support for the Soft White and Bright White features on the Haiku H/I Series LED Light kit?

Wrote it up here https://community.home-assistant.io/t/big-ass-fan-light-soft-white-and-bright-white-support/577247, but wasn't sure you would see it there, and since you seem like the maintainer, wanted to see if you might wanna take this on?

I did

python3 -m venv hass73122
source ./hass73122/bin/activate
pip3 install aiobafi6
aiobafi6 --discover
# ^C when you have your fan's IP
aiobafi6 --direct --dump --ip <IP>

And found that Bright White does

+light_color_temperature: 4000

Whereas Soft White does

+light_color_temperature: 2700

I was thinking maybe a select entity in Home Assistant that would offer the two choices, since that seems to be the only choices right now? Thanks!

Bump/loosen protobuf ping

For the Home Assistant project, we are currently working towards Python 3.11 support; some of our key packages, therefore, need an upgrade, including protobuf.

Home Assistant depends on aiobafi6, which pins protobuf:

aiobafi6==0.7.2
  - protobuf [required: >=3.20,<3.21, installed: 3.20.1]
  - zeroconf [required: >=0.38, installed: 0.39.4]
    - async-timeout [required: >=4.0.1, installed: 4.0.2]
    - ifaddr [required: >=0.1.7, installed: 0.1.7]

Source:

protobuf = "~3.20"

However, we need to achieve protobuf>=4.21.3 @ the Home Assistant end. Could the dependency requirement on aiobafi6 be looser? Preferably, this package should pin it as, for example, protobuf>=3.20.0.

Occupancy doesn't work without ComfortME

The statement in

# a device that supports auto comfort is assumed to supports occupancy.

isn't a good assumption.

The new BAF chipset v4 (released second half of 2022) moves the temperature sensor to the bluetooth remote. However the bluetooth remote is optional and the old IR remotes work fine... and in several ways are more reliable.

This means it's quite possible to have a fan that has occupancy but doesn't have the temperature sensor to support ComfortME.

Test the new 3.1.0 firmware

BAF has released a new version of the app and firmware (version 3.1.0) with new features. Check compatibility with that firmware and implement new relevant features for the HASS integration.

Screenshot 2022-07-24 at 18 36 36

Screenshot 2022-07-24 at 18 37 12

Screenshot 2022-07-24 at 18 37 19

Screenshot 2022-07-24 at 18 37 24

Screenshot 2022-07-24 at 18 37 42

PB schema could use some improvement

This BAF integration might benefit from a few adjustments to the schema. Original reference post here. This one has a few extras b/c you are special. ๐Ÿ˜บ

message RemoteCommandData
{
    string address = 2;
}

message SystemAction
{
    enum Command
    {
        NoAction           = 0;
        Reboot             = 2;
        StartAudibleSignal = 4;
        StartVisibleSignal = 5;
        ForgetRemote       = 8;
        ResumeFanMode      = 11;
        ResumeLightMode    = 12;
    }

    Command command = 1;
    reserved 2;

    oneof field
    {
        RemoteCommandData       remoteData               = 3;
    }
}

enum Direction
{
    Forward = 0;
    Reverse = 1;
}

enum OperatingMode
{
    Off     = 0;
    On      = 1;
    Auto    = 2;
}

enum MultipleLightMode
{
    AllLights   = 0;
    Downlight   = 1;
    Uplight     = 2;
}

enum Day
{
    NoDay       = 0;
    Sunday      = 1;
    Monday      = 2;
    Tuesday     = 3;
    Wednesday   = 4;
    Thursday    = 5;
    Friday      = 6;
    Saturday    = 7;
}

enum RebootReason
{
    Unknown             = 0;
    Other               = 1;
    PowerOn             = 2;
    Software            = 3;
    IndependentWatchdog = 4;
    TaskWatchdog        = 5;
    BrownOut            = 6;
    LowPower            = 7;
    Lockup              = 8;
    Pin                 = 9;
}

message Network
{
    bytes ssid = 1;
}

enum AssistWith
{
    Nothing = 0;
    Heating = 1;
    Cooling = 2;
    All     = 3;
}

message WallControlConfiguration
{
    enum Function
    {
        NoFunction  = 0;
        LightLevel  = 1;
        LightColor  = 2;
        FanSpeed    = 3;
    }

    Function topButtonFunction    = 1;
    Function bottomButtonFunction = 2;
}

message DebugInfo
{
    uint32            uptimeMinutes         = 1;
    uint32            rebootCountTotal      = 2;
    uint32            rebootCountSincePor   = 3;
    RebootReason      lastRebootReason      = 4;
    uint32            lastRebootDetails     = 5;
    uint32            softwareError         = 6;
    uint32            softwareErrorDetails  = 7;
}

enum FirmwareType
{
    Host    = 0;
    Wifi    = 1;
    Light   = 2;
    Motor   = 3;
}

enum ExternalDeviceType
{
    BleRemote       = 0;
    BleWallControl  = 1;
    UnknownDevice   = 2;
}

message DetailedVersion
{
    FirmwareType type              = 1;
    string       appVersion        = 2;
    string       bootloaderVersion = 3;
}

message ExternalDeviceVersion
{
    ExternalDeviceType type               = 1;
    string             packageVersion     = 2;
    string             bootloaderVersion  = 3;
    string             macAddress         = 4;
    RebootReason       rebootReason       = 7;
}

message GroupContainer
{
    bytes  uuid = 2;
    string name = 3;
}

message StandbyLed
{
    enum ColorPreset
    {
        Custom  = 0;
        Red     = 1;
        Green   = 2;
        Blue    = 3;
        Teal    = 4;
        Yellow  = 5;
        Violet  = 6;
        White   = 7;
        Orange  = 8;
        Pink    = 9;
    }

    ColorPreset colorPreset     = 1;
    bool        enabled         = 2;
    uint32      percent         = 3;
    uint32      red             = 4;
    uint32      green           = 5;
    uint32      blue            = 6;
}

message DeviceCapabilities
{
    bool hasTempSensor       = 1;
    bool hasHumiditySensor   = 2;
    bool hasOccupancySensor  = 3;
    bool hasLight            = 4;
    bool hasLightSensor      = 5;
    bool hasColorTempControl = 6;
    bool hasFan              = 7;
    bool hasSpeaker          = 8;
    bool hasPiezo            = 9;
    bool hasLedIndicators    = 10;
    bool hasUplight          = 11;
    bool hasUvcLight         = 12;
    bool hasStandbyLed       = 13;
    bool hasEcoMode          = 14;
}

message Property
{
    oneof field
    {
        string          name              = 1;
        string          model             = 2;
        string          localTime         = 4;
        string          utcTime           = 5;
        string          timeZone          = 6;
        string          fwVersion         = 7;
        string          macAddress        = 8;
        string          cloudId           = 9;
        string          deviceId          = 10;
        string          cloudServerUrl    = 11;
        string          apiVersion        = 13;
        uint32          deviceTypeId      = 15;
        DetailedVersion detailedVersion   = 16;

        DeviceCapabilities    deviceCapabilities     = 17;

        string pcbaPartNumber   = 37;
        string pcbaRevision     = 38;

        OperatingMode   fanMode                         = 43;
        Direction       fanDirection                    = 44;
        uint32          fanPercent                      = 45;
        uint32          fanSpeed                        = 46;
        bool            comfortSenseEnabled             = 47;
        uint32          comfortSenseIdealTemp           = 48;
        uint32          comfortSenseMinSpeed            = 50;
        uint32          comfortSenseMaxSpeed            = 51;
        bool            fanOccupancyEnabled             = 52;
        uint32          fanOccupancyTimeout             = 53;
        bool            fanReturnToAutoEnabled          = 54;
        uint32          fanReturnToAutoTimeout          = 55;
        bool            whooshEnabled                   = 58;
        bool            comfortSenseHeatAssistEnabled   = 60;
        uint32          comfortSenseHeatAssistSpeed     = 61;
        Direction       comfortSenseHeatAssistDirection = 62;
        uint32          commandedRpm                    = 63;
        uint32          actualRpm                       = 64;
        bool            ecoModeEnabled                  = 65;
        bool            fanOccupied                     = 66;
        bool            fanOnMeansAuto                  = 67;

        OperatingMode       lightMode                     = 68;
        uint32              lightPercent                  = 69;
        uint32              lightLevel                    = 70;
        uint32              lightColorTemperature         = 71;
        bool                lightOccupancyEnabled         = 72;
        uint32              lightOccupancyTimeout         = 73;
        bool                lightReturnToAutoEnabled      = 74;
        uint32              lightReturnToAutoTimeout      = 75;
        bool                lightDimToWarmEnabled         = 77;
        uint32              lightColorTemperatureMin      = 78;
        uint32              lightColorTemperatureMax      = 79;
        MultipleLightMode   multipleLightMode             = 82;
        StandbyLed          standbyLed                    = 83;
        bool                lightOccupied                 = 85;

        uint32 temperature       = 86;
        uint32 humidity          = 87;

         uint32          fanTimerMinutes        = 95;
         int64           fanTimerUtcExpiration  = 96;
        
        bool   lightOnMeansAuto  = 109;

        bytes           ipAddress      = 120;
        Network         network        = 124;

        bool                     indicatorsEnabled       = 134;
        bool                     audibleIndicatorEnabled = 135;
        bool                     legacyIrEnabled         = 136;
        WallControlConfiguration wallControlConfiguration =
            139;

        AssistWith assistWith  = 140;

        bool                  remoteDiscoveryEnabled = 150;
        uint32                externalDeviceCount    = 151;
        ExternalDeviceVersion externalDeviceVersion  = 152;
        bool                  bleRemoteSupported  = 153;

        DebugInfo   debugInfo       = 156;

        GroupContainer groupContainer = 171;

        bool   uvcEnabled               = 172;
        uint32 uvcLife                  = 173;
    }
}

message ScheduleProperty
{
    oneof field
    {
        OperatingMode fanMode      = 1;
        Direction     fanDirection = 2;
        uint32        fanSpeed     = 4;
        uint32        fanPercent   = 3;

        OperatingMode     lightMode             = 5;
        uint32            lightLevel            = 7;
        uint32            lightColorTemperature = 8;
        uint32            lightPercent          = 6;
        uint32            uplightPercent        = 9;
        MultipleLightMode multipleLightMode     = 10;

        bool   comfortSenseEnabled   = 11;
        uint32 comfortSenseIdealTemp = 12;
        uint32 comfortSenseMinSpeed  = 13;
        uint32 comfortSenseMaxSpeed  = 14;
        bool   fanOccupancyEnabled   = 15;
        uint32 fanOccupancyTimeout   = 16;
        bool   lightOccupancyEnabled = 17;
        uint32 lightOccupancyTimeout = 18;
    }
}

message ScheduleJob
{
    enum Action
    {
        NoAction    = 0;
        Update      = 1;
        Remove      = 2;
        Read        = 3;
    }

    message Schedule
    {
        message ScheduleEvent
        {
            string                    time       = 1;
            repeated ScheduleProperty properties = 2;
        }

        uint32         id           = 1;
        string         name         = 2;
        repeated bytes devices      = 3;
        repeated Day   days         = 4;
        bool           isEnabled    = 6;
        ScheduleEvent  startEvent   = 7;
        ScheduleEvent  endEvent     = 8;
    }

    Action   action         = 1;
    Schedule schedule       = 2;
    uint32   schedulesCount = 3;
    uint32   schedulesMax   = 4;
}
message Job
{
    SystemAction systemAction                       = 2;
    repeated Property commands                      = 3;
    repeated ScheduleJob scheduleJob                = 4;
}

message Update
{
    repeated Property properties         = 2;
    ScheduleJob scheduleJob              = 3;
}

message Query
{
    enum Type
    {
        All             = 0;
        Fan             = 1;
        Light           = 2;
        Device          = 3;
        Network         = 4;
        Schedules       = 5;
        Sensor          = 6;
    }

    Type type = 1;
}

message ApiMessage
{
    oneof  payload
    {
        Job    job    = 2;
        Query  query  = 3;
        Update update = 4;
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.