This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

Tell Homey how many times to press a button

 

I asked this question about a year ago but that was before I received my Homey and before I knew what flows were capable of. Unfortunately, I'm still stuck!

I am trying to create a flow to control the volume on my AV system. It's a Sony HT-IS 100 and therefore controlled by infrared. I am severely disabled, so I need to be able to do this by voice.

Ideally, I'd like to be able to say, 'volume up [number]' and this would trigger the 'repeatedly press button' card the correct number of times, but I can't see an obvious way to do this.

Of course, I could always create a separate flow for each number of button presses but that seems really clumsy, and I'm sure Homey is more sophisticated than that!

I feel sure there's a simple way to do this – perhaps using logic cards and flow triggers – but I can't find it… Any ideas, anyone?

On a completely separate issue: I've got 20/20 vision but I find the current trend for using very pale grey text on a white background really irritating! In the flow editor the text on the cards is annoyingly difficult to read…… Is it just me?

PS yes, I am old.
PPS yes, I am grumpy.

Dom.

Comments

  • While I do not know a definite answer, you could look into a flow-system set up like this:

    Flow 1: Set a variable ('ClickAmount') to a specified number (let's say 5)
    Flow 2: If ClickAmount has changed and ClickAmount is above 0, then do something (click your button) and set variable ClickAmount to {{$ClickAmount}}-1.

    Now flow 2 will be repeated 5 times.

    However, I do not know an easy way to change flow 1 in such a way that it can respond to different numbers in speech.
  • Better logic has some JavaScript-like scripting which you might use.

    I agree with you that picking out parts of a sentence and interpreting it is not very straightforward. The potential is there, but it is difficult to offer it in a consumer friendly flow-card. 
  • Thanks for your quick replies!

    I'm afraid I don't know anything about JavaScript but I'm a little disappointed that on the 'repeatedly press button' card the 'how many times?' field isn't a variable.

     

    Unless I can find a workaround I can't set up Homey as the all-round voice controlled assistant I was hoping for,

     

    Dom

  • WRosWRos Member
    edited March 2017
    Hi @Dom2061
    I think there is a solution for your challenge.
    To catch the volume number from a voice command, you use: https://apps.athom.com/app/openmindnl.numcatch
    In the following example I show a For ... While loop. (Not really clearly)
    https://forum.athom.com/discussion/936/positive-flows-that-work#Comment_47259
    So you didn't use the number of presses, but start the flow a times with the For... While Loop
  • Hello WRos,

    thank you very much for your help: this really does look like it may be the answer!

     

    I will have to wait until the speech improves before I can fully try this out, but I have an EchoDot on order so hopefully it won't be too long.

     

    Thanks once again,

    Dom.

Sign In or Register to comment.