Dummy Thermostat

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
JacquesMulders
Posts: 33
Joined: Saturday 03 January 2015 22:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Dummy Thermostat

Post by JacquesMulders »

Is it possible to create a dummy thermostat just like the evohome system has, with a thermostat setpoint and the actual temperature. now is it only possible to create a dumme thermostat setpoint.

i've tryed it to create a virtual thermostat using this url

Code: Select all

/json.htm?type=createvirtualsensor&idx=894&sensorname=Testthermostaat&sensortype=70
(in the database the evohome devices has type 70)
Attachments
Schermafbeelding 2016-10-27 om 14.30.00.png
Schermafbeelding 2016-10-27 om 14.30.00.png (78.96 KiB) Viewed 8956 times
JacquesMulders
Posts: 33
Joined: Saturday 03 January 2015 22:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Dummy Thermostat

Post by JacquesMulders »

found out that the url was wrong... correct url is :

Code: Select all

/json.htm?type=createevohomesensor&idx=<IDX OF DUMMY HARDWARE>&sensortype=70
maybe it can be implemented in de dummy hardware list?
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Dummy Thermostat

Post by Egregius »

Where does the actual temperature comes from?
JacquesMulders
Posts: 33
Joined: Saturday 03 January 2015 22:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Dummy Thermostat

Post by JacquesMulders »

It comes from whatever you update it with, same for the set temp...
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Dummy Thermostat

Post by Egregius »

So you need to update the device with a temperature of another device? But to do that you need to first read the setpoint, otherwise you can't update?
Don't get the advantage over a separate setpoint and thermometer then.
JacquesMulders
Posts: 33
Joined: Saturday 03 January 2015 22:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Dummy Thermostat

Post by JacquesMulders »

i want to use for example an fibaro flood sensor as a thermostat, so use the temp of the floodsensor and switch an floorheating valve open to heat the room. i think its a nice addition to it to have it combined in to 1 device instead of 1 temp sensor and 1 thermostat.

it is possible, with the link i provided in the second post. i think it would be nice if it could be in the dropdown list of the dummy hardware.

ive tried to compile domoticz with the adaption myself, but my knowledge of c++ and the domoticz root system is not enough to get it working.
JacquesMulders
Posts: 33
Joined: Saturday 03 January 2015 22:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Dummy Thermostat

Post by JacquesMulders »

Nevermind, in the dummy hardware the device is not working properly. i will try to do it via the evohome script hardware.
bloody2k
Posts: 5
Joined: Wednesday 07 September 2016 9:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dummy Thermostat

Post by bloody2k »

Hi JacquesMulders

Have you tried creating your dummy sensor trough Setup->Hardware->Dummy->Create virtual sensor?
Creating a dummy sensor here, I can select the type Thermostat Setpoint, which I would guess could do what you want to.

Can i ask you, how you control you floor heating valves?

I'm thinking of creating my own script/system to control my waterbased floor heating, but I cant seem to figure out the best way to control the valves, since they are working on 24v I have been thinking of a Qubino Flush relay.

What hardware are you using?
JacquesMulders
Posts: 33
Joined: Saturday 03 January 2015 22:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Dummy Thermostat

Post by JacquesMulders »

bloody2k wrote:Hi JacquesMulders

Have you tried creating your dummy sensor trough Setup->Hardware->Dummy->Create virtual sensor?
Creating a dummy sensor here, I can select the type Thermostat Setpoint, which I would guess could do what you want to.

Can i ask you, how you control you floor heating valves?

I'm thinking of creating my own script/system to control my waterbased floor heating, but I cant seem to figure out the best way to control the valves, since they are working on 24v I have been thinking of a Qubino Flush relay.

What hardware are you using?
i saw the thermostat setpoint but this one doesnt have a combined temperature/setpoint.. thats what i like about the evohome devices.

i've now added the evohome via script hardware and that works perfect, i've build a script to import my tado and controll it from domoticz... i'm still in the process of building the set script, the temp value update script is ready.

on my floor heating mixer i have 230vac valves, so my plan was to build a script that just turns a fibaro on. thats only for the toilet/hallway, they may only get heat from the cv when the living room is also heated, i dont wat that the toilet turns on my cv... the rest of the house i control with tado, but i wanted them all in domoticz.
mikkel75
Posts: 39
Joined: Thursday 08 December 2016 20:50
Target OS: Linux
Domoticz version:
Contact:

Re: Dummy Thermostat

Post by mikkel75 »

Hi,

I have the same problem - currently having 2 dummy devices per room; thermostat and temp sensor, both updated by Lua script.

I would very much like a dummy device that has both values exactly like the one you suggest.

I have tried you URL to create the Evo device, which works fine, but I'm missing the possibility from Domoticz GUI to set new SetPoint, like it's possible with other thermostats - is that possible?

How do you from Lua updat both setpoint and temperature on the EvoHome device?

Thanks.

P.S. I have a Roth floor heating system (Touchline) with an Ethernet interface. I have Lua code that read/write to that system via HTTP.
PDP8
Posts: 29
Joined: Friday 24 February 2017 9:39
Target OS: Windows
Domoticz version: V4.9700
Location: Netherlands
Contact:

Re: Dummy Thermostat

Post by PDP8 »

Is there any progress in this Dummy Thermostat? I would also like
to have a dummy thermostat to set temperatures @ certain times.

Regards, Roland
markjgabb
Posts: 142
Joined: Tuesday 24 January 2017 23:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Australia
Contact:

Re: Dummy Thermostat

Post by markjgabb »

same here...ive only just realized this doesnt work....

ive added it from the dummy switches area but i cant find it to use it anywhere
V 2020.2 RPI 3
RFlink 334 mhz
mysensors
broadlink
Mirabella Genio Globes
Qxlkdr
Posts: 5
Joined: Friday 14 July 2017 15:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dummy Thermostat

Post by Qxlkdr »

mikkel75 wrote: Thursday 02 February 2017 9:22 P.S. I have a Roth floor heating system (Touchline) with an Ethernet interface. I have Lua code that read/write to that system via HTTP.
I also have a floor heating system (Roth Touchline) with an Ethernet interface.

Please explain how you read/write to the Roth system via HTTP. I would really appreciate it. Can you share the instruction and the LUA code?

Thanks in advance.
mikkel75
Posts: 39
Joined: Thursday 08 December 2016 20:50
Target OS: Linux
Domoticz version:
Contact:

Re: Dummy Thermostat

Post by mikkel75 »

Hi,

Here is my LUA code - roth.lua (placed in scripts/lua)

Code: Select all

local roth_ip = "192.168.1.10"

package.cpath = package.cpath..';/usr/lib/x86_64-linux-gnu/lua/5.2/socket/?.so'
package.cpath = package.cpath..';/usr/lib/x86_64-linux-gnu/lua/5.2/?.so'

-- sudo ln -s /usr/share/lua /usr/local/lib/lua
-- install lua-socket
-- The Request Bin test URL: http://requestb.in/12j0kaq1
local http = require("socket.http")
local ltn12 = require("ltn12")

roth2device = { "Soveværelse", "Værksted", "LBad", "SBad", "Albert", "Emil", "Gang" }

function sendRequest(x)
  local path = "http://"..roth_ip.."/cgi-bin/ILRReadValues.cgi"

  local data = '<body><version>1.0</version><client>App</client><file_name>Controller</file_name><item_list_size>13</item_list_size><
item_list><i><n>G'..x..'.kurzID</n></i><i><n>G'..x..'.ownerKurzID</n></i><i><n>G'..x..'.RaumTemp</n></i><i><n>G'..x..'.SollTemp</n></
i><i><n>G'..x..'.OPMode</n></i><i><n>G'..x..'.WeekProg</n></i><i><n>G'..x..'.TempSIUnit</n></i><i><n>G'..x..'.SollTempMaxVal</n></i><
i><n>G'..x..'.SollTempMinVal</n></i><i><n>G'..x..'.SollTempStepVal</n></i><i><n>G'..x..'.OPModeEna</n></i><i><n>G'..x..'.WeekProgEna<
/n></i><i><n>CD.rooms['..x..']</n></i></item_list></body>'
  
  local response_body = { }
 
  local res, code, response_headers, status = http.request
  {
    method = "POST",
    url = path,
    source = ltn12.source.string(data),
    headers =
    {
      ["Content-Type"] = "text/xml",
      ["User-Agent"] = "Roth-Touchline.../1.05",
          ["Content-Length"] = string.len(data)
    },
    sink = ltn12.sink.table(response_body)
  }

  if (code == 200) then
    return response_body[1]
  else
   return nil
  end

end

function sendSetpoint(x, val)
  local path = "http://"..roth_ip.."/cgi-bin/writeVal.cgi"

  local res, code, response_headers, status = http.request( path.."?G"..x..".SollTemp="..val )

  print( "sendSetPoint: "..res.."code: "..code)
  return code
end

function updateRothDev(str, i)
-- Domoticz devices to update named "Gulv_Temp_xxxxx"
-- table converts Roth index to Domoticz device names

  idx = string.find(str, "RaumTemp")
  idx2 = string.find(str, "</v>", idx)
  temp = string.sub(str, idx+15, idx2-1)
--  print( "Rum temp = " .. temp )

  table.insert (commandArray, { ['UpdateDevice'] = tostring(otherdevices_idx["Gulv_Temp_"..roth2device[i]]).."|0|"..temp/100 } )

  idx = string.find(str, "SollTemp")
  idx2 = string.find(str, "</v>", idx)
  temp = string.sub(str, idx+15, idx2-1)
--  print( "Rum set temp = " .. temp )
  table.insert (commandArray, { ['SetSetPoint:'..tostring(otherdevices_idx["Gulv_Temp_"..roth2device[i].."_set"])]=tostring(temp/100) } )

--local temp = domoticz_applyXPath(response_body[1],'//body/item_list/i[contains(@n, "G1.RaumTemp")]/@v')
--domoticz_applyXPath(s,'//weatherdata/forecast/time[contains(@from,'15:00:00')]/@from')

-- Ex. response: "<body><version>1.0</version><client>App</client><file_name>Controller</file_name><item_list_size>13</item_list_size><item_list><i><n>G1.kurzID</n><v>2</v></i><i><n>G1.ownerKurzID</n><v>68</v></i><i><n>G1.RaumTemp</n><v>2172</v></i><i><n>G1.SollTemp</n><v>2100</v></i><i><n>G1.OPMode</n><v>0</v></i><i><n>G1.WeekProg</n><v>0</v></i><i><n>G1.TempSIUnit</n><v>0</v></i><i><n>G1.SollTempMaxVal</n><v>3000</v></i><i><n>G1.SollTempMinVal</n><v>500</v></i><i><n>G1.SollTempStepVal</n><v>0</v></i><i><n>G1.OPModeEna</n><v>1</v></i><i><n>G1.WeekProgEna</n><v>1</v></i><i><n>CD.rooms[1]</n><v></v></i></item_list></body>"

end

Here is a timed script to update all devices every 15 minutes (script_time_Roth.lua in domoticz/lua):

Code: Select all


commandArray = {}

local m = os.date('%M')

if (m % 15 == 0) then
   -- print('The 15 minute script interval reached')
   -- Call your function here that shall run every 15 minutes
dofile("/home/hac/domoticz/scripts/lua/roth.lua")

  table.insert (commandArray, { ['Variable:RothUpdateActive'] = '1' } )

  for i=1,#roth2device do
    str = sendRequest( i-1 )  --Roth table is 0 based
    if ( str ~= nil  ) then
      updateRothDev(str, i)
    else
      print( "Roth HTTP access failed: "..i)
    end
  end

  table.insert (commandArray, { ['Variable:RothUpdateActive'] = '0' } )

end

return commandArray

Remember to create dummy devices and change the scripts were needed...

Hope it helps ;)

/Mikkel
buzzzy
Posts: 7
Joined: Wednesday 24 January 2018 22:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dummy Thermostat

Post by buzzzy »

Mikkel, thanks for sharing the code. Also having a Roth device, I'd like to be able to plot the temperature data. I can pull the data using

Code: Select all

curl -s -k -X "POST" -H "Content-Type: text/xml" -H "User-Agent: SpiderControl/1.0 (iniNet-Solutions GmbH)" --data-binary $"<body><item_list><i><n>G0.RaumTemp</n></i><i><n>G1.RaumTemp</n></i><i><n>G2.RaumTemp</n></i><i><n>G3.RaumTemp</n></i><i><n>G4.RaumTemp</n></i><i><n>G5.RaumTemp</n></i></item_list></body>" "http://192.168.2.10/cgi-bin/ILRReadValues.cgi"
Now, being new to Domoticz I cannot find any complete tutorials on how to integrate the full thing, script, hooking up with devices etc in Domoticz. Any more info you can share?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest