Well....
I've spent half a day spilling time, enjoying to program.
Little has come out of it.
Code: Select all
2023-01-12 19:00:00.347 Status: dzVents: Info: test: ------ Start internal script: test:, trigger: "every minute"
2023-01-12 19:00:00.365 Status: dzVents: Debug: test: Processing device-adapter for Screen 3: Switch device adapter
2023-01-12 19:00:00.365 Status: dzVents: Info: test: here we are at the start of the function
2023-01-12 19:00:00.365 Status: dzVents: Info: test: Closed
2023-01-12 19:00:00.365 Status: dzVents: Info: test: Screen 3 is Closed
2023-01-12 19:00:00.365 Status: dzVents: Info: test: Closed
2023-01-12 19:00:00.365 Status: dzVents: Info: test: ------ Finished test
2023-01-12 19:00:00.365 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2023-01-12 19:01:00.359 Status: dzVents: Info: test: ------ Start internal script: test:, trigger: "every minute"
2023-01-12 19:01:00.376 Status: dzVents: Debug: test: Processing device-adapter for Screen 3: Switch device adapter
2023-01-12 19:01:00.376 Status: dzVents: Info: test: here we are at the start of the function
2023-01-12 19:01:00.376 Status: dzVents: Info: test: unforeseen situation
2023-01-12 19:01:00.377 Status: dzVents: Info: test: ------ Finished test
The above log shows that one can influence the properties of a Blinds switch, one cannot change it from Open to Close or the other way round.
One can 'empty' the switch.

- open.jpg (15.26 KiB) Viewed 1156 times

- closed.jpg (14.11 KiB) Viewed 1156 times

- empty.jpg (14.2 KiB) Viewed 1156 times
Here is some code with which I tested.
Code: Select all
local SCREEN_3 = 'Screen 3' -- switch device
return {
active = true,
on = {
timer = { 'every minute' }, -- every minute for testing, 10 minutes when active
--devices = {'Screen 3'},
},
logging =
{
-- level: This is the log level you want for this script.
-- Can be domoticz.LOG_INFO, domoticz.LOG_MODULE_EXEC_INFO, domoticz.LOG_DEBUG or domoticz.LOG_ERROR
-- marker: A string that is prefixed before each log message.
level = domoticz.LOG_INFO and domoticz.LOG_DEBUG,
--level = domoticz.LOG_INFO,
marker = "test",
},
execute = function(dz, item)
local screen_state = dz.devices(SCREEN_3).state
dz.log('here we are at the start of the function', dz.LOG_INFO)
dz.log(screen_state, dz.LOG_INFO)
if screen_state == 'Closed' then
dz.log('Screen 3 is Closed', dz.LOG_INFO)
dz.log(screen_state, dz.LOG_INFO)
dz.devices(SCREEN_3).update()
elseif (screen_state == 'Open') then
dz.log('Screen 3 is Open', dz.LOG_INFO)
dz.log(screen_state, dz.LOG_INFO)
dz.devices(SCREEN_3).update()
elseif (screen_state ~= 'Closed') or (screen_state ~= 'Open') then
dz.log('unforeseen situation', dz.LOG_INFO)
dz.log(screen_state, dz.LOG_INFO)
end
end
}
You can test for yourself by creating a dummy switch which you can transform to a blinds switch.
It doesn't have to have a relationship with any existing device.
The positive side of this that I now can check the answer the Shelly device gives me and when that answer is not equal to the Domoticz state of the device one can make the switch aspect change to empty.
BTW
The silent() option triggers action
EDIT
After struggling many hours and publishing the above text I tried one last.
quietOn() and quietOff
That's it, nothing more, nothing less
Bugs bug me.