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

The relay trigger voltage is at least 3v, the dull red light occurs when the trigger pin receiving an voltage below 3v. This means that the pin is floating and we have to use pull down resistor with it negate this. This happens but mostly it wont interfere with relay operations, but will interfere with switch operations.

Actually sensor being stuck in OFF ON position is not a problem for us. So consider this, when you pressed the switch, the binary sensor locks in Off On position and we leave it like that. Will the binary sensor go back to OFF position after some time?

After a minute you again press the switch what happens? does the binary sensor change states?

so then thats why every time i rebooted HA it triggered my ardunino its floating as it was just a wire from gpio 23 to ardunio so how come gpio 8 isnt floating then?
so least i know what that means i just noticed it now i know when i did this thing a year ago i had to set GP Down or something in a boot file for raspbian to remove the red glow i didnt notice it till i used this certain relay has leds on it… and now it brough back memories of me dealing with it… when you dont work with this stuff everyday you forget alot

as for the Binary Sensor no
if i hit toggle it and it Sticks On it does not flip back to OFF
and actually if you touch 2 wires and do it
Binary Sensor is ON
touch wires wait 1 second touch wires wait 1 second
and repeat…
the Binary Sensor never moves and relays never click even after 5 seconds
i have to hold the wires together for 2 seconds i stopped count after 13 of touch wait 1 secon touch
it didnt get off of binary sensor ON and it didnt flip back on its own after 1 min or waiting either
also
i varried holding the wires together from like 1/2 second to 1 second and then wait another second or so before touch
things were varried it either flipped to Off from on or it stayed Off or it stayed ON

i did like touch .5 delay touch .5 delay touch .5 delay
and i tried touch .5 delay wait 1-2 seconds touch .5 delay wait 1-2 seconds repeat

and i got nothing constant its being tempermental
its not working right exactly every time

and when you wait 5 seconds or so and then touch wires it can flip relay on and binary sensor instantly and other times it chooses to flip when it feels like it

so nothing is constant

It looks like the things are only getting complicated with RPi and I am not able to test any of this as my rpi4 is currently engaged at the moment. Mostly the issue must be with the pins floating. If the relay is working satisfactory we can think of other options than a momentary switch. Do you use amazon alexa or google home?

What are lengths of wires connecting the relay with rpi and switch with rpi. please try the setup with wires less than 10cm.

ah ok
ya no my mom doesnt do any of that alexia etc …
she wanted something simple since before she would plug the pump in and she forget to unplug so would run for hours not pumping water…

so i came up with RPI crontab that worked but then if she wanted to manually do it she unplugged the pump from the pi and plugged it directly and then also forget it

so i came up with the ardunino cuz i was using it for a servo instead but project i didnt finish yet… so i figured simple on off relay with with a single point entry her pushing the button… then i could set up in HA timers every hour 15 min… or whatever…
and if she did activate it… it couldnt run more then 1 hour as a safety issue so you hit it in manual mode say and it run but it couldnt run any longer then 1 hour to save pump as she forgets…

but this button pressing is getting better of me cuz kinda frustrates me
i tried more GPIO 8 as the pin for switch
if i touch it slighty it will go HIGh but it may stay ON or drop to off but you couldnt touch it again for like 4 5 seconds… if you still just touch touch touch touch wires like 1 second in between
it wont toggle binary sensor… if you do about 20 times it may flip state 2 times out of 20

i also looked in that automation page to see for relay it toggles the switch i was looking for a way to toggle the Binary Sensor so when Binary sensor is off and goes to ON and Relay Goes to on … it then forces Binary Sensor to OFF position no matter what… like a manual force. this way it tell sensor you goto LOW dont care if your HIGH your going low…

was looking for something like that but i couldnt find a call service or what ever to say set Binary Sensor pump switch to OFF
but not sure if that would help my issue…

ya and my mom doesnt use alexia she doesnt believe in all that stuff she a senior and cant be bothered just press the button but i wanna be able to turn it on and off from HA or off if she had it running

bet youll say we can do all that in the tashomta switch but we cant run caller ID on there same time
figured since raspberry pis are expensive i could get use out of it

and if i need a pull down resistor what does it actually do pulls it down? and why doesnt the pull down work in the pull mode isnt that what its supposed to do?

and i guess i could cut the wires
i testing with these wires i have
https://www.amazon.ca/Elegoo-120pcs-Multicolored-Breadboard-arduino/dp/B01EV70C78/ref=sr_1_1_sspa?dchild=1&keywords=arduino+wires&qid=1617037582&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUFNV05YTVFUU1RER0smZW5jcnlwdGVkSWQ9QTA3NTI1NDZMSjVGOUxIUVNPNUomZW5jcnlwdGVkQWRJZD1BMDExNjY5ODJaQVNNVzI3Wk9ONVMmd2lkZ2V0TmFtZT1zcF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl

also i find when its not flipping when i touch the 2 wires together

i have to hold the wires together about 3 4 seconds then release then the relay will trip to ON

but you cant shut it off… andthen you gotta hold the wires together a few seconds to get the relay to come online or binary switch to toggle on the screen

so you cant just push you gotta hold in the end it seems…from what i noticed

and ya i understand about you gota RPI you cant duplicate my situation… as yours doing other stuff
if i had a skype running and a camera setup i could show it i may have to do with a cell and youtube it to show i not going crazy

and i appreciate the time you taking to help me test… cuz for me this stuff cool and home automation in college was shut down 20 yrs ago was it wasnt popular so i never got into really… and i just getting back into it… and some of it and with you couple some issues you cant pick it up easily… plus my real last programming langages was Visual Basic 6… and some NET
so everyone is over me with python still learning a little for what i need at the time

so i appreciate it…

If we want to do something like this, we can define the pin as a switch. Then we can use the switch.turn_off sevice to turn off the switch.

Actually tasmota has no connected with raspberry pi. It is not a firmware running with RPi but we flash it in an esp8266 board like nodemcu or wemos d1 mini. Its totally an indepent system. Its like having the arduino but with wifi. it has a god many tricks up its sleeves but there again longer wires are an issue. I have lost gpios of some devices because of longer wires as they draw more current than what the gpio can support.

Now the only way is to define the pin as a switch and use an automation to switch off it whenever it turns on. That should work. it was was we started from.

Also can you please make a python script in Rpi to toggle the relay and led when you push the button.

This is how we sort things out, trial and error and ultimately we would end up with something reliable. A point of recommendation, amazon alexa and google home makes the live vey easy of senior people, i have seen that with my parents :innocent:.

sorry for the delay i i have internet problems… and since my mother doesnt really use internet also when you live in Rural areas internet is not reliable doesnt exisit still use dial up some spots… its not like someone that lives in small or big town/cities

so from what i remember alexa and sira etc needs constant internet… and it has to work with 0 internet access … so the push button is simple she walks in basement u hit a switch (mometary) switch so it can work with HA

as right now i just run simple program i wrote… thats automated but i want to incorporate the same way into HA but incorporate button… i have got the automation running HA automation runs every 5 min runs for 2 min then shuts off

so the nodemcu wemos esp8266 so being like an ardunino its basiclly like a dumb device… it cant do anything
basiclly what i built but trying to incorporate the no issues of ardunino gpio sensitivities
with the Crontab i run on RPI and i wanna incorporate the HA so i can all put it into 1…
but right now just seems the gpio and that floating issue…
and with a resistor. on the button switch, leds (i found out you need it for sure) but with a resistor on them all does distance still matter? ill send pics later today
this is basiclly i made but just trying to get the buttons to work but the GPIos just dont like to work right
i been fiddling
Outdoor Digital Timer Canadian Tire
that timer is got time inside you got programs set, you got manual on off mode

this is the HA automation yaml that seems to work

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

my python program

#!/usr/bin/python

import RPi.GPIO as GPIO
import sys
GPIO.setwarnings(False)
pin = int(sys.argv[1])
status = sys.argv[2]
GPIO.setmode(GPIO.BOARD)
GPIO.setup(pin,GPIO.OUT)
#GPIO.output(pin,GPIO.HIGH)
print status
if status == "on":
        GPIO.output(pin,GPIO.HIGH)
elif status == "off":
        GPIO.output(pin,GPIO.LOW)
#GPIO.cleanup()

and my crontabs are

0 */1 * * * /home/pi/bin/pump.py 16 on
#Turn Pump Off Every 1 Hour 15 Min
15 */1 * * * /home/pi/bin/pump.py 16 off

#Run Pump Every 1 Hour
#0 */1 * * * /home/pi/bin/pump.py 16 on
#Turn Pump Off Every 1 Hour 30 Min
#30 */1 * * * /home/pi/bin/pump.py 16 off

#Run Pump Every 2 Hours
#0 */2 * * * /home/pi/bin/pump.py 16 on
#Turn Pump Off Every 2 Hours 15 Min
#15 */2 * * * /home/pi/bin/pump.py 16 off

#Run Pump Every 2 Hours
#0 */2 * * * /home/pi/bin/pump.py 16 on
#Turn Pump Off Every 2 Hours 30 Min
#30 */2 * * * /home/pi/bin/pump.py 16 off

#Run Pump Every 4 Hours
#0 */4 * * * /home/pi/bin/pump.py 16 on
#Turn Off Pump Every 4 Hours 15 Min
#15 */4 * * * /home/pi/bin/pump.py 16 off

so its a simple way… no need for internet as internet not really an option… its gotta work by pressing a button instead of her unpluging and pluggin in a pump as this is simple way having house fixed is a 30k+ fix and the way i go it going cheap way

i did see some people solder a wire from Ground to the gpio Switch for ardunino dunno if same works as well for raspberry pi… i havent done resistors from ground to the wire off switch gpio

i dunno if that will fix the binary sensor from locking up

so it has to work without internet… without Main Home Assistant… just the one on RPI
or heck if its better to use not HA on the Pump Pi use the MQTT reason i say it
i found error using Remote_Home Assistant plugin… its not supported by Home Assistant…
so then MQTT id want it to work with the button but that probably doesnt solve the binary sensor for locking up

but ill get pics of my setup later today

i updated the HA
and automation seems broken and i checked my router i get 2 IP address’s for the pump pi

so like 198 200 both work to goto the HA on the pump pi

but the automation is broken

it activates Every 5 min test but at the 2 min mark it will no longer turn off it stays on
running core core-2021.4.0b0
super visor supervisor-2021.03.9
docker : 20.10.5

custom logs say

Run Every 4 Hours For 15 min Run: Error executing script. Unexpected error for call_service at pos 1: The GPIO channel has not been set up as an OUTPUT
8:51:00 PM – (ERROR) Automation - message first occurred at 7:30:00 PM and shows up 40 times
New Automation: Error executing script. Unexpected error for call_service at pos 1: The GPIO channel has not been set up as an OUTPUT
8:30:00 PM – (ERROR) Automation - message first occurred at 8:22:31 PM and shows up 4 times
Error doing job: Unclosed connection
7:27:29 PM – (ERROR) runner.py
You are using a custom integration remote_homeassistant which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
7:27:28 PM – (WARNING) loader.py
Error while setting up environment_canada platform for weather
7:27:23 PM – (ERROR) Weather
Error setting up entry configuration.yaml for mqtt
7:27:16 PM – (ERROR) components/mqtt/__init__.py
Uncaught exception
7:27:15 PM – (ERROR) /usr/src/homeassistant/homeassistant/bootstrap.py
Ended unfinished session (id=43 from 2021-04-01 22:40:35.319064)
7:27:11 PM – (WARNING) Recorder
2021-04-01 23:27:09 WARNING (MainThread) [homeassistant.loader] You are using a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-04-01 23:27:10 WARNING (Recorder) [homeassistant.components.recorder.util] The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
2021-04-01 23:27:11 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=43 from 2021-04-01 22:40:35.319064)
2021-04-01 23:27:15 ERROR (MainThread) [root] Uncaught exception
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
2021-04-01 23:27:16 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry configuration.yaml for mqtt
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 248, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 453, in async_setup_entry
await hass.data[DATA_MQTT].async_connect()
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 706, in async_connect
self.conf[CONF_BROKER],
KeyError: 'broker'
2021-04-01 23:27:23 ERROR (MainThread) [homeassistant.components.weather] Error while setting up environment_canada platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/environment_canada/weather.py", line 82, in setup_platform
ec_data = ECData(coordinates=(lat, lon))
File "/usr/local/lib/python3.8/site-packages/env_canada/ec_data.py", line 242, in __init__
self.update()
File "/usr/local/lib/python3.8/site-packages/env_canada/ec_data.py", line 207, in res
return fun(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/ratelimit/decorators.py", line 80, in wrapper
return func(*args, **kargs)
File "/usr/local/lib/python3.8/site-packages/env_canada/ec_data.py", line 287, in update
period = get_condition(summary_meta['forecast_period'])['value']
KeyError: 'value'
2021-04-01 23:27:28 WARNING (MainThread) [homeassistant.loader] You are using a custom integration remote_homeassistant which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-04-01 23:27:29 ERROR (MainThread) [homeassistant] Error doing job: Unclosed connection
2021-04-01 23:30:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] Run Every 4 Hours For 15 min Run: Error executing script. Unexpected error for call_service at pos 1: The GPIO channel has not been set up as an OUTPUT
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:30:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] While executing automation automation.sauna_run_every_4_hours_for_15_min_run
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 492, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1188, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 341, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:35:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] Run Every 4 Hours For 15 min Run: Error executing script. Unexpected error for call_service at pos 1: The GPIO channel has not been set up as an OUTPUT
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:35:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] While executing automation automation.sauna_run_every_4_hours_for_15_min_run
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 492, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1188, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 341, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:40:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] Run Every 4 Hours For 15 min Run: Error executing script. Unexpected error for call_service at pos 1: The GPIO channel has not been set up as an OUTPUT
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:40:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] While executing automation automation.sauna_run_every_4_hours_for_15_min_run
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 492, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1188, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 341, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:45:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] Run Every 4 Hours For 15 min Run: Error executing script. Unexpected error for call_service at pos 1: The GPIO channel has not been set up as an OUTPUT
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:45:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] While executing automation automation.sauna_run_every_4_hours_for_15_min_run
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 492, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1188, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 341, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:50:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] Run Every 4 Hours For 15 min Run: Error executing script. Unexpected error for call_service at pos 1: The GPIO channel has not been set up as an OUTPUT
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:50:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] While executing automation automation.sauna_run_every_4_hours_for_15_min_run
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 492, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1188, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 341, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:55:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] Run Every 4 Hours For 15 min Run: Error executing script. Unexpected error for call_service at pos 1: The GPIO channel has not been set up as an OUTPUT
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)
RuntimeError: The GPIO channel has not been set up as an OUTPUT
2021-04-01 23:55:00 ERROR (MainThread) [homeassistant.components.automation.sauna_run_every_4_hours_for_15_min_run] While executing automation automation.sauna_run_every_4_hours_for_15_min_run
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 492, in async_trigger
await self.action_script.async_run(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1188, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 341, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 354, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 554, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 206, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 644, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 717, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/switch.py", line 71, in turn_on
rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 38, in write_output
GPIO.output(port, value)


i was able to downgrade back to 3.4 core

i guess the 4 core is broken os

i think that was beta version?

least the 2 IP address’s is gone and relay will shut off now

update:
rebooted teh pi and its now giving me same error gpio output issue so it was working but i did a reboot and it re broke itself

Yes it should have been a beta, that would explain the gpio not working. I found this in one thread. In the case of the switch we are missing something, it should have worked properly

GPIOs 28,29 44 & 45 float. 0-8 have default internal 50k pulls high, the rest default pull low. 
Additionally, there are strong pulls up for whichever I2C peripheral appears at pins 
3 & 5 on the GPIO header

Did you try without inverting the logic of the switch.

binary_sensor:
  - platform: rpi_gpio
    pull_mode: down
    ports:
      17: pump switch

so does that mean it should be working?
what does it mean internal 50k pulls high do you need a 50k resistor? or its built in?

as for invert logic i tried it before as it toggles but ill try again

also its still broken ): when i downgraded it started working again i did a reboot of HA and the GPIO output issue is back… i know i have same issues with the remote_rpi_gpio it has something broken in the files too so i trying to get back the working gpio out fixed…

so far it will toggle one way but not back using automation ugh

so far cant fix the gpio output i downgraded 2 versions
guess i should never handed in

can i just copy the old gpio files? since broken now ugh or is there an install file for gpios like windows a install.exe

update i restore 3.3 then 3.4 and reboot and restored 3.4 two more times and that fixed output

i make sure not to install betas least i back to running… HA very sensitive i notice

back to switch issue lol

If the gpio broke with an update, it shows that the system is less reliable and we cant depend on that. Also I have read that long cables are always an issue with gpio pins especially with rpi. Long cables can lead to floating pins. I have been reading a quite about our issue and it seems that this consistent with rpi gpio operations.

oh go figure right… and whatrs the solution for that?
and think the cables i testing with are just those short ones from the amazon link
i havent tested my button thats got a wire 10 feet in lenght only on the arduino
the ardunio has no issues for 10 feet it doesnt get stuck if you were to ring that button

is it an issues inside rpi? so then arduninos are more accurate i guess?
do they come up with any solutions? all i can think of is like a transistor but still its only having this issue right now with 10" cables as thats what i testing with on the table…

i didnt get my pics i wanted to take

i did finish my timers page for the pump
it didnt come out the way i wanted… i wanted Pump Timers to show up in the middle but a like background bar to cover all 3 cards
and i had to add a button card says pump on/off as i wanted the manual options in the center…

its a pain to line things up the way you want it… but so far least automation is working

i made a new automation for each one hour and i made 3 scripts a 10min second 15 min 20 min 30 min

i do find if you make an automation after the pump is on
it actually wont work… so its best i guess to restart the whole thing and not touch it once you get it working
but least the automation part is working i testing it …
to make sure as i didnt wanna pull my other setup out till this is working fully
home assistant is cool but also a headache at the same time lol

Your timer page looks cool. By the way make sure that the automations dont intefere with each other. if two automations concerning the pump are active at a time, it will be a problem.

As far as the gpio pin floating, we fist have to narrow down the problem, it could be long wires because other than that there are not so much problems. You can aslo check this config, it is something that i have seen to be tested ok.

  - platform: rpi_gpio
    invert_logic: true
    ports:
      4: pump switch

Make sure the switch is connected to pin4

ah ok ill give it a try

i did more testing… the Gpio wires you use that are like 10 inchs long or so
if you odd time just touch the relay will click

other times you need to hold for 6 seconds not 4 or 5 seconds but 6 seconds… release then she toggles
then hold again for 6 seconds then she re toggles… i seen another page for raspberry pi you need a resistor and a capacitory for debouncing… i tried to google what this debouncing is

as for my page ya i had to tweak it a bit i gave up trying to pad it and use it to my advantage

as for the dont interfere automations thats my next question i had earlier
is there a easy way… that only 1 timer can be set at a time… so if you turn on 1 in the 1 Hour group the other 2 stay off

or if i toggle say 1 hour 30 min off then all the timer settings turn off… is there an easy way to do that ? if toggle is on everything else is off?

so far i been testing 1h 15 20 30 min they all work
also if you turn on the pump and let it run an hour i made it so the timers can turn it off but after 1 hour it will shut off

here is a couple pics of my other setup i had… the one in my black box is what i currently have running… it runs crontab and it works

the other pic is where i had ardunio plugged into the raspberry pi and then you see the resistors they for the switch and 2 leds and it works find for ardunino but i never tried it for the raspberry pi… but i figured i could put the 2 into 1…

and i use those wires to touch together on the raspberry pi i testing with. just 2 wires touching
probably if i go back to using ardunio also i wont have a problem if i use that pin 8 as its not floating from what i learned from what i noticed and you answered with lol… but id rather try to get 1 board if i can… reason i had this setup is because HA can not do Servos and i was working on dealing with a Servo to turn on and off a water vavle didnt 100% work out…

oh and what be the easiest way to do
if you Toggle the Relay switch either on the screen or touching the wires (switch) together

that it kills the automation i did a script that kills turns off the 9 automations timers.

as i want it to kill it if i toggle it say with in 15 min and i want ti to run longer then 15 min but the automation still kills it say at 15 min

so i wanted to be able to turn off the automation call that script when i toggle it havent figure it out with automation still learning those commands call service device etc

so testing with Gpio 4 pin
is bit better

you can touch the wire contacts together and she will go Off on OFF

but there are some hickups
HA sees its gone On but doesnt trip relay but i think thats the delay in there so ill check that
2nd it still binary sensor stays ON when it should be really off

if it stays on you can toggle it off touching wires
sometimes you cant you gotta hold the wires together 1-3 seconds and then release then binary sensor toggles off

so its between little better and not at all

Being little better is not good, we want it to be best. These hiccups certainly makes the this setup unreliable.

Is this consistent. If so we can think of operating the switch like that, that is press and the hold for 3 sec and release.

ya its just a headache… i dont understand it i dont have extra resistors or a capacitor to add to the gpio and ground and i dont know what size as ii wonder if i need that to help???

as for consistant no its not you can do teh 3 seconds or really 6 seconds but if you were to do 10 times
3-6 hold release to turn on then do it again to turn off then 6 times roughly it works no issue i dont get it i dont know what does the ardunino have that the rpi doesnt have
then i was thinking of using like you mentioned esp node or web something… and if i jumper it like my ardunio in the pic the LED and the push button went to the ardunino and then jumpered to Pi running home Assistant… and the button worked well no issue

so i dunno

at moment i changed the rpi and doing testing i removed the SD card that was just running raspbian and my python code and the crontab stuff

and running for now to test … the raspian running HA runnning Caller ID to see how it all performs

and the Main HA so you can see it from there

another question does the ESP or those other devices you mentioned do they take away the issue i having with the gpio

and or even if i added esp or other would it solve the issue?

i may try that raspberry pi and the ardunio again with the HA running running on that gpio 8 since that isnt a floating gpio as we found out when i mentioned i saw that red light … i just was hoping it all in 1… but if it cant be solved ill try again ardunino…

and i guess if you buy these devices they dont have that issue of needing cloud services or soldering and de soldering chips just to program the damn device