Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Lua Code for Thermostat Mode


Question

Posted

i tried to execute belowcode but it shows Temperature below cut-off for 1 minute but thermostat mode is not Cool. No action taken but in actual thermostat is in cool mode

i think  local mode = hub.getValue(sID, "ThermostatMode") is wrong.
can you help to find correct code ?pls

local function handleCutOff()
    local mode = hub.getValue(sID, "ThermostatMode")
    if mode == "Cool" then
        print("Temperature below cut-off for 1 minute and thermostat mode is Cool. Turning off All Compressors.")
        local success, err = pcall(function()
            hub.call(sID, 'setThermostatMode', "Off")
        end)
        if not success then
            print("Error turning off All Compressors: " .. (err or "unknown error"))
        end
    else
        print("Temperature below cut-off for 1 minute but thermostat mode is not Cool. No action taken.")
    end
end

 

Recommended Posts

  • 0
  • Inquirer
  • Posted

    for fanmode
    test2: Medium

    for

    test = api.get("/devices/149").interfaces or {}
     

    test: ["climatePanelExtension","coolingThermostatSetpoint","fibaroFirmwareUpdate","heatingThermostatSetpoint","thermostatFanMode","thermostatFanState","thermostatMode","thermostatOperatingState","zwave","zwaveIndicator","zwaveMultiChannelAssociation"]

    • 0
    Posted
    3 minutes ago, Nadeem said:

    for fanmode
    test2: Medium

    for

    test = api.get("/devices/149").interfaces or {}
     

    test: ["climatePanelExtension","coolingThermostatSetpoint","fibaroFirmwareUpdate","heatingThermostatSetpoint","thermostatFanMode","thermostatFanState","thermostatMode","thermostatOperatingState","zwave","zwaveIndicator","zwaveMultiChannelAssociation"]

     

    What response does this get then?

     

        local test = hub.getValue(162, "thermostatOperatingState")
      print("Test4: ",test)

     

     

    • 0
  • Inquirer
  • Posted

    it says Test4: Cooling

    but Cooling Valve is off right now 

    • 0
    Posted
    6 hours ago, Nadeem said:

    it says Test4: Cooling

    but Cooling Valve is off right now 


    seems like we cant get the relay state then 🤔

    Please login or register to see this attachment.


    I cant see any other that should indicate it 🤔 

    The relay aint got powermeasure?  🤔  
    So you can see if it got consumption or not? 

    • 0
  • Inquirer
  • Posted

    yeah it seems like and there is no power measure in this switch.

     

    • 0
    Posted (edited)
    2 hours ago, Nadeem said:

    yeah it seems like and there is no power measure in this switch.

     

     

     

    are you sure this dosent give you the value idle or cooling or heating? 
    for me on a heat it trm6 it does give the state of the relay 🤔 (or atleast last raported state*)

     

     

      hub.call(162, "ReadConfiguration")   ----force a reading from the device
      test = hub.getValue(162, "thermostatOperatingState")
      print("Test4: ",test)

     

     

    Edited by Brors94
    read config*
    • 0
  • Inquirer
  • Posted

    yes its reflecting like idle cooling or heating but my concern was even though it shows in cooling but cooling valve is off already... this thermostatOperatingState  determines only state of thermostat mode only relay status of cooling valve.

     

    4 hours ago, Brors94 said:

     

     

    are you sure this dosent give you the value idle or cooling or heating? 
    for me on a heat it trm6 it does give the state of the relay 🤔 (or atleast last raported state*)

     

     

      hub.call(162, "ReadConfiguration")   ----force a reading from the device
      test = hub.getValue(162, "thermostatOperatingState")
      print("Test4: ",test)

     

     

    Test4: Idle 

     

     

    • Like 1

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...