Can it be done HA change State of pin from physical Momentary Switch?

so right now i have an arduino that if you press a mometary switch it will toggle an
LED to go On or Off and same time toggle a relay… but due to some werid reason i having issues with HA RPI linked to the arduino…

so i wanna try to remove the Ardunino and run RPI HA and mometary switch 2 LEDS and a relay

so right now
i running
HA Supervised on Rasbian as i run a Caller ID software parallel with HA

GPIO PIN
23: POWER LED
24: ON/OFF LED
25: MOMENTARY SWITCH
8: RELAY

so i trying to follow example and i know i worked it as a script to work to work with the ardunino

but i wanna eliminate

but how would i do it
Toggle switch in HA it will act as a mometary switch flip Relay Pin HIGH and on/off LED to Hight
then hit it either in HA or the Physical button… it then flips from HIGH to low for LED and the relay
and toggle the switch

what is the best way to do that? or is it still best to let Ardunio do it? or the esphome stuff i been reading a little bit about…

i was trying to incorporate it all in 1 computer

a little box with 2 LEDS and push button with 4 wires to the raspberry pi that controlls a the Relay and a Caller ID software at the time…

so wasnt sure if i should try to persue to run all off 1 board or not trying to utilize then raspberry pi and eilimate arduino plus to save power but was just dabbling how i could do it all

i think its better to eliminate arduino and directly use it with RPi if the both the systems are located together. If the systems are placed differently I would then again recomend you to eliminate the arduino and fo with a ESP8266 or ESP32 based systems as they offer wifi connectivity and also various firmware support.

Now in case of implementing the system with RPI, there are different methods. Since HA is run from docker, the use of gpio integration in HA wont be easy but you can start from that. You need can get the methods for that from this community itself. Please search “docker gpio” and you will get links to that.

Another easy method would be to install nodered outside HA. If you run node red as HA addon, then again the gpio access will be restricted. But if you install and run it as a service, the nodered has gpio nodes which will do help you out. You can link this nodered directly to HA by installing and configuring the HA node in nodered or communication can be done uusing mqtt.

Another method would be to write a python script in RPI. But then again the communication with HA could be done through mqtt. Mqtt client like paho should be installed in RPi to use this. It requires coding skills.

I am sure that there are other methods also which are easier and hope others will also share.

ah ok… ya like my arduino is like 1 inch from HA rpi… now my previous setup was HA Os version and everytime i rebooted HA it would trigger the Ardunino as i ran a script if you click it in HA would simulate a Mometary switch activating… and the ardunino would trigger and goto ON mode
my other idea was not go directly arduino to RPI gpio pins but use a relay to simulate the push button this way the relay probably stays off when HA reboots

but this time i trying to elimate arduino… as the arduinino is only an inch but the relay would be like 5 feet away and the push button is 10 feet away
running a wire
basiclly its for my mother to similify pluggin and un plugging a basement pump that cant have a float
so i i use crontab and a script i wrote that runs automaticlly… aand also want just simply push the button and it activates push it again deactivates

i did try learning the nodered i not there yet… id have to have someone helping me like live chat to explain what i want etc… i a visual learner… so i havent got my head around understanding it totally

i have done the

  • platform: rpi_gpio
    ports:
    25: this and that

thats how i got the script to trigger if oyu press the Run button on a lovelace card…

and as for mqtt i havent got my head around it enough yet i get the topic and it sends
but id have to figure send and receive at the same time.
and then i read a few articles where it talks about move away from MQTT and use esphome instead as its easier way to do things… same for move away from tashamot to esphome… so i just been reading somewhat

and trying to figure best route to go

and then ontop i read that HA Supervised isnt support to run on Raspbian but there is articles for it…

cuz i wanted to run
Caller ID software and HA to control a pump on the same PI… as connecting 2 HA easier then MQTT
but if HA is going to crash on a RPI on Rasbian… then i guess MQTT route is to go or possibly the esphome

so i just been googling reading a bunch and not 100% what is the best way to go i thought running HA but then i read its not supported only OS and Debian… but i couldnt get Caller ID software to run on Debian needs pip etc
so i just wasnt sure what the best route would be to go…

also the relay i going to use for the pump will be either 30amp relay i have for arduinio/raspberry pi… or the IoT 4 plug outlet relay box that is triggered by like 3 volts to 12

probably best wroute is no switch just touch screen and the rpi…

but ya i get documentation over load and wish i was smarter at this stuff to know the correct route only be dablling lately last few months same with i just got some TPlink devices as you dont need to erase them or struggle like tashamo switchs and plugs

I hope you have additional protection circuits between the relay and pi and also the momentary switch and the Pi since the distance are more than 10cm. If not it could damage your gpio pins by drawing more current or voltage. I personally have lost gpios with esp8266 in this fashion. If you cant reduce the distance you should go for a separate system.

Now with mqtt, it is something more or less synonymous with IOT communication. You wont be able to avoid using mqtt even when esphome provides native api to communicate with HA. Using mqtt id very very simple also, you just need a broker, to which different clients connect to. The clients are distinguished by a name which is called topic and the message that they send between are called payload. this is the basic idea.

Now with Tasmota and Esphome, both are good and it depends upon the use. In my setup tasmota is predominant because the tasmota UI supports almost all the settings but if we are using esphome, for changing a setting we need to change the code and upload the firmware. This is comparatively easy with esphome addon but you still need to create and edit codes which is absent with tasmota as UI supports all easily. But esphome is more versatile and supports many more features and devices. It gives more control than tasmota if you can use it accordingly. But both need an ESp88266 or ESp32 system and nt arduino.

You can run HA supervised in docker in Raspbian OS, It can help you run the caller id software also. but the issue is that since you run HA in docker, the gpio and other local file access are restricted. In normal conditions we wont be needing then.

The safest option would be to run these two systems separately , i mean the relay and HA. In that case you need to get a ESP based microcontroller like nodemcu or wemos d1 mini. I would recomend Wemos d1 mini as it is small and would work nicely. Flash it with tasmota. Connect the relay and switch to it and then link them to HA.

ya like i have resistors a 330ohm or it was like a 1k or 4.7k ohm i cant remember at the moment it was in the arduino kit… so i used resistor for the mometary switch, 2 leds… but no resister for gnd between the arduino and rpi and no resistor between 1 wire from arduino to rpi that simulates a mometary switch

oh ok so Broker is like your Router… the clients are like dhcp client deviced… and then a topic keeps the stuff seperate like french or english… all french displayed in this window… all english displayed in that window…

i had tried to follow a couple videos of the past but because they were jumping ahead or i couldnt get same or they werent working with ha i couldnt get it to work… then i watched the video for mqtt and node red i couldnt get that to work at all i couldnt get HA node red to display the remote gpio monitor card…

as for tasmota i thought it was only the stuff you buy from home depot amazon etc… light switch, the outlet and the wifi plug… and to be able to use it you need to take it apart solder wires and change the firmware since you cant do it anymore… and i found TPlink devices work out of the box with home assistant no need to flash this so didnt need tasmota… so if tasmota does more then outlet the light switch or the plugs then i didnt know that… just only knew the name because i couldnt get even the costco light switchs to work… but tplink works fine…
i did read up on esphome wroom as i wanna do out door thermometers but thats for another day trying to figure this project lol…

as for the ha supervised only reason is i found on the supervisor page that is isnt tested… communitity github people probably wont help you as its not tested… i know the remote_rpi_gpio is not working anymore as that plug in be easier to use then dont need HA just run the caller id and a relay…
so why is local file access restricted? you have the remote access gpio … also i notice if i use

-platform: rpi_gpio
ports:
25: test

and if i jumper to to ground it will show up in home assistant… so it works or is only some of it working… how come they dont make it unrestricted? as i didnt wanna run it and darn thing crashs; to run a water pump and HA crashes and is stuck on lol…

ah which ESP is best i see tha wemos name nodemcu the d1 i think i seen amazon has different ones some you solder some you dont … i got confused on all that… i like also non wifi as wifi isnt perfect… and i looked at wifi adapter got confused for the ardunio uno… i guess you gotta program the board for wifi and then attach it to ardunio and i thought was all in 1 code…
tried to learn everytthing.

and from waht i understand dockers are just like an app running in the background so like your internet explorer running windows… why would it be restricted…

but ya i figured i could get everything in 1

plus i didnt know how far you can go from rpi to a relay like max distance without ruining it…
ill have to relook on amazon/ goodle about the wemos d1 mini nodemcu
as i thought tasmota was only for the light switchs plugs from home depot costco amazon or like best buy etc…
learn something new everyday

oh and can the tasamoto thing
i use the raspberry pi with crontab so it basiclly isocolated. so it doesn not rely on HA to run as its mission critical… so i did figure out in HA to make my own automations i guess those are the crontab’s
so my question is
if i go the esp wemos way can you put automations on there like the crontab so its isolated?
or do i stick with the pi then… i should have mentioned that before

or is the tashamota just a dummy swtich and the HA just controls it no special timers in there esp or wesmos so it cant work without the aid of HA

should mentioned that before

What is the type of automations that you are looking for? If it is just simple on and off timers, then tasmota in wemos d1 mini will work fine. It has a timer function within the UI, that can set 16 timers in total. It can support up to 12 peripherals at a time. Please let me know what is exact routine that you want to have and I can tell you the best option for that.

its simple for the moment since my mothers house can not have traditional sump hole for water pumping out i used to use those smaller timers but those were always a pain to change

i never heard of HA prior to my building late 2019 early 2020
i got a raspberry Pi and i made simple script
you did like pump 16 on or pump 16 off
so what it did was bcm pin 16 would go high or low
and in crontrab id set 1 line for every hour and then 2nd line every hour 15 min
so comes on every hour and shuts off every hour 15 min

or i rem it out and i had a preset for ever 2 hours or 4 hours so was simple like that

then i asked on here and one said i dont read the docs but i stated after i figure it out
the docs dont say “automation” “time pattern” is the same as “crontab” there is no where in the docs that says this i couldnt even find time pattern when you use the magnifiy glass search

i only found it from a 2015 post that someone wanted to do same as i was doing well not exactly but run every hour… and it showed /1 for time

so what i have done now is as i wanted to save a raspberry pi to do more then just idle
as i have a 2nd pi that does caller ID so i figured i could combine the 2…

now i did get Supervised running on HA with Caller ID and i seem to get the rpi_gpio that seems to work and i set in automations’ i duplicated them so i have one for every 1 2 4 8 hours for 15 min so i can just turn them on or off… now eventually id like that on a Overview card instead of “automation” page so can do it from the dashboard…
but i also wanted to be able to run it from a mometary switch that has a green LED for Power on and a RED led when the relay pump is on…

i used to play with the “remote_rpi_gpio” as then i wouldnt need HA running and i was thinkin of different ways… or run the HA on the pump pi or from my Main HA as i want to keep the pump pi independent… so if you have to reboot HA and pump pi is running that its not affected…

so i wanted to run independent but apparently from what i discovered “remote_rpi_gpio” is broken integration right now since last couple HA updates and no one was able to help me in community and the github finally others also reporting its broken too

but ya i wanteda simple timers like i mentioned
On ever 1 2 4 6 8 hours say and off 15 20 30 min but able to toggle on a gui page to make it easy
and be able to turn the Pump on by a Momentary Switch

i had it working with the Ardunio but when i had it linked to the RPI HA there was an issue when you reboot HA it would trigger the Ardunio every 2nd reboot as its like a Mometary Switch
OFF - ON- OFF so it actted like you hitting a Door Bell Switch each time it rebooted on GPIO 24 25

so my idea was to get HA on the raspberry PI get the button and 2 LEDS to the HA and run caller ID app as i never got the HA Caller ID app to work or show anything and no one could help me with that as no one does Caller ID apparently.

but of course the issue i guess is HA is not supported in Supervised mode on raspbian but you said gpio dont work but i got it working but i cant get a momentary situation to work
and there is no real Toggle Switch for Mometary
i did make one from a Button card and i did a script toggle delay .5s toggle and then button card would read the state of the Arduino pin if it was High or Low to say On or Off that seemed to work just had issues with the reboot

my alternative was i didnt have yet was instead of a wire from Rpi to the Ardunidon directly… it to use a relay as i figured maybe very little power is triggering the ardunio and if i used a relay there be no way it work as it need more power… to activate it at least

that was the idea… but my idea was also to limit it all into 1 Pi instead of needing Ardunio Uno 2 inchs from Rpi …
so basiclly thats it

well if i confused you sorry… i have dyslexia it all sounds clear in my head and when i write it… but it doesnt always come out the same… also have learning disability so im a visual learning i learn better watching videos instead of reading “docs” or the “examples” as it doesnt really tell me anything

so it takes me alot longer then a regular person learns…

i appreciate the help so far… and getting through this long reply

I am also a visual learner. Never have i read a doc completely. Now coming to our situation. As you have said it is ideal to remove arduino. There is no doubt in that.

And also since you have already configured gpio platform with HA, it can be used. But you want to schedule the pump from your dashboard, for that I would recommend this custom card.


You can either install it directly or install it from HACS. This card is simple and will help you manage scheduling from dashboard without the use of timers.

Now with the case of momentary switch, the best option available is creating an automation which will switch it off as soon as it switch on. But since we are using the gpio platform with HA, instead of defining a switch, set the pin as a gpio binary sensor. I think by that way when the momentary switch is pressed, the binary sensor will be on and off when released. Please try that. If this works you wont need any automation.

Now if you are looking to shift to esp8266 based system, I think Esphome would be the better option for you since it gives better control of timers and all. But tasmota can also be worked according to our requirement.

If you have any more questions, I am happy to help.

so i havent tred the scheduler

i did try to do a automation i guess your right its restricted
i have no issue making the switchs

the binary sensor works… i jumper the wire to ground and the sensor goes on touch it again goes off

but in Automation when you click devices itt doesnt see like switch’s all i get is “Forest”
does that mean thats what you talking about restricted gpios? reason its not supported?

as it works on the Overview Page but it doesnt work in Automation creation

also
this is my configuration yaml

binary_sensor:
  - platform: rpi_gpio
    invert_logic: true
    ports:
      25: pump switch     # Mometary Physical Switch 


  - platform: rpi_gpio
    invert_logic: false
    ports:
      23: LED - Power     # Make LED Light Up on Power Up

switch:
  - platform: rpi_gpio
    ports:
      24: pump relay        # Relay To Pump
      8: LED - PUMP On/Off  # Make LED Turn On Off With Relay
```![pump1|452x500](upload://2IIPDTv17KO5kklKWNkZUo4aaiA.png)![pump1|452x500](upload://2IIPDTv17KO5kklKWNkZUo4aaiA.png)


oh and Trigger State Type sees all the devices like switchs binary sensors

its when you goto Action and Type to Device all it sees is forest
i played with all the combos nothing sees them just Trigger State Type option sees it

also trying to do a script to toggle Relay and toggle the LED
there is no devices… it just wont show up but i checked my regular HA on my main rpi they show up under device in script or automation

guess thats why its not supported as they dont really fix it and like you mentioned its restricted

i think i got the switch part to work seems to be working
i had to clear the web browswer cache… and i noticed they changed how it looks doing the automation you +pump it shows up
so i testing it so that part seems to work
here is the code

alias: New Automation
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.pump_switch
    from: 'off'
    to: 'on'
condition: []
action:
  - service: switch.toggle
    target:
      entity_id:
        - switch.led_pump_on_off
        - switch.pump_relay
mode: single

ill try adding that scheduler… i tried the simple timer from HACS but it doesnt work the way i wanted

this is how i do the automation i liked in automation

alias: Sauna Run Every 4 Hours For 15 min Run
description: ''
trigger:
  - platform: time_pattern
    hours: /4
condition: []
action:
  - type: turn_on
    device_id: 19475a1969cc537e97c520c2d674f4dc
    entity_id: switch.h_sauna_pump
    domain: switch
  - delay:
      hours: 0
      minutes: 15
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: 19475a1969cc537e97c520c2d674f4dc
    entity_id: switch.h_sauna_pump
    domain: switch
mode: single

so that scheduler is easy as that? ill try to do that now… to install it

Update:
i was wrong it doesnt always work…
sometimes when toggle switch

it stays Binary switch sensor will go from Off to On To Off when touched and released
sometimes it goes from Off to On when touched and released

do i need a resistor i remember reading a pull down resistor but in past i never needed such to get it to go from OFF to On to Off by just pressing button and releasing

i was unsuccessful to get that card to work.

  1. HACS cant be installed on Supervised HA
  2. i manually put it in www folder but there examples are a pain i cant figure if the card works or not

the simple scheduler i found under hacs on my other raspberry pi running the HA OS least is a side panel but it doesnt do every hour… so i guess im stuck with automation as its quick and simple right? unless there is a quick easy way to set up that scheduler you linked me…
but i gonna try this setup and see how well ti works compared to just testing it on my table lol

so testing with a real switch and a real relay

still glitchs

if you press sometimes goes OFF ON OFF sometimes it goes OFF ON it doesnt flip back
or sometimes it OFF ON OFF but the relay doesnt follow suit

is there some other thing i need to add a delay or another check to make sure it works everytime?

that each time its released or is there a different pin to use
i forget i remember someone sent card to show that pin is automaticlly low
would that help

HACS do work with supervised installation. I am using HACS with my supervised installation. There might have been some problems in the installation method.

The difference in the states of switch maybe because of a pullup issue. There is an option to enable pull down in the configuration. Did you try that? Orit could be an issue with debouncing. Please check if how the binary sensor works if you push and hold the switch for 3 seconds and then release it.

Let me just confirm one thing. When ever we push the button, we are getting an state change…right? whether it is OFF ON OFF or OFF ON or anything…right?

If we are getting any state change with binary switch, then we can use that in automations. Just change the automation to trigger with any state change.

alias: New Automation
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.pump_switch
condition: []
action:
  - service: switch.toggle
    target:
      entity_id:
        - switch.led_pump_on_off
        - switch.pump_relay
mode: single

But if we are going for this make sure that the binary sensor wont change states at random.

Also go for this method only if you are not able to solve the switch issue with pull down resistor or holding action.

so if i hold it for 3 seconds or so it can lock itself up
if you toggle the switch say 10 times it will lock up and binary_sensor will lock at least 3 or 4 times
to the ON position
so the state does flip back and forth but jams into the ON pos
i do have the pull mode: down but i also watched before you have to add a physical resistor to pull down… also i think the gpio is already a pull down mode default i dunno… i still learning it… i know i did read i guess thats why i went with ardunio that its more senstivie… plus it can handle Servos where HA and the RPI can not handle servos… well RPI can but its not as accurate then the ardunio

here is the code for the binary sensor

binary_sensor:
  - platform: rpi_gpio
    invert_logic: true
    pull_mode: down
    ports:
      25: pump switch     # Mometary Physical Switch 

this is the code i had made for the automation
i played with different settings all this time i spent most of the day trying to get all this to work with ur help and just everything …

alias: New Automation
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.pump_switch
    from: 'off'
    to: 'on'
condition: []
action:
  - service: switch.toggle
    target:
      entity_id:
        - switch.led_pump_on_off
        - switch.pump_relay
mode: single

as for HACS i finally got it to install… the install off the github said just use the wget but that did nothing except install i coppied from my other HA my main one i had a hacs: a token i copy and pasted it into pump pi ha configuration code so then it added in there… i not sure what that token is truly for … and is it normal have the HACS u loose all the community apps in Add on store?

but ya so far i have not got it from locking up so when the binary sensor locks up you gotta hit the button twice to toggle the relay again

right now i been testing relay i have small projects one with an automation so it works
as i was not able to install that scheduler and the examples confused the hell out of me… i just wanted to have the card pop up or like the Simple timer… but seems the automation is just as easy i just wish i could move those to the card… but im sure once that card is setup the link u sent once its setup it be easy to use… just getting there its not detailed for like a Dummies book so i dont understand what to fill in there the examples mean nothing if you dont know what each line of the code does or what you need… or what you need to get to put in there to understand it all… so i just went back to automation

but this is what i been testing and seems to work. with the Caller ID in background HA running on the raspbian… but i guess there wont be updates for it as its not supported

but this is what i got

alias: Run Every 4 Hours For 15 min Run
description: ''
trigger:
  - platform: time_pattern
    minutes: /5
condition: []
action:
  - service: switch.turn_on
    target:
      entity_id:
        - switch.pump_relay
        - switch.led_pump_on_off
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
  - service: switch.turn_off
    target:
      entity_id:
        - switch.led_pump_on_off
        - switch.pump_relay
mode: single

it runs every 5 min for 2 min… i doing this to make sure its working and going the right way etc… so that part works

You can try this automation as a work around for lockup. This automation wont look for the binary sensor to turn on but will look for any state change. That way we dont need to think about locking up.

You are sure that the momentary switch is in perfect working condition?

alias: New Automation
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.pump_switch
condition: []
action:
  - service: switch.toggle
    target:
      entity_id:
        - switch.led_pump_on_off
        - switch.pump_relay
  - delay: '00:00:05'
mode: single

i tested with the switch off… and just touch 2 wires together one off ground and other off gpio 25
so i could make sure its not the switch… so if i touch the 2 wires together … it will lock into ON for binary sensor of gpio 25 you gotta hit it again to get it to OFF and then u can touch the 2 wires together to get it to toggle again… but constantly locking up… why does that happen?
when trying different options i saw break down of timers
so i did delay time from off to on for i did did “for” 00:00:00:001 so that it would just instantly flip but thats what i thought it do but button or touching wires would do nothing too fast i guess… so state wouldnt flip

so trying that code… when i touch the 2 wires together as i dont have switch on it right now

it will work maybe 2 times out of 10.;

it will flip the Binary Sensor Switch to ON but the Relay or the LED on the car will not flip they stay OFF or they will stay on… they touching fast or between touchs like ringing a door bell fast or going slow holding like 3 seconds no matter still locks up randomly
id dunno if it matters i dont have the LEDS hooked up to the pins its just the output on the car as the setup i have is on the wall and i still working on my table… just have extra mometary switch and 4 bank relay i been using for testing since it locking up
in either ON or OFF
relay/LED will not link probably with the action of binary sensor toggling

should i change to a different gpio or would it be RPI 4 isnt accurate enough the Ardunio i know doesnt have the issue but thats when i read a while ago ardunio is more accurate but that was about ardunio vs rpi2 or 3 i forget but this is the 4 model so i dunno if better or there is to tweak etc

doing from the card seems to work fine thats just the toggle the relay it doesnt toggle anything else… nor do i know how to link them together other then the automation one…

do i need different drivers… to make it more accurate or a real resistor i seen before in pics u use a resistor to ground or something to pull it down?

We can first try changing the gpio pin to 17 or 23. I dont think there would be a any change but lets check it out for now. Then there is an option called bouncetime in configurations, make that to 1s and try. The config will look like this.

binary_sensor:
  - platform: rpi_gpio
    invert_logic: true
    pull_mode: down
    bouncetime: 1000
    ports:
      17: pump switch

But make sure that you press hold the button for at least 1s before you release it.

Were you having this issue when you defined the momentary switch as a switch?

Also we have missed on crucial issue, that making sure that the two automations are not interfering with each other. This can lead to problems in functions, ie one automation maybe already working and in the middle of that the second automation would be executed.

Make sure that you touch the wires at least 5 seconds apart from as I have conciously added a 5 second delay in the automation. If the automation is triggered during this 5 seconds, the automation wont be triggered.

ah ok i did try 17 and also 8 gpio for the switch and test.
ya i noticed that the relay wont click for 5 seconds if i rang that button/ touch the 2 wires together like a kid on a door bell… and that would delay the binary_sensor of switch would still lock up

it would either stick to ON or it also would not flip off so goto OFF from ON… so u had to click it a couple of times

oh and the 2 times out of 10 i didnt mean the relay i actually ment when running the code wouldnt a For time
2 times would be 2 times it work it wouldnt stick the binary sensor to ON button
i tried a reboot and got it 3-4 times it would work out of 10 meaning the binary sensor go from off to on to off again
other times it either not goto “on” or not release “on” to goto off…

and i did read that bounce time… for me that made no sense…
there explanation is “The time in milliseconds for port debouncing.” well that means nothing to someone that knows nothing
so i never used it… what does it mean for a dummie book type of person to understand…

so with that and that bounce time…
touching 2 wires together to activate binary sensor

it would work the first time then if you were doing
touch/release wait 1 second touch release wait 1 second

doing that 10 times… it would only work 3 times meaning the binary sensor on the screen
would toggle from Off - ON -OFF other then that it would stay OFF or stay ON

is the bounce time just a delay before you can press the button again?
like you need to hold the Button in for a 1000 bounce time before you can release the switch or is it 1000 bounce time before you can press the button again?

so i tried waiting between button press’s like pres release wait 2 seconds repeate
then i tried press release wait 5 seconds and repeat

and it still locks up the Binary sensor in either On or OFF

now is it because im running HA on raspbian… and would it act better if i was running HA on RPI as a OS instead?

if you have a spare rpi4 and couple wires maybe you can see my same issue i having? is it version issues maybe firmware? or is it arduninos more accurate then rpi? i dunno what works the best is the darn switch on the card to flip the relay

the purpose of the physical switch is
1… to turn it on and off if my mom chooses to
2… if its already running (pump) you can shut it off

same way the Light switchs work press it on the Dashboard turns on turn it off at the physical switch
just seems to get stuck… or is it HA doesnt like the gpios? or they just not accurate light a light switch like i using from TPlink or costco light switchs or ardunios…

or maybe something i have to live with?

i had thought of using light switch but dont have extra light on them to show they working…
and there is no software in it to run timer… which sucks as i want it independent and isnt depenedent on HA main… incase its running or shut off or rebooting…

i run different ways in my head to try to solve issue

but perfer thise current one we on to utilize a RPI4 to run HA on it and Caller ID since its realivity easier to setup with Main HA since you guys got that card to link mulitple HA to 1…

but least for now i have a a rpi4 running for her now just runs every hour for 15 min using crontab and python script so this build your helping me with isnt bad to work on… since
that was just runs raspbarian crontab and python script…
but when i had the Ardunino it works well you could click it on and off like a door bell it wouldnt stick on… so its frustrating lol but when i linked Ardunio it rebooted it

but i had question

i notice on these 4 pack Relays for ardunio/raspberry pi
its supposed to be off… there is a red light on it.
Off is dark… On is bright red…
when i reboot RPI that red light doesnt go off it actually a Dull red light
then when it boots up the relay clicks and the light goes off

what is that?? this also happens if you shut the power off to RPI and turn back on the LED on the relay board is dimmed lightly then shuts off when i guess HA boots up?

does that mean the RPI is broken? or the relay board? if you need pics i can take some later
but i noticed that
does bounce time for that issue? too

update:
i tried a bunch of different pins… lot of the pins keeps it light red
but if i stick on GPIO 8 its dark on boot up but when HA boots up does that mean anything?

could that be the issue with the toggle switch 1 for when i had ardunino it was sending power? just that little power triggered it?
also could it be the cause why the binary sensor is getting stuck?