I have a Lutron pico remote to control a ceiling fan light. The two buttons are obviously light on and light off. I have shell commands defined in my configuration.yaml as follows:
When this code is called it works sometimes. I can verify that the button is recognised via announcements. The button is recognise on every single press but I might have to push the button maybe three times to get the light to turn on.
Could anyone explain how it’s possible that the curl command when executed via the debugger works 100% of the time but when executed via the automation only works 30% of the time?
I really appreciate you going to all the effort of showing me the code like this. Unfortunately, the rest command is working the same as the curl command. That is to say, inconsistently. It works 100% of the time from the debugger but only occasionally when I actually push the button.
I have. It is executing as expected. I have a few HA Voice modules and they announce the button presses in the automation. In the Turn On condition, the rest call is first made then the announcement of which button was pushed is made. Every button push results in an announcement and no errors are generated.
I am pleased to say that the problem is solved! Thanks to the post by WarLion it got me to thinking about delays. When I redid the automation adding a 1 sec delay before and after the shell call I found it worked every time! I am still playing around to see if I need both delays or just one and how long it needs to be. But at least the buttons work every time now!
Update: The delay after the shell command call is unnecessary. A one sec delay before the call is the key.