Pir sensor help using gary guide

Hi all, i’m following this guide guide added" the code:

  - platform: mqtt
    name: "Drive Beam Break"
    state_topic: "stat/drive-beam-break/POWER"
    payload_on: "ON"
    payload_off: "OFF"
    qos: 0
    device_class: motion

to my sensors.yaml
geting next message when checking my configuration:
Invalid config for [sensor.mqtt]: [payload_on] is an invalid option for [sensor.mqtt]. Check: sensor.mqtt->payload_on. (See ?, line ?).

any idea?

My initial guess is that you are creating an MQTT sensor (which does not have payload_on nor payload_off) instead of an MQTT binary sensor

ok, so what should I change in my configuration? (sensors.yaml)

We don’t see your configuration.yaml file but I suspect you have this:

sensor: !include sensors.yaml

while you should have this:

binary_sensor: !include binary_sensors.yaml

and rename your file move your binary sensors information from sensors.yaml to binary_sensors.yaml

(sorry, check edit)

Thank you!

I need some more help if possible…
it’s my first time to use ESPhome, I’m trying to follow the above guide, I don’t understand what are the steps for configuring the Wemos D1 Mini ESP8266 chip
thank you

I have a Wemos D1 mini with a PIR (among other things) and this is the configuration file I have in ESPhome:

esphome:
  name: wemossensor01
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "redacted"
  password: "redacted"
  manual_ip:
    static_ip: 192.168.88.102
    gateway: 192.168.88.1
    subnet: 255.255.255.0  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Wemos Sensor 01 Fallback Hotspot"
    password: "redacted"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

binary_sensor:
  - platform: gpio
    pin: GPIO14
    name: "Motion WS01"
    device_class: motion

I hope this helps. If not, please try to specify a bit more where the problem is, what steps you have made, where you are stuck, logs, …

thank you so much I really appreciate!
my problem is not yet with the configuration
but with flashing the ESPhome
I don’t understand what are the steps needed for
A. flashing itself
B. configure the D1 Mini as shown in the guide
C. connecting to HA

Have you installed ESPhome in HomeAssistant?

Yes I did, ok, I understand how to flash the basic bin file on the Wemos D1
but after that how do I configure it as shown at the guide
and how do I add it to HA without erasing that configuration
sorry trying to explain:
A. I installed ESPHOME
B. I can see the Wemos D1
C. I changed his wifi to my home wifi
D. how do I change the configuration of the “pin1 and the other pin”
E. how do i change the Mqtt for the Wemos D1

Hi, I don’t understand the “pin1 and the other pin” but I’ll assume that:

  • You have connected (in the Wemos) 5V and ground to 5V and G (red and black cables from the guide you are referring to)
  • In that guide, data (yellow cable coming from the PIR) is connected to D1, which is GPIO05, and this is what you have to put in the configuration file

So:

esphome:
  name: wemossensor01
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "redacted"
  password: "redacted"
  manual_ip:
    static_ip: 192.168.88.102 # change this
    gateway: 192.168.88.1 # change this
    subnet: 255.255.255.0  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Wemos Sensor 01 Fallback Hotspot"
    password: "redacted"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

binary_sensor:
  - platform: gpio
    pin: GPIO05
    name: "Motion WS01"
    device_class: motion

Then flash it to the Wemos.
Concerning MQTT, I think you shouldn’t do anything if you have it already enabled in HomeAssistant; it will autodiscovery the node.

thanks
did it. at the the device screen in HA I have two problems:
A. “the device is disabled by Config entry”
B. all the sensors are disabled

Sorry. What is the “device screen”? Any screenshot you could share?

Sorry. I haven’t had this issue in the past. Not sure how to guide you through this. Probably it is a good idea to open a new post in the ESPhome subforum with that error message in the title and provide as much information as possible: HA instalation method, system info, device yaml file in ESPhome, logs from the device in ESPhome, logs from HA.
Good luck!

Thank you for all your help!