On the pc I habe MCE Controller running.
The following lua code was run by vera in a scene and it worked.
Code: Select all
function shutDown(host)
local socket = require("socket")
c = assert(socket.connect(host, 5150))
c:send("hibernate\r")
c:close()
end
luup.call_delay("shutDown", 0, "192.168.0.3")
I made a scene that runs this script (On Action: script://Computer_shutdown.lua)
the log shows this:
2020-07-31 20:36:36.889 Status: User: Admin initiated a scene/group command
2020-07-31 20:36:37.101 Status: Executing script: /home/pi/domoticz/scripts/Computer_shutdown.lua
2020-07-31 20:36:37.121 Error: Error executing script command (/home/pi/domoticz/scripts/Computer_shutdown.lua). returned: 32256
I don't have any knowledge about lua programming. I found this code on the vera forum and used it.
Do you have any suggestions?
Greets
paede