Getting frustrated How to get HA to discovery a Raspberry Pi

im getting so frustrated… been trying 2 weeks now
trying to google trying everyones codes GaragQPi does not work
i install Broker MQTT on Home Assisstant. Home assistant is on a seperate computer… its not on raspberry pi

i install the client software i tried several setups i install whatever… i do a reboot… i restart Home Assistant server… i check for Discoverys. . there is no raspberry pi discovered…

i can connect to 2 of my Vizo TVs and i can connect to my Pfsense router… but it doesnt show up the Raspberry PI GPIOs

did not help me… it actually causes my raspberry pi to go hay wire… if you make a switch… it will turn it on and off even though it should be on
the binary_sensor does kinda work or it reads 1 relay state right and 2 wrong…
if i got a relay turned on… restarting Home assistant resets the raspberry pis relay state
i tried reversing switch: and binary_sensory: routines flip them around which loads first 1 way makes it worse then the other…

im getting frustrated cuz i not understanding and there isnt no real examples… just examples o running Home Assistant on a raspberry Pi… not somemuch Remote Raspberry pi

and then it has “Note that a pin managed by Home Assistant is expected to be exclusive to Home Assistant.”

well i need it to know that when its not exclusive such as a real button pressed… a cron running , the Websever with a couple buttons on the raspberry pi to turn on and off relays…

im getting frustrated dont know how to configure this and raspberry pi forum trying to help but its not working either…

is there no true flawless step by step guide to setup the Rasperrpi to be discovered in the notifiications section… and then no issues with the states of fliping on and off when you flip a relay on in home assistant and it just goes rouge and shuts off

It looks like you need https://www.home-assistant.io/integrations/remote_rpi_gpio/, not the integration you linked to. There are important set-up instructions in the first section, both the rpi and the HA host computer need to be set-up. It works well for me, so give it a try. If still not working, please share your configuration.yaml where you set-up the ports. Good luck

Maybe a more basic situation: is your RPI connected to your network? I would first scan the network (there are many apps for that) and make sure the RPI is connected, has its own IP address and so on.

drjb
While true, it needs to be on the network, this alone will not solve the problem as the RPi needs to have PIGPIO Daemon running, and the HA host needs certain python libraries. If the instructions linked are followed, there is a configuration that must go in HA configuration.yaml, so it tells HA to look for the remote RPi. The IP address of the remote RPi is required here to tell it where to look, if the RPi is not on the network, this will lead them down the path you mentioned.

I agree that our methods will ultimately lead to the same answer is the RPI is not on the network. However, why start complicated and go down a very laborious path? I’d say check first that the RPI is on the network, then work from there. The opposite (your approach) seems very complicated (to me). Wouldn’t you agree?

If your car is not comfortable while driving, would you take it to a mechanic to check all the bushings, the shock absorbers, and all the springs in the suspension??? … No, I would start by making sure all the tires are inflated at the proper pressure, that I have no flat … etc.

Do the simple things first … at least I would.

so my Home Assistant is 192.168.0.153
my raspberry Pi is 192.168.0.12

now i really like this program just gets frustrating… and the help page for the Remote GPIs etc gets confusing… wish there was a home assistant for dummies easy enough for a 5 yr old to understand… like step 1… get raspbian… step 2 burn with etecher… then further down the road step 10 run this on raspberry pi to be slave device and that Home Assistant can discover it like the TV… i tried googling but there isnt much more of the HA on the raspberry pi… but not connecting to remtoe one… some articles i read people had issues… or when HA reboots it also resets the GPIOs on the RAspberry Pi which i having issue

so
HA (192.168.0.153:8123) Host

Raspberry Pi (192.168.0.12 )Slave
-runs cron
-webserver for 3 push buttons for relays
-future physical buttons
also i have the remote GPIOs enabled on the Raspberry Pi

so from the little examples HA needs to be the only one controlling the device but doesnt solve the issue of it reboots everything reboots… but my Raspberry Pi is a mission critical… it pumps water out of my basment i have it setup… and i been playing with things
i find the lower code i been playing with .if binary_sensor at top… things may display on my dashboard or some dont… if i move switch: routines above the binary_sensors then maybe a switch out of 3 show up or what not… i tried different orders… as i not sure… if its a top to bottom read… so Sensors go to top before switchs routine…

i still new to this i been watching some Dr ZZZs videos and couple others about MQTT but mostly sending hello World… not tell HA that Here i am the Raspberry Pi wide open…
and if i click on in the HA the toggle switch for the one. it will come on then about 3 seconds after it shuts off… so click on shuts off… so i been doing circles… i wish i was better at this stuff… and im sure come a year of playing with this ill be much better… but right now spinning my wheels and getting frustrated

#switch:
#  - platform: remote_rpi_gpio
#    host: 192.168.0.12
#    invert_logic: true
#    ports:
#      11: Fan Office
#      12: Light Desk
#      24: Building Light
#      25: Basement light 2
      
 # Relay states
binary_sensor:
  - platform: remote_rpi_gpio
    host: 192.168.0.12
    invert_logic: true
    ports:
        23: pump_state
        24: relay1_state 
        25: relay2_state
#    bouncetime: 50
#    pull_mode: "DOWN"

switch:
  - platform: remote_rpi_gpio
    host: 192.168.0.12
    invert_logic: false
    ports:
        23: pump
        24: relay1
        25: relay2
#    platform: template
#switches:
#      setone:
#        value_template: "{{ is_state('binary_sensor.relay1_state', 'on') }}"
#        turn_on:
#          service: switch.turn_on
#          data:
#            entity_id: switch.relay1
#        turn_off:
#          service: switch.turn_off
#          data:
#            entity_id: switch.relay1


 # Relay states
binary_sensor:
  - platform: remote_rpi_gpio
    host: 192.168.0.12
    invert_logic: true
    ports:
        23: pump_state
        24: relay1_state 
        25: relay2_state
#    bouncetime: 50
#    pull_mode: "DOWN"
   
#switch:
#  - platform: remote_rpi_gpio
#    host: 192.168.0.12
#    invert_logic: false
#    ports:
#        16: pump_relay
#        24: relay1_state
#        25: relay2_state

i wish there was more samples… and the Examples page on HA site mostly automation i was hoping there be like to Toggle a Switch … and these are steps… but then there is links to other people under automations that doesnt help me… what do they do just says configuration by such and such

plus would be nice with pictures and steps… like when the examples say Template… well show me pictures of making that template… i know i too new and asking for stuff simple as im a visual learner not a words learner i need to re read things 10 times but videos i understand… so i try to watch some videos… but i dont think Home Assistant releases any videos on “How To” for each thing etc…
so i keep googling but i think this is cool stuff… i just not smart enough yet to understand it… yet that is

It seems like you’re still venting here … or you’ve reached your ‘impatient’ threshold. Your last two posts are more about frustrations and less about describing exactly what you have and what you’re after. You need to state the problem CLEARLY for the community to help you. Also, this is a free software, and you need to spill a bit of your own blood and sweat to get it to work … :slight_smile:

No one is going to resolve this for you, you need some ‘pointers’ to some good/working/simple examples, just like the ‘Hello World’ you mentioned. Once you’re comfortable with those examples, then you can ‘graduate’ to doing more fancy stuff.

Also, being you are a newbie (and so am I), I would NOT put something critical (water in the basement?) on HA/RPI. Make sure you have an alternate/robust system separately from HA/RPI.

Lastly, think of the PLUS side … this is a hobby, you’ll learn a lot, suffer even more, but in the end, you get to write your own procedure on how to do what you’re doing, even document that on youtube, and people who want to do the same as you will be forever grateful to you, and your efforts.

1 Like

Just a simple question, which if true might lead to a simple solution.

are you running home assistant in a docker container?

@comet424

OK, so I know this can seem daunting, stick with it, please answer the following:
Is your HA running in a docker container, or Python Venv or Hassio etc.?
So in the integration I linked, the second paragraph, The remote Raspberry Pi and the control computer where Home Assistant is running must be prepared to run remote_rpi_gpio, see details here.
Did you click on that and follow all the directions in 4.1 and 4.2. on that page ?
The first gets the RPi set up and running Pigpio daemon each time the RPi starts,and enables remote operation of the GPIOs. Is Pigpio daemon now running on the RPi?
The second allows the HA host computer to communicate with the RPi, so if HA is on a computer running Linux, or Windows, follow the instruction in that section.
Have you done that?
Your HA config for the binary_sensor looks OK, just be sure if you use the switch set-up you do not use the same port twice.
Now restart HA - configuration panel-server controls- check config button, if no config errors, push the restart button. Any notifications of something failed to install when it restarts?
Now go to the log, configuration panel- log button. Are there errors?
If not go to configuration panel-entities, you should find 3 binary sensors there, are they shown?
Note the entity_ids, you can now put an entities card in your UI, and populate it (edit the card) to show the three sensors. They should toggle as your GPIOs are changed from high to low etc.
Let me know how it goes. One thing, working with HA, this is a very fast moving project, and if you happen to find a video or instructions on the internet, its probably too old to be of value. While to docs in HA are not always the best try to follow them, if you fail, check the forums, others may have solved the same issue. Or ask for help here. Give clear concise description of your set-up and what your issue is, include errors from logs if there are any. Good luck

No, I do not agree. Just getting the rpi on the network will not make the RPi available in HA, or even visible. All the stuff you refer to as complicated must be done, laborious path or not… If the instructions are followed at the config point an IP address will be required, and if its not on the network that will be obvious and have to be dealt with. In this case, and I have done this a lot, it is best to follow all the instructions, in order, then troubleshoot error messages and logs if any issues arise. We can disagree…

1 Like

Fair enough, you have your beliefs and experience, and I have mine. I am not saying that is the problem, all I’m saying is RULE-OUT the obvious part. I’ve seen, in other forums (e.g. OpenHab), where people download an image to an SD card, and expect the RPI to run as soon as it’s plugged in. Some newbies expect the RPI to be smart and connect directly (by itself) to their home network, without even modifying the configuration file to point to the correct network/password. Remember, the OP said he was a newbie … and many make such mistake.

But then again, you reached your conclusion and are convinced in your ways. So be it … peace

1 Like

i gave up today
ok ill try to explain better.

1… i running Home Aassistant Hassio as a VM under unraide i followed the instructions to run the ocw2 file… as the Docker was no good it didnt have all those plugins built in and you cant seem to install Hassio as a docker… so its running on a VM under 192.168.0.153

now i been running my Raspberry Pi for a year now… under doing Cron… i edit the crontab to change times to turn on and off a pump ever 2 hours runs 15 min or every 4 hours for 30 min … it pumps out water out of a drain… i cant have one of those built in drains and sump pump as house wasnt designed for it… was designed to run water out around house but thats been plugged long time so i manually pump water out of basement out of a 2 inch drain and out the window like ever 2 4 8 hours say for a 15 min… i was going to add manual switchs… but ssh’ to edit crontab faster… reason i went the raspberry route… as trying to repogram those outdoor 30 interveral timers is a pain in the butt… and buying 3 of them programmed to 2 4 6 hours say gets too much… was quicker to ssh crontab-e and edit the file…
in 2020 i added a website u can just click screen website to activate the relay to turn on and off the pump if i needed to instead of waiting for crontab to run and since i dont have manual buttons so i dont unplug nad plug in the wall

so now i learned of this home assistant over the year… and i trying to incorporate raspberry pi int home assistant… when i installed Home assistant and the MQTT broker raspberry pi gpio wasnt detected…
i thought when you install MQTT broker on HA… then restart… under Notifications. Discovery that the raspberry pi should be showing but it doesnt… just shows my 2 Vizo Tvs and my Pfsense Router… no Raspberry Pi Discovered…

so Home assistant is just an add on to viewing the pump i wanted to see the State… be able to turn it on and off without hte need of the Webserver i running… or if Cron is running so Pump on and is pumping water… and i restart home assistant… Pump should not be reset to Off it should be still running… and not be reset but display its current state… and the Toggle switch should represet the current state too… so if i run a Cron on the raspberry pi… if I press the webservers button… or if i press a physical button on the raspberry pi… it should show up in home assistant… and not go haywire or shut off if home assistant reboots… and like i mentione if i binary source first it may disaplay the Relay states but the buttons dont work… or if i put switch: first then switchs may work then relays wont or display wrote state… or brick the buttons on the webserver thats hosted on the pi… it will flip them on i guess from the inverted logic… but it doesnt read the output gipo state properly.

so ya been venting cuz i getting confused and not enough examples as it seems to work best when MQTT cant discovery a device… when it cant discover its a pain in the butt… the only integration in HA is raspberry pi power checker… but not able to search raspberry pi gpio in the search… it only shows up on actual home assistant website under search/ inegrations … not the Local HA Server Configuration/Inegrations/Add

sorry if i confusing i have dislexia to me sounds right but i been playing 2 weeks to get HA to work with what i have

but i also not looking for raspberry pi to send Hello World across… the platform… i want it to read GPIO State and turn on and off GPIO andso far i havent really found videos on that specific reason…
but i gave up today well last night when i got frustrated… i neeed a brake

so the HA is just an add on right now my Cron and Webserver works what i got going on… i wanted to incorporate HA but its causing more issues then good right now

and i just trying to find how to get it working flawlessly

if i confused u at all ill try to explain better… or specificlly

to answer the comments before my last reply

ya i new… and i thought once you install HA and MQTT the Raspberry Pi be discovered like the Vizo Tvs… there is not username or passwords for the TVs… or the PFsense Router… you click the Add and it does its spinning and bobs your uncle its now included in the dashboard… i thought the Raspberry Pi be that simple too… and i dont know of any step by step instructions to make it simple

i figured was plug and Play like you hear about MQTT or the IFFTOF something like that… you plug it in the wall you reboot your Home Assistant and boom its discovered your device 9 times out of 10

but thats what i thought

So part of the issue you are facing is understanding the way home assistant is currently structured. When you say the only thing in HA integrations is Power Checker, that is not exactly true. That is all the rpi integrations that can currently be set up using the UI, a gradually growing list as volunteers find time to set them up. All the integrations are listed here, and some have to be configured manualy using configuration.yaml file


If you search gpio you will see the remote_rpi_gpio integration I linked you too, it is not yet available to be set-up using the UI, search rpi and you will see some more.
You should be able to set-up your mqtt broker via the ui, you said it was on the computer with HA, so that has nothing to do with the rpi.
You can do exactly what you want if you follow all the steps I sent you above, carefully.
This software is young, opensource and mostly volunteer developed, so some patience is needed.

so see what i thought i install mosquito on raspberry pi or it would show up with the tvs and pfsense like here in notificaitons… its what i thought

as you mention the inegrations i have tried


thats why you see above in the code above my configuaration yami i use the remote gpi
but i having major bugs if i flip around the switch and binary sensor which ever is on top… i play with the false true logic invert… but that manual coding is causing major issues… like when i use the Switch and toggle it… it comes on 3 seconds shuts off dunno why at the moment maybe i need to re install home assistant…

because i get enity not found if i put switch: above binary_sensor:
and i having issues learning Node-Red for Remote Pi GPIO from what i seen so far Node Red works for Rasperry Pi If HA is in the Home Assistant

then i figured my work around is if HA be installed on Raspberry Pi… but the Main HA be running on the VM and HA (Main) would access HA Raspberry PI to send the info if they could talk to each other… i havent gotten much google serachs doing that…

but so far been watching Dr ZZZs videos i learned from Paul Hibbert Youtube page
always learning

but ya i can get it to turn on and off the Raspberry Pi but it goes nuts clicking on and off on its own.
its it because Raspberry Pi not supported 100% yet… because its all voulnteers. and there are soo many devices? iseen like 1700+ devices on integerations… its not 100% in demand for me i just thought it was cool idea to incorporate but i having soo much difficulties

with the current config above the below happens

but if i revers binary_sensors and switch then the enitys work

right now i been posting code up and down different spots in the configuration and then save then restart server well check configuration…
and just been dabbling i just didnt think be issues yet since Rasppbery pi been out long time…

my next progject i seen is there is a Modem option for Caller ID i wanna try but from the docs its not rully working properly or something but that be cool add on show whos called…

but i was just getting frustrated earlier took today off… it was just an add on… not critical

but always learning its not user friendly as i thought but i keep learning just need a break from it at times i guess

Thank you for the detailed explanations/descriptions.

  1. Just to clarify: The system was working before and then stopped, or it never worked?
  2. Forget Vizio TV and everything else, the real question is: Is your setup/approach the correct way to go about this automation, or there is something simpler?

If all is needed is to pump water out every hour for 15 minutes, then there are much simpler solutions: Use a smart/programmable plug such as the TP-Link HS105 ($14.00 at Amazon). If you want to do some fancy on/off programming, those smart plugs integrate extremely well with Hass.io. I have 12 of them and never had an issue.

So, my question then: Why is the ‘complicated’ route needed, what am I missing? The smart plugs are fairly reliable, and no much fiddling/tweaking is required.

ah ok…
well it works without the HA trying to connect to it…
so at the time i didnt know much about programing plugs… and i didnt know you could program plugs to save schedules

so what i have is i wrote a python script
so be like pump.py 16 on and then when i set it to shut off its pump.py 16 off
so ever 4 hours pump comes on and every 4 hrs 15 min it shuts off to simulate 15 min… then i if wanna change it to ever 2 hours … i have pre defined ones i just rem out and rem ones i dont wanna run… it was the easiest… and all i dud was ssh into to pi…

im new to home assistant as of last month really… i did amazon it and searched wifi plu and home assistant but didnt find… so the TP-Link HS105 does it save the schedule in the plug? or does it need to be ran by Home Assistant constantly? i didnt learn about HA till couple months ago

and i made this raspberry device from a project i wanted to build to water my Garden 200 feet from my house and u use raspberry pi and up to 32 relays or so… so i just took it got a 30amp relay and it controls my basement pump.

the complicated part is when you link Home Assistant to the Raspberry Pi… Home Assistant cant tell if the Pi is running or not if I toggle a switch it works… turns on but its turnning off now… but if i run pump.py 16 on on the pi it doesnt toggle the Switch in Home Assistant it will stay Off… sometimes HA notices the State and flips… and it iwll lock out 2 of the relays i plan to use on the PI… if i press the Button on Raspberry Pi Webserver… it will sometimes flip the Home Assistant Dashboard is on but wont toggle the Switch to ON or Off

if the pi is Running the Crontab so the pump is ON and if you reboot Home Assistant it shuts off the Pump when it should stay ON it shouldnt touch anything so if you had a living room Light ON and you reboot HA it would shut off the Living Room Light… it resets the state… it wont keep the current state it wont read the states properly and the switchs wont work properly when Cron or Webserver i press To Turn it on…

like when i built this project like Dec 2019 or Nov never heard of home assistant… and i was using Unraid and learning Crontab how to schedule things… so i was incorporating things…

as for the tv and everything esle i thought connecting to the Raspberry Pi was simple as that click the Discover and ur done…
but ill look up that TP Link see if that works for me too

guess i cant buy that TP Link one in amazon canada can you see what ones on canada amazon work best
that can save scedule in the device so doesnt need home assistant running once programmed,… and i looking least 15amp version most of the ones there state about Google Alexia tuyga etc but not really home assistant which ones be good oh and some i read questions searched and they dont work with home assistant… so i dont wanna order ones that wont work with it…

so if i were to make my message simplier

if Raspberry Pi Relay is “ON” then Home Asssitant Dont Touch and report GPIO correctly and corresponding toggles

if Raspberry Pi Relay is on and Home Assistant Reboots …Then Tell Home Assistant dont touch the rasppery Pi and just report the State and set the Switchs correctly

but its not doing teh 2nd part… its Resetting the Pi