so i figured out trial and error how to get
remote gpio to toggle switchs in home assistant VM by not using NodeRed not sure what that really is for…
but i can get a switch to turn on and off
but i if i toggle the same relay using a crontab on the raspberry pi home assistant doesnt notice its on or off…
what docs do i need to read uop on how to read state of raspberry pi gpio pin if its high or low and then refresh home assistant
also that it wont erase the current state of the raspberry pi when you reboot home, assistant… as you reboot and it resets raspberry pi
i read up a bit on template switch but examples werent helping me… nore how you incorporate to remtoe i guess you add host and platform
so was hoping you can point me right direction
i want to toggle a switch
to turn on and off a remote pi pin
also to read the state constantly of that pin if it changes by a cron tab or another switch that turns it on or off
and to update the home assistant
and if a relay is on and you reboot home assistant that it doesnt reset the raspberry pi and shut relay off
how do i do that or could you point me to a video good examples etc
do i need to make a raspberry pi switch.yami file etc, also looked into the garageqtpi file thing but the garage thing didnt work on raspberry pi i using a 4 and i had issues setting up so i gave up
ya done that i looking for more advanced then this
as a relay isnt a sensor? and it states
“Note that a pin managed by Home Assistant is expected to be exclusive to Home Assistant.”
but i need it to manage when Home Assistant reboots and and when a crontab runs that home assistant can detect it… how do you do that… as i did the above to get the toggle switchs to turn on and off a relay… but i need it to not reset when home assistant reboots and i need it to know if someone toggles that relay say pin 20 that home assistant says ok pin on… i read you do that with ther switch template but i having issues figuring how you do it for the remote raspberry pi mode
unless i need to change it to binary sensors for a gpio relay pin
so far i getting no where
i fidding with examples people done but there is no one really doing raspberry pi etc
as Relay pin and Sensor state have to be the same pin
as i dont have physical buttons on it yet
i use Crontab to turn on Relay pin 24 and 25 so far certain times of the day
so i trying to get Home assistant to detect if the Relay is on or off to say when the crontab is running
and when you toggle the switch it activates… and if you restart home assistant that it doesnt turn off the relay if crontab is currently running… but i having 0 luck trying to crash course myself learning this and trying to find the info on google which i having issues
so i trying trying random codes to try to get it to work
so anyone know?
Raspberry Pi has to run Crontab as its a mission critical setup to control a relay on certain time
but id like Home Assistant to be able to adjust the crontab.
and i want to be able for Home Assistant to read the state of the Relay GPIO State… and when Home assistant is rebooted i dont want it resetting the Mission critical raspberry Pi when its running…
how do you tell HA to not reset relay states on devices on a reboot.
how do you tell HA to read the GPIO when its not done by HA
what i have is Raspberry pi runs crontab that runs a shell i wrote to turn on and off a relay every 2 or 4 or 6 hours that i rem out
what i wanted is if the Crontab is running so the raspberry pi has a pin running relay then HA would say that pin is High or Low (ON or Off) but HA doesnt do that… then i find if i reboot the HA and if the Raspberry pi relay is on the HA shuts it off when it shouldnt… it needs to see its still on and to leave it alone… i also made little website before learning HA that i turn on and off the relay as i dont have physical on off switch to my Raspberry pi yet… and the website can see if the relay is on or off but the HA doesnt know…
so what i have is a .py that i run from crontab to turn on or off the relay and from website it runs some basic coding i found to flip on and off the relay
but id like to incorporate into HA… but when i google i dont find any real info i find about GarageQpi and template switchs and remote gpio so i confused and really what to use
i new to all this stuff i just followed some vidoes on the mqtt mosquito or something like that… i couldnt get the Node-Red to work right like the video showed after u install draw boxs then u get this dashboard to show up to click a switch well they didnt tell me where they pulled up that dash board … so i just learning… and im a visual learner not so much a word reader so when i look at the help docs as the examples doesnt reallt help without showing how it works in the dashboard… so i learning this stuff slowly
then my other question was if it couldnt work right if i could have home assistant on Raspberry pi running my crontab of a way to make crontabs in home assistant like any timer you buy in a store
and that the VM Home assistant could talk to the raspberry pi home assistant and send the updates like if Relay is on or off and not reset the after a restart… but illl look into the mqtt see how that works for raspberry pi cuz i can get it to work flipping on and off the switch in HA as you see the code above just doesnt know when raspberry pi has flipped the relay from other then home assistant… but ill try googling mqtt examples for raspberry pi
so my crontab is
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 i want HA to be able to know the state of pin 16 on the pi and if its running dont touch it when HA needs to be rebooted…
but id like to be able to make a timer easier to alter maybe check boxs in home assistant that would modify crontab or something else… right now i have different crontabs i just rem out
crontab is the program to edit your crontab file. It runs only for editing.
The program that runs stuff from the crontab file is cron[d]
There are thousands of howtos to control/read gpios over mqtt. Google finds. See eghttp://www.steves-internet-guide.com/mqtt-raspberry-pi-gpio/ or https://github.com/flyte/pi-mqtt-gpio
ah ok well same thing cuz crontab and cron be the same. because crontab cant do anything but cron then
ya maybe now there is thousands of control read gpio over mqtt as you mention but when your googling
“home assistant raspberry pi” or “home assistant read raspberry pi gpio state” or “home assistant remote raspberry pi gpio” or the one about GarageQPI you dont get any info on mqtt
but ill look at that tonight and see if any will work… since i was getting no where and no one had any answers for days … and maybe ill find answer why the node-red doesnt work like the tutorial videos lol
oh do you happen to know if there is a addon timer feature i did google it
but i didnt find what i looking for… looking for like outdoor timers you have 30 presets i wanted to know if you can do that in HA have like 30 presets u program from the screen like outdoor timer… on and off which day of the week it comes on… is there a feature like that?
oh ok i having 0 luck with the mqqt i looked at the sites you gave the github u could only go so far
the google searchs mostly if ur running mosuito on a rapberry hub and a client
i havhavent found a good one wherer you install the the client software on the raspberry pi and then VM home Assistant sees the raspberry pi for monitoring…
i getting confused itried about 6 or 7 different ones as i did check out thers but they use the same… but its all mostly been raspberry pi runs the server connecting to other devices that have mqtt nothinging where the raspberry pi running the client flawlessly so the HA can detect it…
so much for plug and play… as Home Assistant can detect my TV’s was hoping to easily setup and Raspberry Pi get detected just as easy at the Tvs
i gonna re try again the mqtt stuff again re research and see just wish there was a simple guide install these codes and boom your setup for plug and play kinda thing like my TV is setup