Getting frustrated How to get HA to discovery a Raspberry Pi

alright let me test ill get back to you

Pi_____________Relay
(5)5.5v-------------->VCC
(14)Ground-------->Ground
(16)BCM 23------->Signal
…GND+SNG bridged pin for 5v VCC mode

with pin 16 unplugged its off

with pin 16 reattached

![p3|416x500](upload://3SL0qN4LdnolBItbeFRShOcT3VW.png) 

so i tested pullling the signal pin in and out of the rpi and makes the sensor
going on and off…

yet its off because the relay doesnt come on because its not set to HIGH

The relay you are using , if you read the ratings page, the last picture on the amazon page, states the max rating is 12 amps, and it states resitive load. No rating shown for inductive load, probably 3.5 to 4 amps if allowed at all, not enough for 3/4HP Motor. The applications listed , nowhere does it say any kind of inductive loads. It may work, and may last a while, and may melt into a heap or catch fire. I don’t see any CSA or CUL certification, calling very much into question the safety and actual ratings. I strongly advise getting an electrician to put in a proper contactor, which you can drive with your relay module. Not trying to burst your bubble, but better to know than not. And if this is mission critical as you have suggested, and drjb pointed out, the RPi and HA are not the most reliable set-up. I run a 3/4 pool pump off mine, and have had ocasional gltches and HA outages for more than a couple hours, mostly of my own causing… The electrician will more than like suggest a heavy duty timer relay, or better. Won’t cost much to ask.

so i if pull the signal ground bridge it works.
i dont know where you seen 12amps or restivie load for the 30 amp relay. and then its stamped on the Relay its a 30 amp… and when i contacted RobotDYN from there website i asked them if it would work… so 250vac 30 amps is 15 amps at 120v
and i only drawing like 6 7 amps… so its low enough

i had heavy duty timers… but they burn out . and you cant quickly changed the times in less then 1 min… regular timers you gotta manually program. so to change time you need like 5 timers and unplug and re plug in next one…

i wrote the the python code and the Cron tab… so it has 5 seperate timers… i just rem out which timer mode i need anytwhere from run every single hour for 15 min … or every hour 1 hour run for 45 min to every 2 5 8 hours at various times… heavy duty timer u cant flip back and for… plus heavy dutty timer cant run when i ssh 2 -4 hour drive away as i have a camera… and then i can see when i need to turn on the pump. as you cant let a well pump run dry… as i cant run a sump pump…

RPI been running over a year on just crontab and the 30amp and i had a electrican look at it … nothing wrong with ith … Power wire outlet Live and the Outlet to the pump is wired to the the relay… and the ground and Neutral wired together…

but i hear ya… i guess ill just leave the Home Assistant out then as there is no issues with the relay

so how can i link a Switch to a Binary Sensor port
so i can add a Switch to the dash board to Pin 23 and be able to read if its High Or Not

because a Wifi Light switch has to work the same. it has to work when Wifi is not connected but it also has to send the state when it connects…

ah guess its not going to work the same way i hoping… and i dont know how a Wifi switch works because the way you make it sound
if Wifi light switch isnt connected to HA then the Light will not work. but it has to work if the Wifi isnt working

guess i gonna do more reading and reasearch… i appreciate teh help so far… just didnt go the way i was hoping lol

but technology is great when it works (:

and thats why i was stating raspberry Pi runs a crontab as mission critical

the HA was just an addon i was looking for… its supposed to work with it not take it over completely… but its not going the way i was hoping or i not 100% explaining or there is other ways around it i guess raspberry pi timer has to run no matter if HA is running or its down for 2 weeks. raspberry pi needs to run its own internal timer
i just wanted the HA to work on showing its State and also be able to turn on and off the relay in conjuction

So, the HA you want to use with remote rpi, cannot run with cron tab calling the .py program which is confusing the RPi. The problem you last had is that you configured HA as binary sensor, but connected a relay to the pin. If you had set it up as a switch, which it needs to be if wired to a relay, it would have switched the relay on and off, based on the wiring you sent. The state of the relay would be shown in HA. The relay pulled the sensor pin you set-up low, and showed it as on. because a small amount of current is leaking to ground through the relay optical isolator circuit. You don’t need a binary sensor as HA will show you if the relay is on or off. If you want guaranteed that the relay is actually powering the pump, then you will need to set-up some sort of binary, seperately to see the voltage at the pump is on.

FWIW, the data sheet for the relay itself (Songle SLA-05VDC-SL-A) says 30A resistive load. It also says 1HP motor at 120vAC.

Thats good news, its interesting that on Amazon link, 5th picture, second column, 7th bullet, it states 12 Amp resistive load. In my experience I don’t trust these unless it has a safety cert for CSA, CUL or similar. In many countries, you can make a data sheet with little fear of having it tested. When you look at a contactor, with CSA rating for 1H.P. motor, the differences between these and a songle micro relay is more than stark, IMHO.

1 Like

People should really understand… I get it, but then can you explain why Amazon says they can be used on lights/fans/etc ??? Here is the link, read carefully. It does not say anything about resistive loads only. It says electronic, but why the fans? The fans, speakers, transformers ALL have some inductive (ie not just resistive) load.

True, but THIS is the size of contactor I would expect (and trust) to carry a 30A inductive load.

https://www.amazon.com/Packard-C230B-Pole-Contactor-Voltage/dp/B001KGSJ74

1 Like

It seems there’ll be some more readings these coming days. I asked this same question in a different forum, where such plugs are used left/right on everything that draws power.

What we really need is a more detailed description of all the hardware the OP is trying to control. Only then we can make ‘sensible’ recommendations.

Also, here is some additional feedback from another forum I read. Make sure you read the linked discussion about the HS plugs.

so what i noticed is the binary sensor will display correctly
but

there is a prong that the company said you use Sng GND you bridge them if ur using 5v for the octocoupler… but if ur using 3v then you pull the jumper off… now what i noticed earlier if i pull the jumper off the HA reads the relay correctly and says the Relay is off and if you run my pump.py 16 on doesnt work it says its high but it wont go unless i add the jumper

and i find i have to restart HA server twice for the binary sensors to detect. first time it wont like things restart it again it works
but is there no way if Relay Is on when HA reboots that it leaves the state it is so “ON” instead of sending the “OFF” command

and could you guys help with a Toggle… that turns on and off a relay

i did look at the MQTT stuff again
i just dont know how to send to the HA dashboard
on the pi i said

pi@pump:~/bin $ mosquitto_pub -h 192.168.0.153 -u mike -P mike -t pump -m “16 on”

so i log in name mike pass mike for the mqtt server
the topic is pump
and the command is pin 16 ON

maybe this stuff over my head or i need to watch some videos that are detailed instructions or details

wish there as a school night class or a Zoom Teacher that teachs you the basics the fundamentals Lab work… i teaching myself from google searchs and guessing how thse examples in the documentations/integrations work… just copy past example yami and guess how it works

I would strongly agree.

I am not going to get into a pissing match with you over this. I certainly wasn’t saying you can’t use them for any inductive load, I am pointing out that you cannot run a 12amp inductive load on on a relay rated for 12amp resistive. Its dangerous. As for your expert on your other board, who thinks I am making this up, read this: https://www.hvacrschool.com/res-mean-contactor-relay/. Without getting too technical, the rotating magnetic field is what cause the issues, and as the relay contacts break and the motor slows it is now generating power, but it is out of phase with the line power, this makes the arc hard to stop. Where as a resitive load the arc will go out when the line voltage drops the zero on the first A/C cycle. As for the comments and ideas presented that we should find out more before we recommend equipment for this, no we shouldn’t. A fully qualified and licensed electrician should look at it an recommend a safe, code compliant solution considering the location, equipment, duty cycle and local conditions. You don’t have to believe me, but with 45 years working on electrical equipment, and having taught electrical theory to apprentices at one point in my career, and been an accident investigator for a Power Generation company, its your choice, I have tried.

1 Like

so since you guys talking about relays. and you dont seem to like this overrated 30 amp relay or the IOT relay i guess.

so what 5v raspberry pi/arduinio relay do you recommend for 30 amps so a 6amp draw doesnt friy it… so with alll this contactor relay then whats a light switch rated at when you wire a well pump to a light switch to turn on and off … so i guessing these cracks at me for buying 30amp 1hp rated relay. and the manufacture said its perfectly fine…
so then if this company bad or the IOT one.

what canadian/usa 5v 30amp rated Relay do you recommend… including solid state
or are you saying you need 1 relay to power a 2nd relay that only drays 1 amp
so id have 3 Relays to turn on 1 pump then… the 30amp i have a contactor at low amperage plus the other contactor.
so whats the bad rating for the IOT raitings for a pump

either way still having problems getting a toggle switch on the dashboard to control things… as i dont find enough videos for HA or live chat with someone so when they go over stuff i can ask questions

Trying to figure it out what you are trying to do. Just wondering is your GPIO working if the HomeAssistant running on your RPI? If yes. Then its much easier to run 2 home-assistant and then combine the RPI one into your main Home-Assistant. This way you will get a 100% working devices without any problems. Hooking 2 home-assistant is also very easy and you can control what is the main home-assistant need to see or discover.

Anyway just some ideas…

@KingRichard
ya i asked about if it be easier to run 2 home assisstant…
see orginaly for a year… i been running Raspberry Pi and crontab to turn on and off a 3/4 hp pump to pump water out of my basement… using crontab that i had different programs i can rem out… instead of using 5 or so digital outdoor timers programming 30 programs for each one etc.

so i then found way to get webserver to run on it so i could turn it on and off from a push website so when im 2 hours away and needs to pump water i can… as i dont have a sump hole i have to pump water out of a 2" hole that pumps into a barrel and then the sump pump in the barrel pumps outside of the house… as im surrrouned by water. basiclly and its a 50k renno to dig up around the house and redue it… so that was my solution

so i learned about Home Assistant… and i tried to incorporate it. crontab a physical push button on the Pi (future add) or website and then Home Assistant would match … so if i pressed "ON " button on the raspberry pi. HA would say Pump is on and the switch is Toggled On… and vise versa… i tried googling about it for a lamp as its the same concept… learned about Node-red had issues and learned MQTT didnt figure understand it completely. most builds i found used ESP but i using RPI then i read about Garage QPI but i had issues installing it i got so far then got 404 errors doing the instructions…

but ya if i could run home assistant and timers on the RPI solo be good better then my toggles and having to rem out my crontabs… maybe a check box to choose which sceduler to run… and then communicate the main HA this way when Host HA reboots the raspiberry pi HA keeps working
but so far still HA resets the pi… and i cant figure how to get Toggle switch to work to just control 1 GPIO read switch templates but i dont see pictures

just text in the docs… i need like videos how you set up a switch template step by step instructions

was hoping there was a book like a text book on Home Assistant so you do intro to switchs it shows you how to do you then follow it… just like a microsoft text books you read and then do the sceneraios to duplciate it but never found anything like that

but ya if i could get 2 HA to work together be good so if the the RPI can run independtlyy like a Wifi Light switch. ligh switch has to work even if it cant access HA… so same thing here RPI still needs to work without the Main HA… i do like this and trying to learn this stuff on my own … as i dont see enough break downs… of what each line means as the there are examples where some of the lines are not explain below the code as its not in there…

@KingRichard

so to sum up what i said above…
if i could get 2 HA and work together
if i could convert my RPI crontab and push button to a HA to simplifier Scheduler of crontab and add the Push button… as the RPI also doubles as a Streaming Radio

and then i have another HA that would control lights… etc so that way the Non Rpi HA reboots it doesnt affect the RPI HA

If you can have it working on RPI + Home-Assistant for your water switch then you should run 2 HASS. To connect two Home-Assistant simply install HACS and add Remote Home-Assistant integrations. Once you connect the RPI home-assistant to your main home-assistant then you will be able to add the RPI HASS switch into your main HASS easily. I did on mine.

Main HASS running on Synology and have 2nd RPI running home-assistant for other purposes.

As you can see the RPI information is being gathered from my RPI HASS to my Synology HASS

@KingRichard
ok ill try that as like my way is working fine over a year Before HA i thought adding this HA wouldnt been a plug and play simply but i didnt realize how much difficulty i was having …

ill try that today and see about getting HA on the on RPi
thanks i aprpeciate everyones help so far…