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

Heating panel override VD


Question

Guest jodohl
Posted

Hi!

I am searching for a solution to the following challenge:

I am regulation the heating in my house by Heating Panel. To override the scheduled daytime lowering on weekdays (when e.g. working from home), I have borrowed a virtual device LUA code that works well. It is basically a VD with three buttons, for "Schedule", "Holiday" and "Home" respectively.

This code will however only accept one single override temperatur for all zones. I want my bathrooms at a higher temperature.

 

It must certainly be possible to amend the LUA code to achieve this. I have tried to manipulate the LUA code by adding duplicates og the core subroutine with changed variables for the zone ID in question, but the code will not run. Not very surprising, since my understanding of LUA is very limited. 

 

Is there anyone out there with better LUA competence who could propose a solution? 


The code for the "Home" VD button is given below. My bathrooms are Zone 204, which I want to stay on 24C, not the common 22C temperature.

 

local zoneIds = {22,23,33,47,204} -- En komma separeret liste med de Zoneid du ønsker at opdatere


local target = 22-- Din target temperatur. 0 = vacation disabled
 
local HC2 = Net.FHttp("127.0.0.1",11111)
local function updateZone(id)
    local response ,status, errorCode = HC2:GET("/api/panels/heating/"..id)
    local jsonTable = false
 
    if (status == "200") then
        jsonTable = json.decode(response)
    end
 
    if (jsonTable ~= false) then
        jsonTable.properties.vacationTemperature = target
        HC2:PUT("/api/panels/heating/"..id, json.encode(jsonTable))
        return true
    end
   
    return false
    
end
 
for n, zoneId in ipairs(zoneIds) do
    if (updateZone(zoneId)) then
        fibaro:debug("Updated Zone "..zoneId);
    else
        fibaro:debug("Failed to Update Zone "..zoneId);
    end

end

 

 

 

 

3 answers to this question

Recommended Posts

  • 0
Posted

Please login or register to see this link.

  • 0
Posted
2 hours ago, 10der said:

Please login or register to see this link.

ROTFL

  • 0
Posted
On 12/8/2019 at 4:09 PM, jodohl said:

Hi!

I am searching for a solution to the following challenge:

I am regulation the heating in my house by Heating Panel. To override the scheduled daytime lowering on weekdays (when e.g. working from home), I have borrowed a virtual device LUA code that works well. It is basically a VD with three buttons, for "Schedule", "Holiday" and "Home" respectively.

This code will however only accept one single override temperatur for all zones. I want my bathrooms at a higher temperature.

 

It must certainly be possible to amend the LUA code to achieve this. I have tried to manipulate the LUA code by adding duplicates og the core subroutine with changed variables for the zone ID in question, but the code will not run. Not very surprising, since my understanding of LUA is very limited. 

 

Is there anyone out there with better LUA competence who could propose a solution? 


The code for the "Home" VD button is given below. My bathrooms are Zone 204, which I want to stay on 24C, not the common 22C temperature.

 

<snip>

 

Do you have a link to the virtual device LUA code that you are referring to. Sound like examply what I need.

I want to run the schedule at my cabin when I am here, but just set everything to 10 degrees when I am not.

 

 

 

 

 

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