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

Boiler pump control ends with load (load): 15: attempt to index a number value (local 'teID')


Question

Posted (edited)
local fromID = {189,143,197,148} -- Teplomery (Namerané teploty)
local toID = {132,142,221,145} -- Termostaty (Nastavené teploty / Setpoint)
local teID = 173 -- Teplota nádoby
local boiler = 168 -- 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])
    local name3 = fibaro.getName(teID[i])
    local room3 = fibaro.getRoomNameByDeviceID(teID[i])
 
    if ( fibaro.getValue(toID[i], "heatingThermostatSetpoint") ~= 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") )
        fibaro.debug("", name3.. " / v miestnosti / " ..room3.. "  - Namerana Teplota: " ..fibaro.getValue(teID[i], "value") )
                if ( fibaro.getValue(fromID[i],"value") < fibaro.getValue(toID[i], "heatingThermostatSetpoint") )  and
                   ( fibaro.getValue(teID[i],"value") >  fibaro.getValue(toID[i], "heatingThermostatSetpoint") ) then              
                        flaq_1 = 1
                end 
                              
    else
        flaq_1 = 0
        fibaro.call(boiler, "turnOff")
        fibaro.debug("","vypínam čerpadlo")
    end
end
 
if (flaq_1 == 1) then
    fibaro.call(boiler, "turnOn")
    fibaro.debug("","zapínam čerpadlo") 
    
    else
    fibaro.call(boiler, "turnOff")
    fibaro.debug("","vypínam čerpadlo")
 
end
Edited by krovak

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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