what I did
via ssh
Code: Select all
sqlite3 domoticz.db "select ID from DeviceStatus order by Name" > /tmp/DeviceID.txt
via windows
get the file to Excel (via ftp) like this in column F
copy / paste column A to notepad
you get something like this
Code: Select all
sqlite3 domoticz.db "UPDATE DeviceStatus SET [Order]=1176 WHERE ID=1919"
sqlite3 domoticz.db "UPDATE DeviceStatus SET [Order]=1178 WHERE ID=1918"
sqlite3 domoticz.db "UPDATE DeviceStatus SET [Order]=1180 WHERE ID=1917"
sqlite3 domoticz.db "UPDATE DeviceStatus SET [Order]=1182 WHERE ID=2734"
sqlite3 domoticz.db "UPDATE DeviceStatus SET [Order]=1184 WHERE ID=2718"
via ssh
stop dz
bk the database in an other file
copy / paste the notepad to the command line to execute all the sql orders
restart dz
done!