jbasen / Crestron-Shelly

26 stars 1 forks source link

V21 - i4 contact input issue #31

Closed trentyounggit closed 1 year ago

trentyounggit commented 1 year ago

Hi Jay Did the v21 bug fix for contact input apply to the i4? I seem to have the same problem with an i4 on system reboot.

jbasen commented 1 year ago

Lets just say it should have and the code on my laptop does include the same code change that I included in the updated relay module. However, to validate all this lets make sure that the code you've downloaded for the i3-i4 includes the fix. Do you have the Shelly i3-i4 v3.usp module?

And, does the code for the initialize event look like this?

THREADSAFE PUSH Initialize { Trace("Shelly i3 - EventHandler - Initialize\n"); If(Startup_Lock = 1) { //Initialize Inputs myShelly.Get_Input_State(Device_IP, Device_Gen, Input_Count, Channel_0_Value, Channel_1_Value, Channel_2_Value, Channel_3_Value); Trace("Shelly i3 - EventHandler - Initialize - Channel_0_Value = %d\n", Channel_0_Value); Trace("Shelly i3 - EventHandler - Initialize - Channel_1_Value = %d\n", Channel_1_Value); Trace("Shelly i3 - EventHandler - Initialize - Channel_2_Value = %d\n", Channel_2_Value); Trace("Shelly i3 - EventHandler - Initialize - Input_3_Value = %d\n", Channel_3_Value); if (Channel_0_Value = 0) { Pulse(10, Channel_0_Turned_Off_FB); } else { Pulse(10, Channel_0_Turned_On_FB); }

    if (Channel_1_Value = 0)
    {
        Pulse(10, Channel_1_Turned_Off_FB);
    }
    else
    {
        Pulse(10, Channel_1_Turned_On_FB);
    }

    if (Channel_2_Value = 0)
    {
        Pulse(10, Channel_2_Turned_Off_FB);
    }
    else
    {
        Pulse(10, Channel_2_Turned_On_FB);
    }

    if (Channel_3_Value = 0)
    {
        Pulse(10, Channel_3_Turned_Off_FB);
    }
    else
    {
        Pulse(10, Channel_3_Turned_On_FB);
    }

    Startup_Lock = 2;
}

}

Thanks

trentyounggit commented 1 year ago

Thanks Jay All resolved I discovered the zip of v21 that I had downloaded previously had i3-4v2 in it, but on redownloading v21 now, it has a v3. v3 has the new code, and resolved the issues. Thanks again

jbasen commented 1 year ago

No problem. This makes sense. I believe I had sent you a special, early v21 test version after I fixed the relay module. When you validated that fixed the problem I worked my way through the other modules that had the same issue and then posted that on GitHub. You kept using the test version that only had the fix for the relay module.

Thanks