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

Virtual thermostat in QA - synchronise two heads by one temperature sensor


PetrH
 Share

Question

I need to manage (synchronise) two heating heads Popp/Danfoss with a temperature sensor (TS) Aeotec.
(Btw, I know this function has Fibaro heads and Fibaro temperature sensor, but I need to solve it with Popp/Aeotec.) 

So I created a virtual sensor in Quickapps and connected it to a heating zone (see below the template of the VS). 

 

The question is where I should place the code, periodically comparing the temperature from the TS and value from heating zone (heatingThermostatSetpoint property) and then managing (synchronize) the heads. I'm thinking about these possibilities:

 

- LUA scene triggered periodically (cron)

- LUA scene triggered by the change of temperature of TS  (is it possible?)


Is there any other, more elegant option? 
Thank you for any clue!
Petr


QA Virtual Sensor template:
 

-- Thermostat heat should handle actions: setThermostatMode, setHeatingThermostatSetpoint
-- Proeprties that should be updated:
-- * supportedThermostatModes - array of modes supported by the thermostat eg. {"Off", "Heat"}
-- * thermostatMode - current mode of the thermostat
-- * heatingThermostatSetpoint - set point for heating
 
-- handle action for mode change 
function QuickApp:setThermostatMode(mode)
    self:updateProperty("thermostatMode", mode)
end
 
-- handle action for setting set point for heating
function QuickApp:setHeatingThermostatSetpoint(value) 
    self:updateProperty("heatingThermostatSetpoint", value)
end
 
-- To update controls you can use method self:updateView(<component ID>, <component property>, <desired value>). Eg:  
-- self:updateView("slider", "value", "55") 
-- self:updateView("button1", "text", "MUTE") 
-- self:updateView("label", "text", "TURNED ON") 
 
-- This is QuickApp inital method. It is called right after your QuickApp starts (after each save or on gateway startup). 
-- Here you can set some default values, setup http connection or get QuickApp variables.
-- To learn more, please visit: 
--    * https://manuals.fibaro.com/home-center-3/
--    * https://manuals.fibaro.com/home-center-3-quick-apps/
 
function QuickApp:onInit()
    self:debug("onInit")
 
    -- set supported modes for thermostat
    self:updateProperty("supportedThermostatModes", {"Off""Heat"})
 
    -- setup default values
    self:updateProperty("thermostatMode""Heat")
    self:updateProperty("heatingThermostatSetpoint"20)
end

 

 

Edited by PetrH
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi PetrH,

 

I think, that not exists any other (more elegant) solution and the best solution in your case is storing LUA code in the scene launched periodicaly (eg. each 5 minutes). For this you should create scene based on LUA block and as trigger select Time Interval.

  • Like 1
Link to comment
Share on other sites

  • 0
  • Inquirer
  • 22 hours ago, Tomasz Spaleniak said:

    Hi PetrH,

     

    I think, that not exists any other (more elegant) solution and the best solution in your case is storing LUA code in the scene launched periodicaly (eg. each 5 minutes). For this you should create scene based on LUA block and as trigger select Time Interval.

    Hi Tomasz, thank you for your opinion! 

    Petr

    Link to comment
    Share on other sites

    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.

     Share

    ×
    ×
    • Create New...