Page 2 of 2

Re: dzVents 2.3.0 released in v3.8551

Posted: Saturday 07 October 2017 11:38
by EddyG
Does this dzVents version work with Domoticz version 3.8153? (latest stable)

Re: dzVents 2.3.0 released in v3.8551

Posted: Saturday 07 October 2017 11:57
by dannybloe
Nope, you need 8551 or higher.

Re: dzVents 2.3.0 released in v3.8551

Posted: Saturday 07 October 2017 12:11
by EddyG
OK, too bad. So I wait until the next stable.
Hope it comes soon. ;)

Re: dzVents 2.3.0 released in v3.8551

Posted: Saturday 07 October 2017 20:24
by tlpeter
I have a question about the "timer in between"
When i turn on a device with this timer should it turn off automatically when it is not in this range?
I expect this behavior but doesn't seem to work that way.

Re: dzVents 2.3.0 released in v3.8551

Posted: Saturday 07 October 2017 20:29
by dannybloe
No. Your script is executed every minute in that interval. Unless you set it to every xx minutes as well. Read about timer triggers in the manual.

Re: dzVents 2.3.0 released in v3.8551

Posted: Saturday 07 October 2017 21:45
by lonebaggie
Same issue here with Settings/Other dzvents is disabled. If you you disable event systems save then re-enable and save . DZvents works . Very weird both Dzvents and events systems are not enabled (no tick) but both work

Re: dzVents 2.3.0 released in v3.8551

Posted: Monday 09 October 2017 16:21
by Maes
dannybloe, is it correct that .silent() and .checkFirst() don't work on thermostat devices?

Code: Select all

domoticz.devices(ToonThermostatSensorName).updateSetPoint(currentSetpoint).silent().checkFirst()
It just updates the thermostat and then triggers my thermostat script T_T..

Also, using silent() or checkFirst() on the thermostat gives me an error attempt to index a nil value. The error doesn't seem to stop anything from working however

Re: dzVents 2.3.0 released in v3.8551

Posted: Monday 09 October 2017 16:35
by dannybloe
silent() should work but checkfirst is for switches for now.

Re: dzVents 2.3.0 released in v3.8551

Posted: Monday 09 October 2017 16:41
by Maes
Thanks for the fast reply!

So I think I'm doing something wrong, or I found a bug:

Script runs every minute

Code: Select all

return {
	on = {
		timer = {
			'every minute'
		}
	},
	execute = function(domoticz)
        local ToonThermostatSensorName = domoticz.variables('UV_ToonThermostatSensorName').value -- Sensor showing current setpoint
        local ToonTemperatureSensorName = domoticz.variables('UV_ToonTemperatureSensorName').value -- Sensor showing current room temperature
        local ToonScenesSensorName  = domoticz.variables('UV_ToonScenesSensorName').value -- Sensor showing current program
        local ToonAutoProgramSensorName = domoticz.variables('UV_ToonAutoProgramSensorName').value -- Sensor showing current auto program status
        local ToonProgramInformationSensorName = domoticz.variables('UV_ToonProgramInformationSensorName').value -- Sensor showing displaying program information status
        local ToonIP = domoticz.variables('UV_ToonIP').value
        local DomoticzIP = domoticz.variables('UV_DomoticzIP').value
    
        --local json = assert(loadfile "C:\\Program Files (x86)\\Domoticz\\scripts\\lua\\json.lua")()  -- For Windows
        local json = assert(loadfile "/home/maes/domoticz/scripts/lua/JSON.lua")()  -- For Linux
        
        local handle = assert(io.popen(string.format('curl http://%s/happ_thermstat?action=getThermostatInfo', ToonIP)))
            local ThermostatInfo = handle:read('*all')
        handle:close()
        
        local jsonThermostatInfo = json:decode(ThermostatInfo)
        
        if jsonThermostatInfo == nil then
            return
        end
        
        local currentSetpoint = tonumber(jsonThermostatInfo.currentSetpoint) / 100
        local currentTemperature = tonumber(jsonThermostatInfo.currentTemp) / 100
        local currentProgramState = tonumber(jsonThermostatInfo.programState)
        local currentActiveState = tonumber(jsonThermostatInfo.activeState)
        local currentNextTime = jsonThermostatInfo.nextTime
        local currentNextSetPoint = tonumber(jsonThermostatInfo.nextSetpoint) / 100
        local currentBoiletSetPoint = jsonThermostatInfo.currentInternalBoilerSetpoint
        

            domoticz.devices(ToonThermostatSensorName).updateSetPoint(currentSetpoint).silent()
        

	end
}
And this script is triggered by the thermostat:

Code: Select all

return {
	on = {
		devices = {
			'Toon Thermostat'
		}
	},
	execute = function(domoticz, device)
		domoticz.openURL(string.format('http://%s/happ_thermstat?action=setSetpoint&Setpoint=%s', domoticz.variables('UV_ToonIP').value, device.SetPoint*100))
				domoticz.log('Setting Toon setpoint to '.. device.SetPoint)
	end
}
In my log:
Image


I get the nil value error, and the device script is triggered..

Re: dzVents 2.3.0 released in v3.8551

Posted: Monday 09 October 2017 19:35
by dannybloe
Ah.. yeah.. setpoint updating still uses OpenURL and that doesn't support this. There was a bug that caused a timeout in Domoticz if you use the normal UpdateDevice command in the command array.. hence the openURL work around. Perhaps you can try if the commandArray route still gives this problem. Otherwise we could remove that need.

Re: dzVents 2.3.0 released in v3.8551

Posted: Monday 09 October 2017 19:47
by Maes
I converted this script from normal Lua.
I had the same problem with commandArray, so I temporarily set a user variable "IsChanged" to 1. The other script would then check if the variable was set to 1 before executing..

Re: dzVents 2.3.0 released in v3.8551

Posted: Monday 09 October 2017 19:54
by dannybloe
Maes wrote: Monday 09 October 2017 19:47 I converted this script from normal Lua.
I had the same problem with commandArray, so I temporarily set a user variable "IsChanged" to 1. The other script would then check if the variable was set to 1 before executing..
The question was more if the old standing bug in Domoticz when doing an UpdateSetPoint was still active. If you use the old commandArray approach you can try to add TRIGGER to the command-string. That is was .silent() actually does under the hood when doing device updates.

Re: dzVents 2.3.0 released in v3.8551

Posted: Tuesday 10 October 2017 13:05
by Maes
I'm not familiar with this TRIGGER keyword. I also don't know how to combine the commandarray with the DzVents functionality.
I've added the user variable check I've talked about earlier back in the script to prevent the other script from executing, but it's not really efficient.
Perhaps adding .silent() to setPoint() could be a new feature? :)

Re: dzVents 2.3.0 released in v3.8551

Posted: Tuesday 07 November 2017 21:26
by MaikelK
Hi Guys,

I cant seem to get dZvents running, same for EventSystem (Lua/Blockly/Scripts).
If i change the slider to enabled, and press apply settings nothing happens.

Going to the Settings page is also really slow.

I recently updated my RPI2 to Jessie and now running Domoticz V3.8703

Re: dzVents 2.3.0 released in v3.8551

Posted: Sunday 12 November 2017 20:36
by Derik
Dear all..
Is there some one that can make dzvent working for my P1 actual
I try to get a script for my P1, when i deliver back to to the net, with my solar panels.

With blockley i cannot go to minus..

So what i an looking for:
When time is between x and y
when p1 actual is -500 and dummy X is off, switch dummy X on.
when p1 actual is >500 and dummy X is on, switch dummy off

Only i do not understand the dzvents script..
So hope someone help me.
xxx

Re: dzVents 2.3.0 released in v3.8551

Posted: Monday 13 November 2017 8:56
by emme
uhm.. let's try:

Code: Select all

return {
	on = {
		timer = {
			'between x and y'
		},
		devices = {
			'P1'
		},
	},
	execute = function(domoticz, devP1)
	    local dummy = domoticz.devices('dummy')
		if tonumber(devP1.rawData[1]) > 500 and dummy.state == 'Off' then 
		    dummy.switchOn()
		elseif tonumber(devP1.rawData[1]) < -500 and dummy.state == 'On' then 
		    dummy.switchOff()
		end 
	end
}
I'm using rawData since I'm unsure what kind of device P1 is :P :P
ciao
M

P.S.
we can clean the code by not chasing the dummy switch state:

Code: Select all

		if tonumber(devP1.rawData[1]) > 500 then 
		    dummy.switchOn().checkFirst()
		elseif tonumber(devP1.rawData[1]) < -500  then 
		    dummy.switchOff().checkFirst()
		end 

Re: dzVents 2.3.0 released in v3.8551

Posted: Monday 13 November 2017 10:19
by dannybloe
Guys, let's stick to the topic and post questions in a new separate thread in the forum.

Re: dzVents 2.3.0 released in v3.8551

Posted: Monday 13 November 2017 20:10
by Derik
make a new start:

Hope you all will help me there...
http://domoticz.com/forum/viewtopic.php ... 52#p157552


THANKS