Fibaro Home Center 2 and thermostat for floor heating HeatIt. How to raise the temperature

  • Tutorial
I faced the task of managing a warm floor from the interface of Fibaro Home Center 2. It seems to be the simplest task, but no. At the request of the customer thermostats should be repelled by the temperature of the floor. It was decided to use HeatIt thermostats.


They are most suited to customer requirements:

  • minimalistic design
  • the ability to extinguish everything that glows on the panel
  • the ability to work based on the temperature of the floor
  • the possibility of direct association with external relays (since the floor is water-heated, you need to control the relays placed in the boiler room, which open and close the valves of the respective circuits)

Having studied the materials in the network a little bit, I found out that the “cool” Fibaro Home Center 2 cannot nominally set the temperature on the thermostats to> 30 degrees in the web interface and> 28 degrees in the mobile application. That for the maximum temperature of the floor, of course not enough.


At the same time Thermostats HeatIt make it possible to set up to 40 degrees. The question arises why Fibaro does not allow the installer to set the range of possible temperatures. Well, okay, I thought, think of something. There was even an idea to shift the readings of the NTC sensor with an additional resistor, but then the customer would have to get used to the temperature readings in conventional “parrots”, which is not good.

There was a thought, but what if you take and send in some way greater value?

The exchange between the web client and Home Center 2 is described inREST API from Fibaro
But it turned out to be easier for me to intercept all the commands in Wireshark.

Specifically for HeatIt:
POST / api / devices / 9 / action / setMode {"args": [1]}
POST / api / devices / 9 / action / setSetpointMode {"args": [1]}
POST / api / devices / 9 / action / setThermostatSetpoint {"args": [1,27]}
setMode – выбор режима (аргументы: 1 — вкл. обогрев, 11 — экономичный обогрев, 0 — выкл.)
setSetpointMode — выбор, из какого режима отображается установочная температура (аргументы те же самые)
setThermostatSetpoint — установка целевой температуры для режима (соответственно, первый аргумент — режим, второй — температура)

You can also send requests like:
GET / api / callAction? DeviceID = ID & name = setThermostatSetpoint & arg1 = MODE & arg2 = TEMP VALUE

All commands and values ​​for all installed devices can also be obtained by REST request:
GET / api / devices
So, we send the thermostat a temperature of 35 degrees, and, oh, a miracle, the thermostat accepted it.

Now the task is to come up with a replacement for the standard thermostat control.

The first option is the Fibaro virtual device.

I sketched out the form:


start writing scripts: First, find out the ID of all devices we are interested in. To do this, go to the settings of each “device” related to our thermostat and see the ID on the page or in the address bar of the browser.

In my case, the device for setting the target temperature (setPoint) - ID: 7

Floor temperature sensor - ID: 8

Selecting the operating mode of the thermostat - ID: 9

Also, our virtual device also has its ID, it can be seen only in the address bar of my browser, it is ID 12 . Next, each element of the virtual device also has its ID, in my case:

“Current temp.” I have the ID “ Label1 ”, “Target temperature” - ID “ Label2
Buttons “+” and “-” - ID “ Button1 ” and ID “ Button2 ” respectively. “Mode” - ID “ Label1 ”.
Well, the buttons "OFF", "ECO" and "ON" - ID “ Button3 ”, ID “ Button4 ” and ID “ Button5 ”, respectively.

Main loop:

-- запрашиваем текущую температуру пола и целевую температуру, а так же выбранный режим работы термостата:
floor_temp = fibaro:getValue(8, 'value')
currentSetPoint = tonumber(fibaro:getValue(7, 'value'))
mode = fibaro:getValue(9, 'mode')
-- здесь отображаем текущую температуру
fibaro:call(12, "setProperty", "ui.Label1.value", floor_temp)
-- в зависимости от выбранного режима отображаем целевую температуру и сам режим в соответствующих поляхif (mode == '1') then
  fibaro:call(12, "setProperty", "ui.Label3.value", "ON")
  fibaro:call(12, "setProperty", "ui.Label2.value", currentSetPoint)
elseif (mode == '11') then
  fibaro:call(12, "setProperty", "ui.Label3.value", "ECO")
  fibaro:call(12, "setProperty", "ui.Label2.value", currentSetPoint)
elseif (mode == '0') then
  fibaro:call(12, "setProperty", "ui.Label3.value", "OFF")
  fibaro:call(12, "setProperty", "ui.Label2.value", "OFF")

Next, write scripts for the buttons:
With the mode select buttons, everything is simple:

fibaro:call(9, 'setMode',0)


fibaro:call(9, 'setMode',11)
fibaro:call(7, 'setSetpointMode',11)


fibaro:call(9, 'setMode',1)
fibaro:call(7, 'setSetpointMode',1)

For the "+" button:

-- узнаем текущую целевую температуру
currentSetPoint = tonumber(fibaro:getValue(7, 'value'))
-- прописываем условие, что бы температуру нельзя было увеличить более 40 градусовif (currentSetPoint < 40) then
  setPoint = currentSetPoint + 1else 
  setPoint = 40end-- отправляем новую температуру в термостат
fibaro:call(7, 'setThermostatSetpoint',11, setPoint)

For the "-" button:

currentSetPoint = tonumber(fibaro:getValue(7, 'value'))
if (currentSetPoint > 5) then
  setPoint = currentSetPoint - 1else 
  setPoint = 5end
fibaro:call(7, 'setThermostatSetpoint',11, setPoint)

In general, everything.

It works fine, the only problem is the delay after pressing the button. If managed from a local network, it is 1-2 seconds, but if managed remotely, the delay can be up to 10 seconds. Those. if necessary, add or lower the temperature by a dozen degrees remotely, it may take a couple of minutes.

In general, this is of course a crutch, but so far there is no other way out. In other matters, running into before I say, the whole system will eventually come under the control of Iridium Mobile, so this is a temporary solution.

Also popular now: