Occasional wrong states on pico button press
See original GitHub issueNot sure how to best troubleshoot this.
Seemingly randomly some of my pico remotes will stop working correctly. These remotes aren’t paired to an actual caseta dimmer, just to the hub, and I use an automation to make them control non-caseta lights.
I put some logging on it and found out that when this happens, the numeric state on the sensor
entity is wrong. Everything is +8
- so when no buttons are pressed, the state is 8 instead of 0, on
is 9 instead of 1, favorite
is 10 instead of 2, up
is 16 instead of 8, etc.
Usually a restart of Home Assistant will fix the issue, or sometimes it will fix itself after a couple hours.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
False input coming from use of Pin.IN (seeing noise?)
So I'm occasionally seeing "button.value() == 1" when the button isn't being pressed - i.e. if I run in a loop, I'll see...
Read more >Pico - long press, possible? · Issue #25 · upsert/lutron-caseta ...
Is there any way to have long press considered as a different function than ... Button) if pico_state_value == 2: is_long_press = False...
Read more >RPi Pico not reading a button correctly
It works and responds to my button presses. HOWEVER, sometimes Pico says that the button is pressed while it is not. After a...
Read more >Getting Started with Raspberry Pi Pico and CircuitPython
Remember, when the button is pressed, it returns True , and when it's not, it returns False . When the LED is set...
Read more >Raspberry Pi Pico using MicroPython - Tutorial #2 - YouTube
The Raspberry Pi Pico is a new flexible microcontroller board from ... micropython on the Pico by taking input from a micro push...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have attempted to simplify the state updates again for the sensor. Releasing the button will always set the state back to zero and the states are no longer combined on update.
This may not fix the problem if the component never receives the message for the button release, but it will at least simplify the logic.
Just had it happen again this evening, but this time everything is +4 instead of +8, which is different from all the other times this has happened in the past that I’m aware of. Only 1 pico though, the others all seem to be working fine.