brandond / esphome-tuya_pir

ESPHome support for cheap WiFi PIR sensors
66 stars 21 forks source link

Status not updated #16

Open JvdBBBB opened 4 years ago

JvdBBBB commented 4 years ago

I have the door sensor and the pir sensor from LSC Smart Connect. I have flashed esphome on it and used practically the .yaml provided.

The devices are showing up in Hass. And the devices are sleeping and waking up as expected. But it is not working perfectly: For the door sensor: The status is never updated. De status of the battery and WiFi strength are working fine. For the pir sensor: The status is only updated when motion is detected, there is no update when there is no motion detected.

Any idea what is missing?


  name: pir
  platform: ESP8266
  board: esp01_1m
  arduino_version: 2.5.1
  board_flash_mode: dout
  includes:
    - sb1_uart.h

wifi:
  ssid: "ssid"
  password: "pass"
  fast_connect: true

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "ssid"
    password: "pass"

captive_portal:

# Enable logging
#logger:

# Enable Home Assistant API
#api:
ota:

mqtt:
  broker: 'x.x.x.x'
  username: 'user'
  password: 'pass'
  birth_message:
  shutdown_message:
  will_message:

uart:
  - tx_pin: 1
    rx_pin: 3
    baud_rate: 9600
    id: uart0

logger:
  level: INFO
  hardware_uart: UART1

sensor:
  - platform: wifi_signal
    name: "pir Signal"
    update_interval: 10s
    expire_after:
    filters: []
  - platform: adc
    name: "pir Battery"
    update_interval: 10s
    expire_after:
    pin: VCC
    filters:
      - calibrate_linear:
          # Map volts (from sensor) to % (for HA)
          - 2.8 -> 0.0
          - 3.6 -> 100
    unit_of_measurement: "%"
    accuracy_decimals: 0

binary_sensor:
  - platform: template
    id: motion
    name: "pir"
    filters: []
    device_class: motion
    lambda: "return {};"

custom_component:
  - id: sb1_uart
    lambda: |-
      auto component = new SB1UARTComponent(id(uart0), id(motion));
      return {component};
workingmanrob commented 1 year ago

@JvdBBBB I'm having the exact same issue with a door sensor here attempting to monitor a mailbox.

I see the MQTT connected message. The device wakes, phones home and sleeps but the sensor status is never updated.

door open

[14:41:46][I][app:134]: Rebooting safely...
[14:42:33][I][mqtt:216]: MQTT Connected!
[14:42:34][I][app:062]: setup() finished successfully!
[14:42:34][I][app:102]: ESPHome version 2022.8.3 compiled on Sep 19 2022, 14:40:43
[14:42:35][I][sb1:375]: Rebooting: SB1_STATE_RUNNING_NORMAL
[14:42:35][I][app:134]: Rebooting safely...

door close

[14:43:23][I][mqtt:216]: MQTT Connected!
[14:43:23][I][app:062]: setup() finished successfully!
[14:43:23][I][app:102]: ESPHome version 2022.8.3 compiled on Sep 19 2022, 14:40:43
[14:43:24][I][sb1:375]: Rebooting: SB1_STATE_RUNNING_NORMAL
[14:43:24][I][app:134]: Rebooting safely...

HA never updates the state.. image