Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Snipercaine
Last active August 11, 2023 03:40
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save Snipercaine/889024b0f13302928c7251e1578734d6 to your computer and use it in GitHub Desktop.
Save Snipercaine/889024b0f13302928c7251e1578734d6 to your computer and use it in GitHub Desktop.
binary_sensor:
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Garage Motion'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: 'D54C1E'
off_delay: 10
device_class: motion
qos: 1
retain: false
- platform: mqtt
name: "Garage Fridge"
state_topic: "tele/RF_Bridge/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "DF000A"
payload_off: "DF000E"
device_class: Cold
qos: 1
retain: false
- platform: mqtt
name: "Shop Door"
state_topic: "tele/RF_Bridge/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "F8030A"
payload_off: "F8030E"
device_class: Door
qos: 1
retain: false
- platform: mqtt
name: "Basment Water"
state_topic: "tele/RF_Bridge/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "84B90E"
off_delay: 10
device_class: Moisture
qos: 1
retain: false
- platform: mqtt
name: "Office Wand"
state_topic: "tele/RF_Bridge/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "D31421"
off_delay: 10
qos: 1
retain: false
- platform: mqtt
name: "Office Book"
state_topic: "tele/RF_Bridge/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "C7C2A1"
off_delay: 10
qos: 1
retain: false
##Automations for RF Sensors and Fun
- alias: 'Garage Fridge Open'
hide_entity: true
trigger:
- platform: state
entity_id: binary_sensor.garage_fridge
from: 'off'
to: 'on'
for: '00:02:00'
action:
- service: media_player.alexa_tts
data:
entity_id: media_player.kitchen_dot
message: "Can someone please close the garage fridge?"
- service: tts.google_say
data:
entity_id: media_player.adenaudiocast
message: "Can someone please close the garage fridge?"
- alias: 'Basement Water Leak'
hide_entity: true
trigger:
- platform: state
entity_id: binary_sensor.basment_water
from: 'off'
to: 'on'
action:
- service: tts.google_say
data:
entity_id: media_player.adenaudiocast
message: "Holy Crap there's water in the Basement again! Call someone, do something, ahhhhhhhh?"
- service: media_player.alexa_tts
data:
entity_id: media_player.dads_office
message: "Holy Crap there's water in the Basement again! Call someone, do something, ahhhhhhhh?"
- service: notify.ios_justin_iphone7
data:
title: WATER LEAK
message: "Holy Crap there's water in the Basement again! Call someone, do something, ahhhhhhhh?"
- service: input_select.select_option
data:
entity_id: input_select.all_leds
option: Police All
- alias: Office Lock Magic
hide_entity: true
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.office_book
to: 'on'
- platform: state
entity_id: binary_sensor.office_wand
to: 'on'
action:
- service: switch.toggle
data:
entity_id: switch.office_lock
- service: tts.google_say
data:
entity_id: media_player.adenaudiocast
message: "You have chosen wisely. You may enter my realm"
- alias: Garage Lights Off
hide_entity: true
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.garage_motion
from: 'on'
to: 'off'
for:
minutes: 5
action:
- service: switch.turn_off
data:
entity_id: switch.garage_lights
- alias: Garage Lights On
hide_entity: true
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.shop_door
to: 'on'
- platform: state
entity_id: binary_sensor.garage_entry
to: 'on'
- platform: state
entity_id: binary_sensor.garage_motion
to: 'on'
condition:
- condition: state
entity_id: switch.garage_lights
state: 'off'
action:
service: switch.turn_on
data:
entity_id: switch.garage_lights
@BentUhrenholdt
Copy link

BentUhrenholdt commented Sep 19, 2019 via email

@BentUhrenholdt
Copy link

BentUhrenholdt commented Sep 19, 2019 via email

@BentUhrenholdt
Copy link

BentUhrenholdt commented Sep 19, 2019 via email

@Snipercaine
Copy link
Author

Snipercaine commented Sep 20, 2019 via email

@Luciano3272
Copy link

hi, sorry I speak english very bad.
I'm new in HA, I'd like to know if u can help me to give a function up and down in a sonoff pir motion sensor .
I saw this example:
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Garage Motion'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: 'D54C1E'
payload_off: 'D54C1Eoff'
device_class: motion
optimistic: false
qos: 1
retain: false

but I don't know where I found this info like ... ( D54C1Eoff ... )
Thanks in advance
Lu

@Snipercaine
Copy link
Author

Snipercaine commented Nov 11, 2019 via email

@BentUhrenholdt
Copy link

BentUhrenholdt commented Nov 11, 2019 via email

@Luciano3272
Copy link

Thanks, with " off_delay: 30 " . all works !!!
Only for info a little question.
If I add more pir ( example 5 or 10pc ) the system becomes heavy or does not suffer?
Lu
p.s. for fan : DrZzs when you want to do a short tutorial on Jinvoo smart switches that are spreading in Europe :D

@Snipercaine
Copy link
Author

Snipercaine commented Nov 11, 2019 via email

@BentUhrenholdt
Copy link

BentUhrenholdt commented Nov 11, 2019 via email

@oldercodergithub
Copy link

Nowadays we get such error on check config.
.... [retain] is an invalid option for [binary_sensor.mqtt]....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment