Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oakbrad/raspi-pir-mqtt-homeassistant
Simple script to read PIR sensor on Raspberry Pi and publish to MQTT, for use in HomeAssistant.
https://github.com/oakbrad/raspi-pir-mqtt-homeassistant
gpio hass homeassistant motion mqtt pir raspberrypi rpi sensor
Last synced: 19 days ago
JSON representation
Simple script to read PIR sensor on Raspberry Pi and publish to MQTT, for use in HomeAssistant.
- Host: GitHub
- URL: https://github.com/oakbrad/raspi-pir-mqtt-homeassistant
- Owner: oakbrad
- Created: 2017-06-04T22:49:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-04T22:59:44.000Z (over 7 years ago)
- Last Synced: 2023-11-16T00:26:50.979Z (about 1 year ago)
- Topics: gpio, hass, homeassistant, motion, mqtt, pir, raspberrypi, rpi, sensor
- Language: Python
- Size: 1.95 KB
- Stars: 16
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# raspi-pir-mqtt-homeassistant
Simple script to read PIR sensor on Raspberry Pi and publish to MQTT, for use in HomeAssistant.Instructions:
* Uses Paho MQTT library & process managed by forever
* Connect PIR sensor to 5v, Ground, and GPIO 4 on the Raspberry Pi
* Edit the script with your MQTT password, username, and host IP. You change the PIR GPIO if you hooked up to a different one
* forever start -c python3 raspi-pir-mqtt.pyIn Home Assistant, using the MQTT Binary Sensor component:
https://home-assistant.io/components/binary_sensor.mqtt/```yaml
binary_sensor:
- platform: mqtt
state_topic: "CHANNEL/Motion/Switch"
device_class: motion
payload_on: "1"
payload_off: "0"
name: "Motion Sensor"
```