Home Assistant Community

Help NEEDED, Can't find the Syntax error (Not completely Solved)

#1

So, I’m getting the following error;

2019-02-09 21:20:37 WARNING (MainThread) [homeassistant.components.mqtt.sensor] configuration variable "json_attributes" is deprecated, replace with "json_attributes_topic"
2019-02-09 21:20:37 WARNING (MainThread) [homeassistant.components.mqtt.sensor] configuration variable "json_attributes" is deprecated, replace with "json_attributes_topic"

So, I went thru the configuration of ALL my sensors, and did not find the “json_attributes” syntax being used. I also commented out, each sensor, one at a time, and restarted Hassio, then checked the log. But, the error never went away…

What am I missing???

I am including my “sensors.yaml” file, maybe someone will see something that I am missing.

#=============================================================
#======================== Weather Sensor =====================
#=============================================================
  - platform: darksky
    api_key: !secret darksky_api_key
    monitored_conditions:
      - nearest_storm_distance
      - temperature
      - dew_point
      - wind_speed
      - wind_bearing
      - humidity
      - pressure
      - visibility
      - precip_type
      - cloud_cover
      - hourly_summary
#      - moon_phase

  - platform: moon

  # - platform: mqtt
    # name: "Node RED"
    # state_topic: "checkin/nodered"
    # expire_after: 300
#=============================================================
#============Multi Sensors - by BRUH Automations==============
#=============================================================
  - platform: mqtt
    state_topic: "climate/li-room"
    name: "Livingroom Humidity"
    unit_of_measurement: "%"  
    value_template: '{{ value_json.humidity | round(1) }}'
  - platform: mqtt
    state_topic: "climate/li-room"
    name: "Livingroom LDR"
    unit_of_measurement: "LUX"
    value_template: '{{ value_json.ldr }}'
  - platform: mqtt
    state_topic: "climate/li-room"
    name: "Livingroom PIR"
    value_template: '{{ value_json.motion }}'
  - platform: mqtt
    state_topic: "climate/li-room"
    name: "Livingroom Temperature"
    unit_of_measurement: "F"
    value_template: '{{ value_json.temperature | round(1) }}'
  - platform: mqtt
    state_topic: "climate/li-room"
    name: "Livingroom Real Feel"
    unit_of_measurement: "F"
    value_template: '{{ value_json.heatIndex | round(1) }}'
  - platform: mqtt
    state_topic: "climate/li-room"
    name: "Livingroom WiFi RSSI"
    unit_of_measurement: "db"  
    value_template: '{{ value_json.signal_strength }}'
  - platform: mqtt
    state_topic: "climate/cellar"
    name: "Cellar Humidity"
    unit_of_measurement: "%"
    value_template: '{{ value_json.humidity | round(1) }}'
  - platform: mqtt
    state_topic: "climate/cellar"
    name: "Cellar LDR"
    ##This sensor is not calibrated to actual LUX. Rather, this a map of the input voltage ranging from 0 - 1023.
    unit_of_measurement: "LUX"
    value_template: '{{ value_json.ldr }}'
  - platform: mqtt
    state_topic: "climate/cellar"
    name: "Cellar PIR"
    value_template: '{{ value_json.motion }}'
  - platform: mqtt
    state_topic: "climate/cellar"
    name: "Cellar Temperature"
    unit_of_measurement: "F"
    value_template: '{{ value_json.temperature | round(1) }}'
  - platform: mqtt
    state_topic: "climate/cellar"
    name: "Cellar Real Feel"
    unit_of_measurement: "F"
    value_template: '{{ value_json.heatIndex | round(1) }}'
  - platform: mqtt
    state_topic: "climate/cellar"
    name: "Cellar WiFi RSSI"
    unit_of_measurement: "db"  
    value_template: '{{ value_json.signal_strength }}'
#=============================================================
  - platform: mqtt
    state_topic: "climate/mb-room"
    name: "Bedroom Humidity"
    unit_of_measurement: "%"
    value_template: '{{ value_json.humidity | round(1) }}'
  - platform: mqtt
    state_topic: "climate/mb-room"
    name: "Bedroom LDR"
    ##This sensor is not calibrated to actual LUX. Rather, this a map of the input voltage ranging from 0 - 1023.
    unit_of_measurement: "LUX"
    value_template: '{{ value_json.ldr }}'
  - platform: mqtt
    state_topic: "climate/mb-room"
    name: "Bedroom PIR"
    value_template: '{{ value_json.motion }}'
  - platform: mqtt
    state_topic: "climate/mb-room"
    name: "Bedroom Temperature"
    unit_of_measurement: "F"
    value_template: '{{ value_json.temperature | round(1) }}'
  - platform: mqtt
    state_topic: "climate/mb-room"
    name: "Bedroom Real Feel"
    unit_of_measurement: "F"
    value_template: '{{ value_json.heatIndex | round(1) }}'
  - platform: mqtt
    state_topic: "climate/mb-room"
    name: "Bedroom WiFi RSSI"
    unit_of_measurement: "db"  
    value_template: '{{ value_json.signal_strength }}'
#=============================================================
  - platform: mqtt
    state_topic: "climate/ki-room"
    name: "Kitchen Humidity"
    unit_of_measurement: "%"
    value_template: '{{ value_json.humidity | round(1) }}'
  - platform: mqtt
    state_topic: "climate/ki-room"
    name: "Kitchen LDR"
    ##This sensor is not calibrated to actual LUX. Rather, mapped the input voltage to ranging from 0 - 1023.
    unit_of_measurement: "LUX"
    value_template: '{{ value_json.ldr }}'
  - platform: mqtt
    state_topic: "climate/ki-room"
    name: "Kitchen PIR"
    value_template: '{{ value_json.motion }}'
  - platform: mqtt
    state_topic: "climate/ki-room"
    name: "Kitchen Temperature"
    unit_of_measurement: "F"
    value_template: '{{ value_json.temperature | round(1) }}'
  - platform: mqtt
    state_topic: "climate/ki-room"
    name: "Kitchen Real Feel"
    unit_of_measurement: "F"
    value_template: '{{ value_json.heatIndex | round(1) }}'
  - platform: mqtt
    state_topic: "climate/ki-room"
    name: "Kitchen WiFi RSSI"
    unit_of_measurement: "db"  
    value_template: '{{ value_json.signal_strength }}'
#=============================================================
#====================== System Sensors =======================
#=============================================================
  - platform: uptime
    name: Time Online
    unit_of_measurement: hours
#=============================================================
#  - platform: speedtest
#    minute:
#      - 0
#      - 15
#      - 30
#      - 45
#    monitored_conditions:
#      - download
#      - upload
#      - ping
  - platform: systemmonitor
    resources:
      - type: disk_free
        arg: /home
      - type: swap_free
      - type: processor_use
      - type: last_boot
#      - type: disk_use_percent
#        arg: /home
#      - type: disk_use
#        arg: /home
#      - type: memory_use_percent
#      - type: memory_use
#      - type: memory_free
#      - type: swap_use_percent
#      - type: swap_use
#      - type: network_in
#        arg: eth0
#      - type: network_out
#        arg: eth0
#      - type: packets_in
#        arg: eth0
#      - type: packets_out
#        arg: eth0
#      - type: ipv4_address
#        arg: eth0
#      - type: ipv6_address
#        arg: eth0
#      - type: last_boot
#      - type: process
#        arg: octave-cli
#      - type: load_15m
#  - platform: cpuspeed
#    name: "CPU Speed = "
# SSL Certificate, days til expiration
#=============================================================
  - platform: cert_expiry
    host: !secret ha_cert_exp
    port: 443
    scan_interval: 3600
#=============================================================
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
#=============================================================
#================= POW Sensors - by DigiBlur =================
#=============================================================
  - platform: mqtt
    name: "Washer State"
    state_topic: "stat/snf-washer/POWER"
    icon: mdi:washing-machine
  - platform: mqtt
    name: "Washer Watts"
    state_topic: "tele/snf-washer/SENSOR"
    value_template: "{{value_json['ENERGY'].Power }}"
    qos: 2
    unit_of_measurement : "W"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-washer/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "Washer Voltage"
    state_topic: "tele/snf-washer/SENSOR"
    value_template: "{{value_json['ENERGY'].Voltage }}"
    qos: 2
    unit_of_measurement : "V"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-washer/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "Washer Amps"
    state_topic: "tele/snf-washer/SENSOR"
    value_template: "{{value_json['ENERGY'].Current }}"
    qos: 2
    unit_of_measurement : "A"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-washer/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "Washer Energy Today"
    state_topic: "tele/snf-washer/SENSOR"
    value_template: "{{value_json['ENERGY'].Today }}"
    qos: 2
    unit_of_measurement : "kWh"
    availability_topic: "tele/snf-washer/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "Washer Energy Yesterday"
    state_topic: "tele/snf-washer/SENSOR"
    value_template: "{{value_json['ENERGY'].Yesterday }}"
    qos: 2
    unit_of_measurement : "kWh"
    availability_topic: "tele/snf-washer/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    state_topic: "tele/snf-washer/STATE"
    name: "Washer Signal"
    unit_of_measurement: "%"
    value_template: "{{value_json['Wifi'].RSSI }}"
    availability_topic: "tele/snf-washer/LWT"
    qos: 1
    payload_available: "Online"
    payload_not_available: "Offline"
#=============================================================
  - platform: mqtt
    name: "Refrigerator State"
    state_topic: "stat/snf-refrig/POWER"
    icon: mdi:fridge-outline
  - platform: mqtt
    name: "Refrigerator Watts"
    state_topic: "tele/snf-refrig/SENSOR"
    value_template: "{{value_json['ENERGY'].Power }}"
    qos: 2
    unit_of_measurement : "W"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-refrig/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "Refrigerator Voltage"
    state_topic: "tele/snf-refrig/SENSOR"
    value_template: "{{value_json['ENERGY'].Voltage }}"
    qos: 2
    unit_of_measurement : "V"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-refrig/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "Refrigerator Amps"
    state_topic: "tele/snf-refrig/SENSOR"
    value_template: "{{value_json['ENERGY'].Current }}"
    qos: 2
    unit_of_measurement : "A"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-refrig/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "Refrigerator Energy Today"
    state_topic: "tele/snf-refrig/SENSOR"
    value_template: "{{value_json['ENERGY'].Today }}"
    qos: 2
    unit_of_measurement : "kWh"
    availability_topic: "tele/snf-refrig/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "Refrigerator Energy Yesterday"
    state_topic: "tele/snf-refrig/SENSOR"
    value_template: "{{value_json['ENERGY'].Yesterday }}"
    qos: 2
    unit_of_measurement : "kWh"
    availability_topic: "tele/snf-refrig/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    state_topic: "tele/snf-refrig/STATE"
    name: "Refrigerator Signal"
    unit_of_measurement: "%"
    value_template: "{{value_json['Wifi'].RSSI }}"
    availability_topic: "tele/snf-refrig/LWT"
    qos: 1
    payload_available: "Online"
    payload_not_available: "Offline"
#=============================================================
  - platform: mqtt
    name: "SNF Spare 1 State"
    state_topic: "stat/snf-spare1/POWER"
    icon: mdi:fridge-outline
  - platform: mqtt
    name: "SNF Spare 1 Watts"
    state_topic: "tele/snf-spare1/SENSOR"
    value_template: "{{value_json['ENERGY'].Power }}"
    qos: 2
    unit_of_measurement : "W"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-spare1/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "SNF Spare 1 Voltage"
    state_topic: "tele/snf-spare1/SENSOR"
    value_template: "{{value_json['ENERGY'].Voltage }}"
    qos: 2
    unit_of_measurement : "V"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-spare1/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "SNF Spare 1 Amps"
    state_topic: "tele/snf-spare1/SENSOR"
    value_template: "{{value_json['ENERGY'].Current }}"
    qos: 2
    unit_of_measurement : "A"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-spare1/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "SNF Spare 1 Energy Today"
    state_topic: "tele/snf-spare1/SENSOR"
    value_template: "{{value_json['ENERGY'].Today }}"
    qos: 2
    unit_of_measurement : "kWh"
    availability_topic: "tele/snf-spare1/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "SNF Spare 1 Energy Yesterday"
    state_topic: "tele/snf-spare1/SENSOR"
    value_template: "{{value_json['ENERGY'].Yesterday }}"
    qos: 2
    unit_of_measurement : "kWh"
    availability_topic: "tele/snf-spare1/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    state_topic: "tele/snf-spare1/STATE"
    name: "SNF Spare 1 Signal"
    unit_of_measurement: "%"
    value_template: "{{value_json['Wifi'].RSSI }}"
    availability_topic: "tele/snf-spare1/LWT"
    qos: 1
    payload_available: "Online"
    payload_not_available: "Offline"
#=============================================================
  - platform: mqtt
    name: "SNF Spare 2 State"
    state_topic: "stat/snf-spare2/POWER"
    icon: mdi:fridge-outline
  - platform: mqtt
    name: "SNF Spare 2 Watts"
    state_topic: "tele/snf-spare2/SENSOR"
    value_template: "{{value_json['ENERGY'].Power }}"
    qos: 2
    unit_of_measurement : "W"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-spare2/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "SNF Spare 2 Voltage"
    state_topic: "tele/snf-spare2/SENSOR"
    value_template: "{{value_json['ENERGY'].Voltage }}"
    qos: 2
    unit_of_measurement : "V"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-spare2/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "SNF Spare 2 Amps"
    state_topic: "tele/snf-spare2/SENSOR"
    value_template: "{{value_json['ENERGY'].Current }}"
    qos: 2
    unit_of_measurement : "A"
    icon: mdi:flash-circle
    availability_topic: "tele/snf-spare2/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "SNF Spare 2 Energy Today"
    state_topic: "tele/snf-spare2/SENSOR"
    value_template: "{{value_json['ENERGY'].Today }}"
    qos: 2
    unit_of_measurement : "kWh"
    availability_topic: "tele/snf-spare2/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    name: "SNF Spare 2 Energy Yesterday"
    state_topic: "tele/snf-spare2/SENSOR"
    value_template: "{{value_json['ENERGY'].Yesterday }}"
    qos: 2
    unit_of_measurement : "kWh"
    availability_topic: "tele/snf-spare2/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
  - platform: mqtt
    state_topic: "tele/snf-spare2/STATE"
    name: "SNF Spare 2 Signal"
    unit_of_measurement: "%"
    value_template: "{{value_json['Wifi'].RSSI }}"
    availability_topic: "tele/snf-spare2/LWT"
    qos: 1
    payload_available: "Online"
    payload_not_available: "Offline"
#=============================================================
  - platform: mqtt
    name: "Current LED"
    state_topic: "stat/led_pole_1/locator"
#=============================================================
#====================== Stocks to Watch=======================
#=======================XYSTJS1QZXGHIMV1.=====================
  - platform: alpha_vantage
    api_key: !secret alpha_vantage_key
    symbols:
      - symbol: HPQ
        name: Hewlett-Packard Inc.
      - symbol: HPE
        name: Hewlett-Packard Enterprise Co.
      - symbol: MRMD
        name: MariMed Inc.
      # - symbol: ARNA
        # name: Arena Pharmaceuticals Inc.
      # - symbol: CARA
        # name: Cara Therapeutics Inc.
      # - symbol: CRBP
        # name: Corbus Pharmaceuticals Holdings Inc.
      # - symbol: CRON
        # name: Cronos Group Inc.
      # - symbol: GWPH
        # name: GW Pharmaceuticals Plc.
      # - symbol: INSY
        # name: Insys Therapeutics Inc.
      # - symbol: NTEC
        # name: Intec Pharma Ltd.
      # - symbol: MBII
        # name: Marrone Bio Innovations, Inc.
      # - symbol: PMD
        # name: Psychemedics Corporation
      # - symbol: TRPX
        # name: Therapix Biosciences Ltd.
      # - symbol: TLRY
        # name: Tilray Inc.
      # - symbol: ZYNE
        # name: Zynerba Pharmaceuticals Inc.
#=============================================================
0 Likes

#2

Do you have any custom components that might be using it?

0 Likes

#3

Not sure, can you give an example of a Custom component?

0 Likes

#4

Do you have anything in /config/custom_components?

0 Likes

#5

I have a Binary sensor in my Configuration.yaml, that looks likee the following;

binary_sensor:
  platform: mqtt
  name: "CarPresence"
  state_topic: "homeassistant/binary_sensor/CarPresence/state"
0 Likes

#6

Nope that’s a built in component (binary_sensor).

0 Likes

#7

NO, to the /config/custom_components…

0 Likes

#8

I noticed the same thing. I think I’ve isolated it to the “battery alert” package I’ve been running flawlessly for close to a year now but the recent HA version upgrades are starting to annoy it.
Have you installed that package?

1 Like

#9

I am running HA Switch Plate, and that uses a package. I will check that out…

0 Likes

#10

Found the Sensor that is causing the problem, it’s in the HA Switch Plate Package, specifically, in the “hasp_plate01_00_components.yaml” file

0 Likes

#11

What was the error. Others might learn from it.

0 Likes

#12

@stevemann
^^^^^^^^^^^^^^ Read the opening topic. ^^^^^^^^^^^^^^

0 Likes

#13

Again: What was the error. Others might learn from it.

The opening topic had your sensors.yaml file and nowhere in it was “hasp_plate01_00_components” mentioned. So, YOU found the offending sensor. Fine. How did you figure out that it was in a yaml file that you hadn’t mentioned in the OP and isn’t included in the sensors file?

0 Likes

#14

Sorry Not an error, it was a WARNING.

Found the Sensor that is causing the problem, it’s in the HA Switch Plate Package, specifically, in the “hasp_plate01_00_components.yaml” file, line# 47-59. I included the code below.

sensor:
  - platform: mqtt
    name: plate02 Sensor
    state_topic: "hasp/plate02/sensor"
    value_template: '{{ value_json.status }}'
    json_attributes:
      - espVersion
      - updateESPAvailable
      - lcdVersion
      - updateLcdAvailable
      - espUptime
      - signalStrength
      - haspIP

And I still have not found any info, that clearly explains how to fix it. I know it is this sensor, that causing the warning, because, when I comment out the “packages: !include_dir_named packages” line in my configuration.yaml file. The warning goes away.

And, I don’t think this sensor can be discovered.

0 Likes

#15

json_attributes is deprecated now, and should be replaced by implementing json_attributes_topic inplace of it. This is mentioned in the component documentation.

Since in your case, this warning is being generated by the HA switchplate custom package, you can either attempt to modify it yourself, or raise a bug with the HA switchplate development team, wait for a fix to be released, then upgrade.

If you want to file a bug, this is the link to their repo I believe, which has an issues section where you can let them know that some of the code being used includes deprecated functions.

0 Likes

#16

@Silicon_Avatar Aderusha added an update 3 days ago, but apparently, not for this issue. ;-(
And as for the component documentation, it does not dumb it down, enough for me. Everything I tried form that document, has not worked for me…

0 Likes

#17

list an example of the things you’ve tried…

0 Likes

#19

change it to this, obviously changing topic to match your plate name(plate02)

sensor:
  - platform: mqtt
    name: test_plate Sensor
    state_topic: "hasp/test_plate/sensor"
    value_template: '{{ value_json.status }}'
    json_attributes_topic: "hasp/test_plate/sensor"
0 Likes

HA SwitchPlate - DIY LCD Touchscreen wall switch replacement