Brottsplatskartan - area error

Anyone able to use the variable area:

I get this error when i “check configuration”:

Invalid config for [sensor.brottsplatskartan]: value is not allowed @ data['area'][0]. Got 'D'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.brottsplatskartan/

The name: variable works fine.

My yaml configuration:

sensor:
  - platform: brottsplatskartan
    name: "Brott i Dalarna"
    area: "Dalarnas Län"

If i restart anyway i get this error in the log:

2019-01-10 11:53:19 ERROR (MainThread) [homeassistant.components.hassio] INFO:homeassistant.util.package:Attempting install of colorlog==4.0.2
Testing configuration at /config
Failed config
  sensor.brottsplatskartan: 
    - Invalid config for [sensor.brottsplatskartan]: value is not allowed @ data['area'][0]. Got 'D'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.brottsplatskartan/
    - platform: brottsplatskartan
      area: Dalarnas Län
      name: Brott i Dalarna

Successful config (partial)
  sensor.brottsplatskartan:

Ping @chrillux

I also tried it without luck. I want blekinge län instead of my default longitude/latitude values. I miss the regular example code in the component section. could it be that the sensor cannot have åäö in its string-values?

I just added the sensor and got the same error. Turns out the area has to be one of the ones defined on https://brottsplatskartan.se/api/areas. In your case perhaps the upper case L in “Län” is the issue?

Also see https://github.com/chrillux/brottsplatskartan

Ping @Mattie

Oh, nice. I’ll check it out!

1 Like

Old thread, but should you only see the number of crimes? I currently only see “6” for Örebro County, no text. Uses Entity Card Configuration.