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
Moderators: leecollings, remb0
Code: Select all
/json.htm?type=createvirtualsensor&idx=894&sensorname=Testthermostaat&sensortype=70
Code: Select all
/json.htm?type=createevohomesensor&idx=<IDX OF DUMMY HARDWARE>&sensortype=70
i saw the thermostat setpoint but this one doesnt have a combined temperature/setpoint.. thats what i like about the evohome devices.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 also have a floor heating system (Roth Touchline) with an Ethernet interface.
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
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
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"
Users browsing this forum: No registered users and 0 guests