Jump to content
  • 0

Sleep function cvaction

Question

hi, I would like to install a sleep function in the cvaction. How does this work? The light should stay on for e.g. 3 minutes and then slowly go out
I've tried it before but somehow it doesn't work. See pictures. Thanks.

 

# Philips Hue: Licht ausschalten

sleep://3500
http://192.168.178.33/api/wsltUbHQbdnDhDEidaNJQg2s85Nv9OldLPE6TYeT/groups/Wand/action
PUT: { "on": false, "transitiontime": 500 }

 

 


 

 

image.jpeg

Edited by acid303
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Thx. The light should stay on for e.g. 3 minutes and then slowly go out. Is there a possibility? I have a single file with curtains up and advertising. Now the action file should be set first and, for example, leave the light on for 3 minutes and then it should slowly turn off. Hope you understand that.

Edited by acid303
Link to comment
Share on other sites

  • 0
  • Administrator

If you want the sleep to be 3 minutes, that would be:

sleep://180000

It is measured in milliseconds.

Your script currently just turns off the light.  I'm not sure if it is being turned on elsewhere or not.  To turn it on, you'd need to add some variation of the following prior to the sleep command:

http://<bridge ip address>/api/<username>/groups/<group name>/action
PUT:{"on":true,"bri":100,"transitiontime":30}

 

 

Link to comment
Share on other sites

  • 0

First of all, thank you for your help.
I have now written it the way you recommended. but the light just stays on. I thought it would stay on for 3 minutes and then slowly go off.

# Philips Hue

sleep://180000

http://192.168.178.33/api/wsltUbHQbdnDhDEidaNJQg2s85Nv9OldLPE6TYeT/groups/Wand/action
PUT:{"on":true,"bri":100,"transitiontime":30}

Link to comment
Share on other sites

  • 0
  • Administrator

The code you have turns it on.


http://192.168.178.33/api/wsltUbHQbdnDhDEidaNJQg2s85Nv9OldLPE6TYeT/groups/Wand/action
PUT:{"on":true,"bri":100,"transitiontime":1}

sleep://180000

http://192.168.178.33/api/wsltUbHQbdnDhDEidaNJQg2s85Nv9OldLPE6TYeT/groups/Wand/action
PUT: { "on": false, "transitiontime": 500 }

To test it, start with 1 section of code to turn it on or off and make sure that works before adding anything else.  You want to make sure that the base code works in your system before adding additional elements to it.

Link to comment
Share on other sites

  • 0
On 9/14/2024 at 6:23 PM, acid303 said:

First of all, thank you for your help.
I have now written it the way you recommended. but the light just stays on. I thought it would stay on for 3 minutes and then slowly go off.

# Philips Hue

sleep://180000

http://192.168.178.33/api/wsltUbHQbdnDhDEidaNJQg2s85Nv9OldLPE6TYeT/groups/Wand/action
PUT:{"on":true,"bri":100,"transitiontime":30}

Du hast hier den Befehl zum Anschalten, statt zum ausschalten verwendet. In der Klammer das "on": beschreibt den Zustand der Lampe, der hergestellt werden soll. "On": true bedeutet übersetzt "an": wahr, damit wird das Licht also angeschaltet. "On": false bedeutet "an": falsch und schaltet das Öicht dementsprechend aus. Dein Befehl muss also so aussehen:

# Philips Hue

sleep://180000

http://192.168.178.33/api/wsltUbHQbdnDhDEidaNJQg2s85Nv9OldLPE6TYeT/groups/Wand/action
PUT:{"on": false, "bri": 100, "transitiontime":30}

(Die Leerzeichen müsstest du nochma prüfen; "bri" steht für brightness, also Helligkeit und kann beim Ausschalten auch weggelassen werden)

Matt empfiehlt dir, Schritt für Schritt vorzugehen und erstmal den Basic Lichtaus Befehl in Gang zu setzen und dann nach und nach die Spezifizierungen wie Zeitverzögerung hinzuzufügen. Dann findest du den Fehler leichter

Edited by marius
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • 0

 Share

×
×
  • Create New...