Excuse my noobness, I'm very new to Domoticz and very new to Lua/Dzvents.
I have a dummy switch in Domoticz that I use as a boost heating button.
When it is 'On', a script updates a setpoint for 15 minutes on my Evohome.
When the button is 'Off', it effectively cancels the override by returning the Evohome zone to Auto.
So, I have a very basic script at the moment and what I am trying to do is use OpenURL to call a json command which switches the dummy boost button on/off in Homeseer. Simply put I want to keep both buttons in sync with on/off states. So when the Domoticz script runs it calls the respective json command to update the button in Homeseer.
The command works fine without basic authentication but I need it turned on for various reasons and I can make it work fine from ha-bridge and curl using the usual Authorization: Basic k9034je3edwd3e= format. However, with Dzvents I cannot work it out. I have read and searched every post out there and there is virtually nothing about this. I don't get any errors from the openurl command so I have no where to turn now.
If someone can point me in the right direction as I just don't know how to write the authentication properly.
Here's the primitive script.
Code: Select all
return {
on = {
devices = {
'BoostBathroom'
}
},
execute = function(domoticz, switch)
if (switch.state == 'On') then
local untilDateTime = os.date("!%Y-%m-%dT%H:%M:%SZ",os.time()+900)
domoticz.devices('BathroomTRV').updateSetPoint(24.0, "TemporaryOverride", untilDateTime)
domoticz.openURL (
{
url = 'http://xxxx:xx/JSON?request=setdevicestatus&ref=1971&value=1',
method = 'GET',
headers = {
Authorization = "Basic scoobydoobydoo"
}
}
)
elseif (switch.state == 'Off') then
domoticz.devices('BathroomTRV').updateSetPoint(nil, "Auto", nil)
end
end
}