merlem
June 24, 2019, 12:44am
1
I’ve been trying to figure what I have messed up in my binary_sensors file…
If I un-comment “binary_sensors: !include binary_sensors.yaml” in my config.yaml file I get the “integration not found” error. Running HA 0.94.3. Thanks in advance for considering to help!
‘’’
#binary_sensor:
platform: mqtt
state_topic: “tele/RF_Bridge/RESULT”
name: ‘Front Door’
value_template: ‘{{value_json.RfReceived.Data}}’
payload_on: ‘30580E’
payload_off: ‘30580A’
device_class: door
optimistic: false
qos: 1
retain: false
platform: mqtt
state_topic: “tele/RF_Bridge/RESULT”
name: ‘Front Room Motion’
value_template: ‘{{value_json.RfReceived.Data}}’
payload_on: ‘EF5A5Eoff’
payload_off: ‘EF5A5E’
device_class: motion
#optimistic: false
#qos: 1
#retain: false
‘’’
merlem
June 24, 2019, 12:48am
2
Sorry for the original posting format issue…
#binary_sensor:
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Front Door'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: '30580E'
payload_off: '30580A'
device_class: door
optimistic: false
qos: 1
retain: false
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Front Room Motion'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: 'EF5A5Eoff'
payload_off: 'EF5A5E'
device_class: motion
#optimistic: false
#qos: 1
#retain: false
merlem
June 24, 2019, 12:51am
3
I have since removed the optimistic and retain from both statements
#binary_sensor:
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Front Door'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: '30580E'
payload_off: '30580A'
device_class: door
qos: 1
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Front Room Motion'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: 'EF5A5Eoff'
payload_off: 'EF5A5E'
device_class: motion
#optimistic: false
#qos: 1
#retain: false
So what does your log file tell you is wrong?
merlem
June 24, 2019, 1:01am
5
The HA log is blank. I cleared it accidentally… Is it okay to try to restart HA with this error?
aidbish
(Adrian)
June 24, 2019, 1:06am
6
This is wrong it should be binary_sensor: !include binary_sensors.yaml
2 Likes
tom_l
June 24, 2019, 1:07am
7
Use this in your configuration.yaml file:
binary_sensor: !include binary_sensors.yaml
Note it says binary_sensor:
not binary_sensors
:
The contents of your binary_sensors.yaml file should be this (no need to declare “binary_sensor:” again, that is in your configuration file already):
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Front Door'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: '30580E'
payload_off: '30580A'
device_class: door
optimistic: false
qos: 1
retain: false
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Front Room Motion'
etc...
Note that there is no indentation before the '- platform: ’ (you have it indented 2 spaces).
1 Like
merlem
June 24, 2019, 1:08am
8
Does this look correct?
#binary_sensor:
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Front Door'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: '30580E'
payload_off: '30580A'
device_class: door
qos: 1
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Front Room Motion'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: 'EF5A5Eoff'
payload_off: 'EF5A5E'
device_class: motion
#optimistic: false
#qos: 1
#retain: false
tom_l
June 24, 2019, 1:10am
9
No. You need to remove the extra 2 spaces of indentation for the lines under the platform as well.
merlem
June 24, 2019, 1:12am
10
Thank you tom_I, I’m blind LOL
Is “secrets” supposed to be “secret” also?
tom_l
June 24, 2019, 1:14am
11
The file should be called secrets.yaml
, you use it like this
thing: !secret your_secret_name_for_thing
merlem:
The HA log is blank.
You deleted the file?
I’m not talking about the log on the GUI. The log FILE.
merlem
June 24, 2019, 1:24am
13
Thank you so much for the links!
2019-06-23 20:16:33 ERROR (SyncWorker_0) [homeassistant.util.yaml.loader] YAML file /config/configuration.yaml contains duplicate key “binary_sensor”. Check lines 65 and 83.
It looks like I need to remove the sensor on line 65?
merlem
June 24, 2019, 1:24am
14
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 39.0679
longitude: -94.713
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 0
# metric for Metric, imperial for Imperial
unit_system: imperial
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Chicago
# Customization file
customize: !include customize.yaml
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
#logger:
#default: warning
#logs:
#homeassistant.components.mqtt: debug
# Show the introduction message on startup.
#introduction:
frontend:
themes: !include themes.yaml
panel_iframe:
configurator:
title: Configurator
icon: mdi:wrench
url: https://192.168.1.252:3218
ide:
title: IDE
icon: mdi:code-braces
url: https://merle.duckdns.org:8321
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
base_url: https://merle.duckdns.org:8123
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
# Discover some devices automatically
#discovery:
mqtt:
broker: core-mosquitto
username: !secret mqtt_username
password: !secret mqtt_password
discovery: true
discovery_prefix: homeassistant
python_script:
sensor:
# Weather prediction
- platform: yr
binary_sensor:
- platform: mqtt
name: 'Front Door'
state_topic: 'home/sensor1'
device_class: Door
#Text to speech
tts:
- platform: google_translate
service_name: google_say
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
#secret: !include secrets.yaml
cloud: !include cloud.yaml
binary_sensor: !include binary_sensors.yaml
If you use an include file you need to move ALL your binary sensors to that include file…
merlem
June 24, 2019, 1:27am
16
Thank you all so much for your patience and help. I will work with your advice and see what happens. Having a blast so far!
finity
June 24, 2019, 6:43pm
17
Just to make what @DavidFW1960 said above more explicit…
you can never have more than one of the same top level keys defined in your configuration.yaml file.
for example, using an example that you’ve already sort of seen, this won’t work:
binary_sensor:
- sensor1
- sensor2
binary_sensor:
- sensor3
- sensor4
So when you have:
binary_sensor:
- platform: mqtt
name: 'Front Door'
state_topic: 'home/sensor1'
device_class: Door
binary_sensor: !include binary_sensors.yaml
you should be able to see that it is basically equivalent to the example I used above since you are declaring “binary_sensor:” twice.
that is also the case for all top level keys (“switch:”, “sensor:”, “automation:”, “script:” etc).
so if you decided to add an !include file for your sensors then you would have to remove the
sensor:
- platform: yr
from your configuration.yaml and then put just “- platform: yr” in a sensors.yaml file.
And something else that people mess up is they then put (for example) “binary_sensor:” at the top of their binary_sensor.yaml file. Don’t do that either because to the software it’s just like declaring “binary_sensor:” twice - once in the configuration.yaml file and once in the binary_sensors.yaml file. And you will get the same error as in your post above.
I see you didn’t do that so that’s good but I just wanted to spell it out in case it wasn’t clear.
merlem
June 26, 2019, 3:59am
18
Thank you for your explanation.
i have to say the HA community is an awesome group of people! You all share your valuable time, expertise and knowledge to any who needs help. This fact demonstrates the great character of the community as a whole. I only hope that as I learn and absorb everyone’s advice and knowledge, I will be able to contribute by helping someone one day. Thanks!!
By the way I did get my triggers working, this is solved. Now to figure out why only one of my two automatons is not working… LOL