Triggering Moods in WebAPI

Hi All, I’m experimenting with moods using the WebAPI and HomeyScript. When writing HomeyScript, there should be a method to trigger a mood, as you can see below.

However, when using the method, it says that ‘triggerMood’ is not a function. There is also zero documentation about it in the WebAPI documentation. That is strange, as the getMoods() method works just fine in the same manner as above, which is also not further documented.

Any ideas on how to move forward here?

Thanks in advance!

The method to set a mood is setMood (found by using Object.getOwnPropertyNames(Homey.moods)), but HomeyScript doesn’t have the correct permissions to use it:

Apparently, you can’t be trusted on your own Homey :man_shrugging:t3:

The HS editor apparently isn’t up-to-date so suggests a method (triggerMood) that doesn’t exist (anymore).

Thanks for the reply @robertklep! Strange indeed that some mood.x methods are allowed, and some are not. I hope they’ll fix this.

Setting a mood is of course a very dangerous action, which could cause all of your lights change color!
Athom prevents Homey owners from these kind of disasters for a reason! :face_with_peeking_eye::face_with_peeking_eye::face_with_peeking_eye::joy::winking_face_with_tongue:

Not if you don’t request it at Support :wink:

1 Like

Small update:

The setMood() method does work when you try it in the WebAPI playground. I can actually see my lights changing.

I’m a bit new to this whole forum thing. How do I show this to support / feature request?
Thanks!

Yea, the playground has no restrictions AFAIK.