turn on for x minutes

Moderator: leecollings

Post Reply
vespino
Posts: 49
Joined: Tuesday 05 August 2014 14:41
Target OS: Linux
Domoticz version:

turn on for x minutes

Post by vespino »

Using the following API endpoint I turn one of my lights on: json.htm?type=command&param=switchlight&idx1&switchcmd=On

Is it possible to turn it on for x minutes using the API?
jannl
Posts: 638
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: turn on for x minutes

Post by jannl »

If you call it form a script, a simple wait or sleep or (depending on the language) coud do the trick.

ie
ON
sleep (xxx)
Off
vespino
Posts: 49
Joined: Tuesday 05 August 2014 14:41
Target OS: Linux
Domoticz version:

Re: turn on for x minutes

Post by vespino »

Yes that is what I'm doing now, but there's no way to do it using the API then?
User avatar
waltervl
Posts: 5378
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: turn on for x minutes

Post by waltervl »

The application that sends that Domoticz API call should handle that....
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waltervl
Posts: 5378
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: turn on for x minutes

Post by waltervl »

jannl wrote: Wednesday 20 November 2024 16:18 If you call it form a script, a simple wait or sleep or (depending on the language) coud do the trick.

ie
ON
sleep (xxx)
Off
Never use a sleep in Domoticz scripts.
in dzvents use command options https://wiki.domoticz.com/DzVents:_next ... riggering)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
vespino
Posts: 49
Joined: Tuesday 05 August 2014 14:41
Target OS: Linux
Domoticz version:

Re: turn on for x minutes

Post by vespino »

I'm using PHP so it's easy to wait the number of seconds I want, but it requires an extra call to the API that's why I was hoping it was an option in the API but if not I'm gonna go with that. Cheers.
User avatar
waltervl
Posts: 5378
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: turn on for x minutes

Post by waltervl »

The Api is developed as interface between the Web User interface and the Domoticz Core application. So every action you do on the web UI results in one or more API calls. So Domoticz core is ready to handle multiple API calls ;-)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest