zanna1972 wrote: ↑Monday 08 March 2021 21:48
Type=General
Subtype=thermostat mode
Can you run below script to identify the details of this device?
It might help to find the right API call for it.
Code: Select all
return
{
on =
{
timer =
{
'at 17:32', -- change to the time you want to dump the attributes of the device
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'dumpAttributes',
},
execute = function(dz)
local myDevice = dz.devices(1656) -- your device idx
-- if you don't have sqlite3 yet on your system install it with sudo apt install sqlite3
local sqlite = '/usr/local/bin/sqlite3' -- find your sqlite3 location with "which sqlite3" and change here accordingl
local function dumpAttributes(dv)
dz.log(dv.idx .. ': ' .. dv.name .. ': attribute -> value',dz.LOG_FORCE)
dz.log(dv.idx .. ': ' .. dv.name .. ': -- dzVents',dz.LOG_FORCE)
dz.log(dv.idx .. ': ' .. dv.name .. ': type, subType -> ' .. dv.deviceType .. ', '.. tostring(dv.deviceSubType),dz.LOG_FORCE)
dz.log(dv.idx .. ': ' .. dv.name .. ': switchTypeValue -> ' .. dv.switchTypeValue ,dz.LOG_FORCE)
dz.log(dv.idx .. ': ' .. dv.name .. ': adapters -> ' .. dz.utils._.str(dv._adapters),dz.LOG_FORCE)
dz.log(dv.idx .. ': ' .. dv.name .. ': rawData -> ' .. dz.utils._.str(dv.rawData),dz.LOG_FORCE)
dz.log(dv.idx .. ': ' .. dv.name .. ': hwType -> ' .. dv.hardwareType .. ', ' .. dv.hardwareTypeValue,dz.LOG_FORCE)
dz.log(dv.idx .. ': ' .. dv.name .. ': levelNames -> ' .. dz.utils._.str(dv.levelNames),dz.LOG_FORCE)
dz.log(dv.idx .. ': ' .. dv.name .. ': modes -> ' .. dz.utils._.str(dv.modes),dz.LOG_FORCE)
end
local function dumpDeviceStatus(dv)
local sqlResult, result = dz.utils.osCommand('sudo ' .. sqlite .. ' ' .. '-header domoticz.db "select * from deviceStatus where id = ' .. dv.idx .. '"')
if result ~= 0 then
dz.log('Result: ' .. result, dz.LOG_ERROR)
else
sqlResult = dz.utils.stringSplit(sqlResult,'\n')
local header = dz.utils.stringSplit(sqlResult[1],'|')
local values = dz.utils.stringSplit(sqlResult[2],'|')
dz.log(dv.idx .. ': ' .. dv.name .. ': field -> value',dz.LOG_FORCE)
dz.log(dv.idx .. ': ' .. dv.name .. ': -- database',dz.LOG_FORCE)
for index, attribute in ipairs(header) do
dz.log(dv.idx .. ': ' .. dv.name .. ': ' .. dz.utils.rightPad(( attribute or '') ,15) .. ' -> ' .. ( values[index] or 'nil') ,dz.LOG_FORCE)
end
end
end
dumpAttributes(myDevice)
dz.log('',dz.LOG_FORCE)
dumpDeviceStatus(myDevice)
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>>
dzVents wiki