Homey Community Forum

A volume button for my chromecast

#1

Description of the flow (what are you trying to achieve)
The chromecast does not have a volume up/ down option, just a set volume option.
These flows turn my hue switch into a volume button
What is needed to create this flow?
The hue app (or any other app that support a button): https://apps.athom.com/app/nl.philips.hue
The chromecast app: https://apps.athom.com/app/com.google.chromecast
The better logic app: https://apps.athom.com/app/net.i-dev.betterlogic
The Virtual devices app, to create an On/Off setting for the radio:https://apps.athom.com/app/com.arjankranenburg.virtual

1 in Better Logic I created a new variable “Radio SetNewVolume”
2 in virtual devices create a botton “playing”
3 the 1st flow is triggered when the radio is switched on (virtual device “playing”=ON)
This flow sets the chromecast speaker volume and casts a radio station.
For the purpose of the volume buttons a better logic card is added that sets the better logic variable “Radio SetNewVolume” equal to the chromecast volume

Two flows are needed to trigger the louder or softer:
When the hue buton is pressed
A better logic card increases or decreaes the variable “Radio SetNewVolume”
image
Update: a small improvement to the flow. The increase card sometimes results in a multi digit number (0.400000001). Chromecast cannot handle these numbers, so the button becomes unresponsive.
So changed the card to a math card that rounds to 1 decimal:
image


A 3rd flow is triggered by a better logic card that checks if the variable “Radio SetNewVolume” has changed. The “THEN” card set the volume of he chrimecast to the variable “Radio SetNewVolume” (drag the tag into the card)

There is a reason why this is a seperate flow!!
If you would add the chromecast volumechange to the louder/softer flow you have an issue:
The “AND” card set the new variable and the 2nd “AND “ card sets the chromecast volume. BUT it happens at the same time, so you cannot be sure that the value has been updated 1st.
I tried to solve that by putting a delay on the chromecard setvolume card.
That works… until you press the volume button multiple times to increase the volume fast. It will only update every second and you can press much faster.
The 3rd flow per definition triggers AFTER the variable is updated and works fine

3 Likes
Volume Sonos instellen via afstandsbediening
How to Programm a Dimmer / AEOTEC Wallmote
#2

Update: a small improvement to the flow. The increase card sometimes results in a multi digit number (0.400000001). Chromecast cannot handle these numbers, so the button becomes unresponsive.
So changed the card to a math card that rounds to 1 decimal:
image

Wie benutze ich Logic
#3

what a handy application. I’m going to try this. I think it would be nice to make a video about this

#4

I have tried out your flow idea and it really works great. I immediately made an explanation video of it. it will be online on my YouTube channel this week. Kanaal: Homeycornelisse

Linkje naar Video: Klik hier

#5

Thanks,
Theres one thing I did not figure out yet.

When look at the “volume” tag for chromecast the volume setting is correct.
But when I change the chromecast volume from a device outside homey (e.a google home app) then homey does not show that chance.

I want to force homey into updating that value so I can change volume using both devices…