Videx Buzzer alert/Automatic door opening switch on pressing Buzzer

No I2c are for the INA219 and it’s working. It’s the relay that’s behaving odd.

ok so youre recommending i test different pins for the signal for the relay only? I can try changing the signal wire itself to another new cable…maybe il also order another relay to test if the new one does the same thing

Yes. Try any of the GPIO priority pin above for signal pin but make sure as well as physically moving pin change it in Esp32 yaml in esphome sketch. Yes and try a different dupont cable. They are very thin and prone to breaking. In the end if can’t get relay working get a new relay. This can be done. It’s just frustrating. I have worked on ESP modules for days and then it suddenly works and I don’t know what I have done differently. These sort of problems appeal to me but for many especially when people first start these problems make them feel lost. That’s my pep talk. :sparkler: :sparkler: Sorry, tough day at work and need a win.

i dont actually understand what you mean by gpio priority pin…

here is a pic of my board and im not sure what pics are gpio priority so if you can tell me if its left or right based on the pic…

I know this is confusing. This is one of my esp32. Very similar to yours . I think G is same as D on your board. GPIO is general perpose input output.

priority pins

Some pins are easy to assign and some are fixed and it’s not always easy to tell which. These pins are usually easy for you to assign. You are going deeper down the rabbit hole with this stuff. If you pick the wrong pin you can get unusual results. See that pin bottom left that say GND it isn’t . This is things you come to expect. So potentially telling you to use pin 15 or 14 may be a wrong pin as D14 may not be GPIO 14.

thank you for this and being so patient with me dude!

Fuck this is getting complex, so potentially the GND on my board is not actually a ground then?

I have no clue what pin to try then after all this info…im lost lol

I also just found this diagram, seems to match mine identically…

GPIO Pins

ESP32 Wroom32 DevKit has total 25 GPIOs out of that few pins are Input only Pins,

Input Only Pins

  • GPIO 34
  • GPIO 35
  • GPIO 36
  • GPIO 39

Not all pins have input pullup, you need external pullup on these pins when using as input pullup.

Pins with internal pull up INPUT_PULLUP

  • GPIO14
  • GPIO16
  • GPIO17
  • GPIO18
  • GPIO19
  • GPIO21
  • GPIO22
  • GPIO23

Pins without internal pull up

  • GPIO13
  • GPIO25
  • GPIO26
  • GPIO27
  • GPIO32
  • GPIO33

Yeah. True. Some pins are wrong. Often you will guess right. Sometimes you have to search for your specific board to find which pins actually correspond to the GPIO pins as in my AZ delivery board. This is all part of the fun. This is all to say its not impossible just sometimes difficult. HA is very attractive to people who are a bit obsessive/nerdy. That’s not an insult. I’m one of those people. Today is 1 year since I started using HA. Sorry but some C2H5OH consumed this evening which is why I am being a bit more verbose.

Not sure if youve noticed but if you refresh your page, you will see ive added a pic and some info about my specific board on my previous post…

G do correspond with D for GPIO ( if this is the same as your board). Try some of them to see it they work. Try the one without pullups and if that doesn’t work try the one’s with pullup. The pull up is a resistor pullup. Typically for sensor if you don’t use a pullup the wire can pick up stray electrical signal and make sensors fire off. There is alot of electrical interference out there. Even moving your hand towards the device can can set it off. That’s what all that twisted wire pairs in lan cables is about to give you good signal at >20 meters.

but what about this internal input pullup crap now? lol

ok so in theory your suggesting these:

Pins without internal pull up

  • GPIO13
  • GPIO25
  • GPIO26
  • GPIO27
  • GPIO32
  • GPIO33

Yeah. Try them first. Inspiration/perspiration. Whatever works works.

lol thanks buddy. ill play with it tomorrow now. time for bed. brain is a little fried lol. thanks again for all your help and knowledge today :slight_smile:

So none of the other pins work

So just for clarity, below is a pic of the relay and you can see the wire is in the NC position. You can also see the red circled button itself. So correct me if im wrong but the physical switch is in the open position which means in theory the red wire going to NC should also be in the NO port of the relay right?

Reason I ask this is because when it is connected to:

NO = doesn’t buzz but when power supplied to esp32, relay then turns on unlock buzzing constantly

NC = constant buzzing until power supplied to esp32, relay then turns off unlock buzzing

so its either wrongly labelled or a faulty relay? I seem to think wrongly labelled for that part of it as when you power it up when connected via NO, the buzzing stops and its the reverse when in NC,

On the read logs, the signal IS being read and the voltage increase IS triggering the relay, just doesnt actually work so I am inclined to feel the relay might be faulty or shit. Ive bought 2 additional relays which will arrive in a couple days so i can test but I have also bought a new ESP32 board just in case too. We know the INA219 works fine so its either going to be the relay or the board (i suspect the relay) as the signal coming to the relay doesnt seem to trigger any change.

Just seeking clarity my train of thoughts here are correct and logical. When the relay powers on you hear a click but when the signal is sent to turn it on and off, there is no click ever (it should click when changing state right?)

I built another one this morning on a breadboard, and it works.

The relay does need to be connected in as a normally open setup. So if your ESP32 is powered off the relay is open and your door will stay closed. Each time the relay is closed then it clicks and the red LED comes on and 5 seconds later it clicks off and LED goes off.
In my test above the white LED is my doorbell and when I connect the white wire which goes off screen to the empty blue terminal of the INA3221 (different from INA219 only a little. I really should have left it connected to the currently empty terminal and just put a button inbetween.) the INA reads a voltage of 3.2v and it tells the relay to open for 5 seconds. Even if it still reads 3.2v after 5 seconds (like someone is still pressing door bell longer than 5 seconds) the relay closes and door won’t be able to be opened until release doorbell and press again. I suspect fault relay.

logger:
  level: DEBUG
# Enable Home Assistant API
api:

ota:



i2c:
  sda: 21
  scl: 22
  scan: True
  id: bus_a


sensor:
  - platform: ina3221
    address: 0x40
    update_interval: 2s
    channel_1:
      shunt_resistance: 0.1 ohm
#      current:
       # name: "INA3221 Channel 1 Current"
        #filters:
         # - multiply: 10.0
#      power:
 #       name: "INA3221 Channel 1 Power"
  #      filters:
   #       - multiply: 10.0
    #  bus_voltage:
     #   name: "INA3221 Channel 1 Bus Voltage"
      shunt_voltage:
        name: "INA3221 Channel 1 Shunt Voltage"
        on_value_range:
          above: 2
          then:
            - switch.turn_on: relay
            - delay: 5000ms
            - switch.turn_off: relay        
        filters:
          - multiply: 80000.0
 
switch:
  - platform: gpio
    pin: 15
    id: relay
  - platform: template
    name: "Door Remote"
    icon: "mdi:door"
    turn_on_action:
    - switch.turn_on: relay
    - delay: 5000ms
    - switch.turn_off: relay  

Different wifi stuff on mine.
Changed the Update interval so had to press door bell or in my case turn LED on for 2 seconds for door/relay to open. Thought that might be more practical.
Hashed out all the lines about current, power and bus voltage (this is then invisible to ESP32). Don’t need these but was just going to test them later.
The reason I needed a filter multiplier of 80000 was to bring the INA voltage to above 3 so automation would fire. Could have not used a multiplier but then would have had needed value ranges above 0.00001 V. Just a way of calibrating the INA to give more useful numbers.
Used a different ESP32 that had terrible wifi reception until I put an antenna on it.

Good luck with new equipment.

thanks spiro.

ill give this updated code a shot and see what happens. if same results using this, ill try with the new hardware tomorrow and see what happens…thanks

Ok new relay arrived and exactly the same problem :frowning:

I also just in case bought a 4 channel relay (different brand from same company) AND IT WORKS LIKE A DREAM!!!

THANK YOU SO MUCH FOR EVERYTHING SPIRO!!

I am genuinely so happy and thankful for all your help. You dont know how much headache you have saved me my friend. Its weird though that 2 brand new single channel relays dont work but the 4 channel does. I guess if a relay goes I have spares built into the same board lol.

I will defo be getting a refund for the faulty ones or maybe they are just cheaply manufactured and dont work as well on this setup? Who knows. Dont care. It works :smiley:

1 last thing…

When i press the button it instantly starts the unlock buzz. Can i delay it for maybe 3 seconds or so? If so what would i need to add to the code for a slight delay in the buzz process if i wanted it? could you give me the code in a working example please so i can just copy and paste where needed :smiley:

Thanks in advance

Ha :smiley: Now you’re beginning to tinker with it. It can become a bit addictive. See above I have just put a delay of 3000ms before it opens relay. Try that. Glad you got it working.