taida 发表于 2023-5-7 22:06:02

MQ-2烟雾传感器刷esphome?

各位,我想了解一下,M Q-2烟雾传感器想用esphome代码,只能使用adc来实现?io口可以吗?

zkxa 发表于 2023-5-8 09:43:53

这个好像只能ADC吧。

taida 发表于 2023-5-8 22:53:36

binary_sensor:
- platform: gpio
    pin:
      number: GPIO2
      mode: INPUT_PULLUP
      inverted: true
    name: "烟雾传感器"
    device_class: smoke
switch:
- platform: gpio
    pin: 0
    name: "烟雾开关"
    id: somking_switch
#    icon: "mdi:ceiling-light"
    inverted: true   


我使用这种方式可以实现,还在测试中

gtyun 发表于 2024-1-31 00:02:45

taida 发表于 2023-5-8 22:53
binary_sensor:
- platform: gpio
    pin:


接的是DO?
页: [1]
查看完整版本: MQ-2烟雾传感器刷esphome?