Webhook: Pass value to card

Hi all,

I want to build a webhook which sets the volume of my Sonos speakers, so I can put it on my iOS Homescreen for quick access. In general it workes with a HTTP Request card.

But now I want to make it a bit more intelligent and pass a value (for the volume) to the Sonos volume card. However the value comes as string and not as number which for sure cannot be processed by the Sonos card. Is there any way to convert it from string to number? I want to avoid to have to create somewhat like 10 flows for each volume I would like to have. :slight_smile:

Johannes

Hi, I have a similar solution. Slightly different because I don’t pass a value to homey. I have 2 flows which react on receiving an webhook. One flow increases the volume of my sonos with 0.05. The other one decreases the volume by 0.05

I solved this with a simple implementation in the Micro WebServer app.

What did you do there?

Check this.

Ok, actually quite simple to do. So hope this helps someone. When you set a value dynamically in a Sonos card, you have to provide it in the range of 0.01 and 1.0. (Carefull: 1 is very loud ;-))

So if you want to set it to 10 % you need this URL:
https://<HOMEYCLOUDID>.connect.athom.com/api/app/com.internet/sonos-volume/0.10

And then you can use the tag in the Sonos card. Under AND you could even add a check that the value is below a certain number, for me I set it to 0.51 to prevent your speakers from blaring in case you go over 50 %. :wink:

Sharing the flow here: https://homey.app/f/FlBK3k

Johannes

Error corrected, it has to be the Homey Cloud ID.

1 Like