PIR validation issue

I added a PIR sensor to my installation and it seems that something is throwing off the validation now.

- platform: rpi_gpio
  ports:
    04: PIR Livingroom RAW

Now running hass --script check_config --info binary_sensor gives the following error message (same happens during startup):

- platform: rpi_gpio
  bouncetime: 50
  invert_logic: False
  ports: 

Traceback (most recent call last):
File “/usr/local/bin/hass”, line 11, in
sys.exit(main())
File “/usr/local/lib/python3.4/dist-packages/homeassistant/main.py”, line 368, in main
return scripts.run(args.script)
File “/usr/local/lib/python3.4/dist-packages/homeassistant/scripts/init.py”, line 47, in run
return script.run(args[1:]) # type: ignore
File “/usr/local/lib/python3.4/dist-packages/homeassistant/scripts/check_config.py”, line 128, in run
dump_dict(res[‘components’].get(domain, None))
File “/usr/local/lib/python3.4/dist-packages/homeassistant/scripts/check_config.py”, line 284, in dump_dict
dump_dict(i, indent_count + 2, True)
File “/usr/local/lib/python3.4/dist-packages/homeassistant/scripts/check_config.py”, line 277, in dump_dict
dump_dict(value, indent_count + 2)
File “/usr/local/lib/python3.4/dist-packages/homeassistant/scripts/check_config.py”, line 274, in dump_dict
for key, value in sorted(layer.items(), key=sort_dict_key):
File “/usr/local/lib/python3.4/dist-packages/homeassistant/scripts/check_config.py”, line 265, in sort_dict_key
skey = str.lower(val[0])
TypeError: descriptor ‘lower’ requires a ‘str’ object but received a ‘int’

Do you have any ideas where this could come from ? I did change the sensor description to include no spaces, but this did not help.

Thanks for your input.

I think the problem is you are using numbers as a key in your yaml file.

So you propose to try …

“04” : PIR Livingroom RAW

Unfortunately, that did not change anything to the config check.

Can you try changing it to “four”?

Nope, error message is now that it is an invalid option for this sensor (also 4 is mentioned in the doc for GPIO sensors).

Another thing you can try is to print out what value it’s trying to convert to lower case.

Add print(val) before line 265.