Page 1 of 1
dimTo doesn't work ? (Bug ?)
Posted: Sunday 02 December 2018 21:48
by HFman
I wrote a small script to set my fan.
in DzVents I can switch the "slider" on and off by :
domoticz.devices('Ventilator').switchOn()
But setting the slider to a percentage :
domoticz.devices('Ventilator').dimTo(35)
Doesn't work. I doesn't give an error, but no updates to the slider.
Any clue ?
Re: dimTo doesn't work ? (Bug ?)
Posted: Sunday 02 December 2018 21:53
by waaren
HFman wrote: ↑Sunday 02 December 2018 21:48
setting the slider to a percentage : domoticz.devices('Ventilator').dimTo(35) does not work
Can you enter this in your script and show us the loglines ? That might help to understand what happens.
Code: Select all
domoticz.devices('Ventilator').dump()
Re: dimTo doesn't work ? (Bug ?)
Posted: Sunday 02 December 2018 22:31
by HFman
Please see below :
Seems the value sticks to 100%...?
018-12-02 22:28:00.177 Status: dzVents: > idx: 208
2018-12-02 22:28:00.177 Status: dzVents: > kodiSwitchOff()
2018-12-02 22:28:00.177 Status: dzVents: > kodiPause()
2018-12-02 22:28:00.177 Status: dzVents: > updateWeight()
2018-12-02 22:28:00.177 Status: dzVents: > updateAirQuality()
2018-12-02 22:28:00.177 Status: dzVents: > isVariable: false
2018-12-02 22:28:00.177 Status: dzVents: > isTimer: false
2018-12-02 22:28:00.177 Status: dzVents: > updateUV()
2018-12-02 22:28:00.177 Status: dzVents: > kodiExecuteAddOn()
2018-12-02 22:28:00.177 Status: dzVents: > icon: dimmer
2018-12-02 22:28:00.177 Status: dzVents: > updateVisibility()
2018-12-02 22:28:00.177 Status: dzVents: > kodiPlay()
2018-12-02 22:28:00.177 Status: dzVents: > updateTempHum()
2018-12-02 22:28:00.177 Status: dzVents: > pause()
2018-12-02 22:28:00.177 Status: dzVents: > updateTempBaro()
2018-12-02 22:28:00.177 Status: dzVents: > updateSoundLevel()
2018-12-02 22:28:00.177 Status: dzVents: > updateDistance()
2018-12-02 22:28:00.177 Status: dzVents: > updateSoilMoisture()
2018-12-02 22:28:00.177 Status: dzVents: > updateGas()
2018-12-02 22:28:00.177 Status: dzVents: > _data:
2018-12-02 22:28:00.177 Status: dzVents: > switchTypeValue: 7
2018-12-02 22:28:00.177 Status: dzVents: > description:
2018-12-02 22:28:00.177 Status: dzVents: > switchType: Dimmer
2018-12-02 22:28:00.177 Status: dzVents: > deviceType: Light/Switch
2018-12-02 22:28:00.178 Status: dzVents: > batteryLevel: 255
2018-12-02 22:28:00.178 Status: dzVents: > signalLevel: 12
2018-12-02 22:28:00.178 Status: dzVents: > lastLevel: 100
2018-12-02 22:28:00.178 Status: dzVents: > lastUpdate: 2018-12-02 22:27:00
2018-12-02 22:28:00.178 Status: dzVents: > changed: false
2018-12-02 22:28:00.178 Status: dzVents: > rawData:
2018-12-02 22:28:00.178 Status: dzVents: > 1: 100
2018-12-02 22:28:00.178 Status: dzVents: > subType: Switch
2018-12-02 22:28:00.178 Status: dzVents: > deviceID: 00014120
2018-12-02 22:28:00.178 Status: dzVents: > name: Ventilator
2018-12-02 22:28:00.178 Status: dzVents: > timedOut: false
2018-12-02 22:28:00.178 Status: dzVents: > baseType: device
2018-12-02 22:28:00.178 Status: dzVents: > data:
2018-12-02 22:28:00.178 Status: dzVents: > _state: On
2018-12-02 22:28:00.178 Status: dzVents: > usedByCamera: false
2018-12-02 22:28:00.178 Status: dzVents: > protected: false
2018-12-02 22:28:00.178 Status: dzVents: > icon: dimmer
2018-12-02 22:28:00.178 Status: dzVents: > unit: 1
2018-12-02 22:28:00.178 Status: dzVents: > levelVal: 100
2018-12-02 22:28:00.178 Status: dzVents: > _nValue: 1
2018-12-02 22:28:00.178 Status: dzVents: > hardwareType: Dummy (Does nothing, use for virtual switches only)
2018-12-02 22:28:00.178 Status: dzVents: > hardwareTypeValue: 15
2018-12-02 22:28:00.178 Status: dzVents: > hardwareName: Dummy_var
2018-12-02 22:28:00.178 Status: dzVents: > maxDimLevel: 100
2018-12-02 22:28:00.178 Status: dzVents: > hardwareID: 10
2018-12-02 22:28:00.178 Status: dzVents: > id: 208
2018-12-02 22:28:00.178 Status: dzVents: > cancelQueuedCommands()
2018-12-02 22:28:00.178 Status: dzVents: > setDiscoMode()
2018-12-02 22:28:00.178 Status: dzVents: > isHTTPResponse: false
2018-12-02 22:28:00.178 Status: dzVents: > nValue: 1
2018-12-02 22:28:00.178 Status: dzVents: > _nValue: 1
2018-12-02 22:28:00.178 Status: dzVents: > timedOut: false
2018-12-02 22:28:00.178 Status: dzVents: > setKelvin()
2018-12-02 22:28:00.178 Status: dzVents: > updatePressure()
2018-12-02 22:28:00.178 Status: dzVents: > decreaseBrightness()
2018-12-02 22:28:00.178 Status: dzVents: > armAway()
2018-12-02 22:28:00.178 Status: dzVents: > updateBarometer()
2018-12-02 22:28:00.179 Status: dzVents: > hardwareID: 10
2018-12-02 22:28:00.179 Status: dzVents: > disarm()
2018-12-02 22:28:00.179 Status: dzVents: > updatePercentage()
2018-12-02 22:28:00.179 Status: dzVents: > updateRain()
2018-12-02 22:28:00.179 Status: dzVents: > setNightMode()
2018-12-02 22:28:00.179 Status: dzVents: > increaseBrightness()
2018-12-02 22:28:00.179 Status: dzVents: > updateSetPoint()
2018-12-02 22:28:00.179 Status: dzVents: > updateP1()
2018-12-02 22:28:00.179 Status: dzVents: > isSecurity: false
2018-12-02 22:28:00.179 Status: dzVents: > update()
2018-12-02 22:28:00.179 Status: dzVents: > hardwareId: 10
2018-12-02 22:28:00.179 Status: dzVents: > hardwareTypeValue: 15
2018-12-02 22:28:00.179 Status: dzVents: > startPlaylist()
2018-12-02 22:28:00.179 Status: dzVents: > armHome()
2018-12-02 22:28:00.179 Status: dzVents: > updateWind()
2018-12-02 22:28:00.179 Status: dzVents: > active: true
2018-12-02 22:28:00.179 Status: dzVents: > changed: false
2018-12-02 22:28:00.179 Status: dzVents: > playFavorites()
2018-12-02 22:28:00.179 Status: dzVents: > setVolume()
2018-12-02 22:28:00.179 Status: dzVents: > hardwareName: Dummy_var
2018-12-02 22:28:00.179 Status: dzVents: > rawData:
2018-12-02 22:28:00.179 Status: dzVents: > 1: 100
2018-12-02 22:28:00.179 Status: dzVents: > switchOff()
2018-12-02 22:28:00.179 Status: dzVents: > isGroup: false
2018-12-02 22:28:00.179 Status: dzVents: > updateWetness()
2018-12-02 22:28:00.179 Status: dzVents: > levelVal: 100
2018-12-02 22:28:00.179 Status: dzVents: > updateRadiation()
2018-12-02 22:28:00.179 Status: dzVents: > setRGB()
2018-12-02 22:28:00.179 Status: dzVents: > updateCounter()
2018-12-02 22:28:00.179 Status: dzVents: > id: 208
2018-12-02 22:28:00.179 Status: dzVents: > description:
2018-12-02 22:28:00.179 Status: dzVents: > stop()
Re: dimTo doesn't work ? (Bug ?)
Posted: Monday 03 December 2018 8:12
by waaren
HFman wrote: ↑Sunday 02 December 2018 22:31
Please see below :
Seems the value sticks to 100%...?
I don't see all the values I expected in the dump. Some lines seem to be missing.
As alternative can you merge this into your script and change the 250 to the device IDX of your dimmer
Code: Select all
logging = { level = domoticz.LOG_DEBUG,
marker = 'Dumper'
},
execute = function(domoticz, item)
local dimmer = domoticz.devices(250)
domoticz.log("dimmer.deviceType : " .. tostring(dimmer.deviceType) ,domoticz.log_DEBUG)
domoticz.log("dimmer.switchType : " .. tostring(dimmer.switchType) ,domoticz.log_DEBUG)
domoticz.log("dimmer.maxDimLevel : " .. tostring(dimmer.maxDimLevel) ,domoticz.log_DEBUG)
domoticz.log("dimmer.lastLevel : " .. tostring(dimmer.lastLevel) ,domoticz.log_DEBUG)
domoticz.log("dimmer._adapters[1] : " .. tostring(dimmer._adapters[1]) ,domoticz.log_DEBUG)
domoticz.log("dimmer._adapters[2] : " .. tostring(dimmer._adapters[2]) ,domoticz.log_DEBUG)
domoticz.log("dimmer.hardwareTypeValue: " .. tostring(dimmer.hardwareTypeValue),domoticz.log_DEBUG)
domoticz.log("dimmer.switchTypeValue : " .. tostring(dimmer.switchTypeValue) ,domoticz.log_DEBUG)
end
Please note that the new value of the dimmer will not be shown during the execution of the script. This value is passed from domoticz to the script and will only be changed after the script has finished.
Can you show us your complete script and the loglines of it ?
Re: dimTo doesn't work ? (Bug ?)
Posted: Monday 03 December 2018 8:14
by dannybloe
Best is to see the log from the command-line as the web version of the log (in the GUI) seems to miss entries every now and then.
Re: dimTo doesn't work ? (Bug ?)
Posted: Wednesday 05 December 2018 22:16
by HFman
Figured it out.. silly one.. i guess..
execute = function(domoticz,Ventilator) didn't add Ventilator here...
After adding all works likes expected....
But still wondering why
domoticz.devices('Ventilator').switchOn() works..
and
domoticz.devices('Ventilator').dimTo(35) not ?