OK here goes, Hi I am a complete newbie at this, I apologise in advance for anything you may think i’m being a tit for not understanding, please break things down so i understand and if referencing to files etc. please say where i’ll locate these said files etc.
I have a windows 7 dedicated server
It has Python 3.7.4 (latest at writing of this)
I have installed HA and running the UI as we speak.
I have an independant MQTT broker (mosquitto) running on same server pc and it is working fine as I have MQTT.fx on a client PC able to remote into it.
I have a sonoff RF bridge flashed with OpenMQTTGateway which is working flawlessly as it is currently reading an RF 433Mhz button keyfob. And it is configured to log to the MQTT mosquitto server.
When I press the keyfob button the mosquitto server gives this reading:
home/OpenMQTTGateway/SRFBtoMQTT/Raw
2BA2012204104BDAB2
home/OpenMQTTGateway/SRFBtoMQTT
4971186
home/OpenMQTTGateway/SRFBtoMQTT/Tsyn
1117
home/OpenMQTTGateway/SRFBtoMQTT/Thigh
290
home/OpenMQTTGateway/SRFBtoMQTT/Tlow
1040
Using this info and a lot of tutorials i have compiled (please correct/re-write if i have made mistakes or you think it can be done better, as im only new to this) in note pad these following entries:
binary_sensor:
- platform: mqtt
state_topic: "home/OpenMQTTGateway/SRFBtoMQTT"
name: 'Door Bell'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: '4971186'
payload_off: '4971186off'
device_class: door
optimistic: false
qos: 1
retain: false
automations:
alias: Reset RF Button State
hide_entity: true
initial_state: 'on'
trigger:
platform: state
entity_id: binary_sensor.Door_Bell
to: 'on'
for:
seconds: 3
action:
- service: mqtt.publish
data:
topic: home/OpenMQTTGateway/SRFBtoMQTT
payload: '4971186off'
- alias: 'Door Bell'
hide_entity: true
trigger:
- platform: state
entity_id: binary_sensor.Door_Bell
from: 'off'
to: 'on'
action:
- service: tts.google_say
data:
entity_id: media_player.whole_house
message: "There is someone at the front door, please answer the door."
In Home Assistant I have added the chromecast addon and it has indeed found my entire house of google speakers and casts. I have a “Whole House” group which has all linked speakers to it.
I have used the UI to test and send a TTS message and it works to the whole group perfectly.
NOW, here is my troubles. I haven’t a clue where to add the above entries, I “thought” i could add them to the %appdata% windows folder “.homeassistant” (C:\Users\Server\AppData\Roaming.homeassistant)
and just add the binary sensor to the configuration.yaml
and the automations to the automation.yaml
On doing so and saving the files, nothing happens. I press the button, no notification happens. No additional item is added to the “home” page of the Home Assistant UI.
I thought I may need to restart and used the configuration->server control->restart
but that ends in tears, because it doesn’t like what i added to the .yaml files…
Im out of ideas for the time being, please please help. I have honestly tried so hard to figure this out and thought i had done quite well considering the limited knowledge lol
Again if the code can be better or theres a better way through the UI then please give detailed input so as for me to follow your instructions perfectly.
Thank you kindly