Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In case of Arduino board restart or i2c line cut and recover ESP sending frenetically sensor state ON – OFF until restart #6

Open
balazs111 opened this issue Jul 4, 2024 · 1 comment

Comments

@balazs111
Copy link

Hello

I wonder how can I made this a little bit more fault tolerant?
I having problem when the port expander restarting or i2c line cut and recover.

After transient problem is gone it is sending frenetically sensor state ON – OFF until restart

[D][binary_sensor:036]: 'Living PIR': Sending state ON
[D][binary_sensor:036]: 'Living PIR': Sending state OFF
[D][binary_sensor:036]: 'Living PIR': Sending state ON
[D][binary_sensor:036]: 'Living PIR': Sending state OFF
[D][binary_sensor:036]: 'Living PIR': Sending state ON
[D][binary_sensor:036]: 'Living PIR': Sending state OFF
…………………………

Also I want to catch the event somehow if no connection and shut down some system until it is not recovered.

This is my test code:

external_components:
  - source: github://glmnet/esphome@ape-external-component
    components: [arduino_port_expander]

arduino_port_expander:
  id: expander1
  address: 0x08
  analog_reference: DEFAULT

binary_sensor:
  - platform: gpio
    pin:
      arduino_port_expander: expander1
      number: 9
      mode:
        input: True
        pullup: True
    name: Living PIR
    id: pir_sensor


output:
  - platform: gpio
    pin:
      arduino_port_expander: expander1
      number: 5
      mode:
        output: True
    id: tank_pump

sensor:
  - platform: arduino_port_expander
    id:  lm35_temp
    pin: A1
    name: LM35 Living room temperature
    update_interval: 10s
    filters:
      - multiply: 0.0032258064516129 # x / 1023.0 * 3.3 v

Thank you

@balazs111
Copy link
Author

With a pull up resistor i was able to correct this behavior. So i am fine. I not closing this case just because you might want to document it. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant