How to correctly configure various MQTT values?

Hi there!
I’m currently trying to integrate several MQTT readings into my Home Assistant GUI. I read a lot on that topic online, but now I’m rather confused. Here are some questions for you:

  1. Usually people put their “sensors” under “mqtt” (or even outsource them to an extra mqtt.yaml file). Binary sensors on the other hand seem to be defined on top level, and CAN NOT be put under mqtt. This seems really weird to me.

  2. Some of my MQTT values are boolean (0/1). In the GUI they are shown as Integers (“0” or “1”), because I have defined them as regular “sensor” in the yaml. How can I make them show up differently in the GUI? (e.g. switch, checkbox, greyed out icon etc.). Can I do this with “sensor”? Or is this what “binary_sensor” is for?

Thanks!

it is

mqtt:
  sensor:
    #your mqtt sensors
  binary_sensor:
    #your mqtt binary sensors

That is what the device_class is for.

This is not true. See the example here:

Pick the correct integration here: