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


Recommended Posts

Posted

Hi. After the update, this lua scene stopped working for me:

 

 

 

{
  conditions = { {
      isTrigger = true,
      operator = "matchInterval",
      property = "cron",
      type = "date",
      value = {
        date = { "00", "00", "1", "3", "*", "2020" },
        interval = 300
      }
    } },
  operator = "any"
}
 
 
local fromID = {58,63,68,73,78,83,88,93,98,144,236,241,260,275,333,338,343,425,472} -- Teplomery (Namerané teploty)
local toID = {57,62,67,72,77,82,87,92,97,143,235,240,259,264,332,337,342,424,471} -- Termostaty (Nastavené teploty / Setpoint)
local boiler = 226 -- Relé na ovládanie kotla
local flaq_1 = 0
 
for i=1,#toID do 
 
    local name1 = fibaro.getName(fromID[i])
    local room1 = fibaro.getRoomNameByDeviceID(fromID[i])
    local name2 = fibaro.getName(toID[i])
    local room2 = fibaro.getRoomNameByDeviceID(toID[i])
 
    if ( fibaro.getValue(toID[i], "heatingThermostatSetpinot") ~= fibaro.getValue(fromID[i],"value") ) then        
        fibaro.debug("", name1.. " / v miestnosti / " ..room1.. "  - Namerana Teplota: " ..fibaro.getValue(fromID[i], "value") )
        fibaro.debug("", name2.. " / v miestnosti / " ..room2.. "  - Nastavena Teplota: " ..fibaro.getValue(toID[i], "heatingThermostatSetpoint") )
 
                if ( fibaro.getValue(fromID[i],"value") < fibaro.getValue(toID[i], "heatingThermostatSetpoint") ) then              
                        flaq_1 = 1
                end                
    else
        flaq_1 = 0
        fibaro.call(boiler, "turnOff")
        fibaro.debug("","vypinam kotol")
    end
end
 
if (flaq_1 == 1) then
    fibaro.call(boiler, "turnOn")
    fibaro.debug("","zapinam kotol")
else
    fibaro.call(boiler, "turnOff")
    fibaro.debug("","vypinam kotol")
end

 

Where can there be a mistake?

 

This generates a message:

[29.11.2021] [18:16:51] [ERROR] [SCENE159]: /opt/fibaro/lua_engine/lua/engine/fibaro_sdk.lua:248: Assertion failed: Expected number

 

well thank you

 

Posted

You get that error if one of the deviceIDs don't exist.

Probably from fibaro.getRoomNameByDeviceID

Posted
3 minutes ago, jgab said:

You get that error if one of the deviceIDs don't exist.

Probably from fibaro.getRoomNameByDeviceID

Interestingly fibaro.getRoomNameByDeviceID returns nil for a non-existent device in QAs... which I think is a better behaviour.

Still don't understand why they keep different implementations of Lua fibaro api for scenes and QAs... 

  • Thanks 1
Posted
13 hours ago, jgab said:

Still don't understand why they keep different implementations of Lua fibaro api for scenes and QAs... 

with different behaviors. (for example http)

it's look like Scene Team: ok! we are build own theme park with blackjack and ... (c) 

Posted

You also seems to have misspelled heatingThermostatSetpinot

Join the conversation

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

Guest
Reply to this topic...

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