Skip to content

Instantly share code, notes, and snippets.

@jhalbrecht
Created June 12, 2019 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhalbrecht/2dbf4a858efb48a5831b8f813bc9ab7b to your computer and use it in GitHub Desktop.
Save jhalbrecht/2dbf4a858efb48a5831b8f813bc9ab7b to your computer and use it in GitHub Desktop.
Home assistant sonoff tasmota rf bridge pir configuratiion
# binary_sensors.yaml
- platform: template
sensors:
test_pir_00:
value_template: '{{ is_state("sensor.sonoff_rf_bridge", "EA0FDE") }}'
# delay_off: '00:05:30'
delay_off: '00:00:30'
device_class: motion
friendly_name: "PIR One"
# sensors.yaml
- platform: mqtt
state_topic: 'tele/homeamation/rf/sonoff/RESULT'
name: sonoff_rf_bridge
value_template: "{{ value_json.RfReceived.Data }}"
expire_after: 1
# automations.yaml
- alias: Turn on shelly when there is movement
trigger:
platform: state
entity_id: binary_sensor.test_pir_00
from: 'off'
to: 'on'
action:
service: homeassistant.turn_on
entity_id: switch.shelly01
- alias: Turn off shelly001 1 minutes after last movement
trigger:
platform: state
entity_id: binary_sensor.test_pir_00
from: 'on'
to: 'off'
for:
minutes: 1
action:
service: homeassistant.turn_off
entity_id: switch.shelly01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment