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


Question

Posted (edited)

Hello friends
I have a thermostat mco and I want to use the heating parameter as a condition in a  scene lua, which means that when the thermostat is work in the heating mode
can turn on single channel module
how to writes this condition in the scene
please help me.

Please login or register to see this attachment.

Edited by mostafa251370

15 answers to this question

Recommended Posts

  • 0
Posted (edited)

Looks OK... may be it doesn't work because  of string/number mismatch

I suggest to use as follow

myVariable=tonumber(fibaro:getValue(112,"value"))

if myVariable == 1 then

 fibaro:call(75,"turnOn")

end

 

or shorter version, w/o using any variable

if tonumber(fibaro:getValue(112,"value")) == 1 then fibaro:call(75,"turnOn") end

 

By the what happens if device 112 is zero. Should you turn device 75 off?

Edited by cag014
  • 0
  • Inquirer
  • Posted
    20 hours ago, mostafa251370 said:

    Hello friends
    I have a thermostat mco and I want to use the heating parameter as a condition in a  scene lua, which means that when the thermostat is work in the heating mode
    can turn on single channel module
    how to writes this condition in the scene
    please help me.

    Please login or register to see this attachment.

     

    20 hours ago, mostafa251370 said:

    Hello friends
    I have a thermostat mco and I want to use the heating parameter as a condition in a  scene lua, which means that when the thermostat is work in the heating mode
    can turn on single channel module
    how to writes this condition in the scene
    please help me.

    Please login or register to see this attachment.

     

    • 0
    Posted

    @mostafa251370

    Why do you quote you own massage again?

    Cag014 have given you a solution, or if this not working?

     

    myVariable=tonumber(fibaro:getValue(112,"value"))

    if myVariable == 1 then

     fibaro:call(75,"turnOn")

    end

     

    also you can if the devices with myVariable is 0 then off you can do the next.

     

     

    myVariable=tonumber(fibaro:getValue(112,"value"))

    if myVariable == 1 then

     fibaro:call(75,"turnOn") else

    fibaro:call(75,"turnOff")

    end

    • 0
    Posted (edited)

    Can you give more specific details?

    What's not working, and what error do you get?

    Other ways try this:

    local myVariable=tonumber(fibaro:getValue(112,"value"))

    if myVariable == 1 then

     fibaro:call(75,"turnOn") else

    fibaro:call(75,"turnOff")

    end

     

    and device 112 what is this?

    Edited by Reinhold
    • 0
  • Inquirer
  • Posted

    Hello
    I do not know why it does not work
    112 ID is the setting of the thermostat mode mco.
    Every time the thermostat mco begins to work with heating, it writes in detail

    fibarocall(112, "setMode")

     

    Hello
    I do not know why it does not work
    112 ID is the setting of the thermostat mode mco.
    Every time the thermostat mco begins to work with heating, it writes in detail

    fibarocall(112, "setMode")

     

    • Like 1
    • 0
    Posted

    Do you get from fibaro:getValue(112,"value") a 0 or 1 value?

     

    • 0
  • Inquirer
  • Posted

    I do not know how I can see the ID 112
    But when I write

    fibarocall(112, "setMode", "1")
    The thermostat starts in the heating mode

    • 0
    Posted (edited)

    What do you get in the debug screen if you type and start the scene 

     

    local value = tonumber(fibaro:getValue(112,"value")

    fibaro:debug(value)

     

     

    Edited by Reinhold
    • 0
    Posted
    7 hours ago, mostafa251370 said:

    fibarocall(112, "setMode", "1")

    Might be you need read back not value, but setMode

    try

    fibaro:getValue(112, "setMode")

    • 0
    Posted

    in the site menu left and then the dropdown menu of ID 112 you have Properties and Actions

    is there a value in there or not

    you can also klik there and it will appear in LUA

     

    i don't think than fibaro:getValue(112, "setMode") will work and gives nil

    • 0
    Posted

    I don't have this thermostat, but many thermostats have this property:

     

    Please login or register to see this code.

    I am not sure if this is what you want. The "operating mode" is what you ask the thermostat to do. Z-Wave defines what the values, all thermostats use the same numbers.  But it depends on the device type which values are acceptable. Some can cool, some cannot. For instance, my FGT-001 has these modes:

     

    0 = OFF (pretty much every thermostat has this)

    1 = Heat (pretty much every thermostat has this)

    31 = "manufacturer specific" and on a FGT-001 this means "MAX" or "FULL" = valve completely open and no temperature control.

     

    Here's a table of all defined values.

     

    Please login or register to see this attachment.

     

    But maybe you want to know if the thermostat is really turning on the heat (or AC, if it has that capability)?

     

    I do not know the answer, in case of an FGT-001 this information is unavailable. The FGT-001 does not report if the valve is open and this is something that would be nice to now and quite useful

     

    Sorry for being technical, but there might be a way to find out if one of your properties change: have a look at the "device" api, eg go to http://your_ip/api/devices/122. You'll see a bunch of json encoded data. If you look closely you'll find "value" and "operatingMode" and many others. Try to see if anything changes if your relay toggles... Also try different slaves belonging to the same master device. Long shot, it might be "fibaro:getValue(112,"mode") but I am really not sure.

    • 0
  • Inquirer
  • Posted

    thanks guys

    I succeeded

    Please login or register to see this attachment.

    • 0
    Posted

    You got two myVariable1 = (fibaro..... 

    myVariable1 =( fibaro... 

    myVariable2 =(fibaro.... 

    • 0
    Posted

    Hello colleagues,

    let me ask one question related to this topic.

     

    No problem to switch the FGT-001 ON and OFF. Also no problem to set to MAX mode. All 3 operation modes are supported.

    But if I switch the FGT-001 ON all the time there is setted 20°C. But my schedule require different temperature.

    Please, can you give me an advice how to make the FGT to be set according to actual scheduled value? I hope no schedule synchronization is needed.

    In original FGT-001 manual is written mode numer 99 to be used to get ON with last set temperature, but mode 99 is not supported. Only 0,1 and 31. So, how to get back to previously setted value after the window is closed?

     

    Thanks a lot.

    Please login or register to see this image.

    /monthly_2020_10/obrazek.png.af164be276a5a002f2edf6b3b274f9cc.png" />

    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...