My MQTT wasn't working at all (nothing published to msh/US/2/# except msh/US/2/stat/!myradio = offline for a week) until on advice from Discord I added a new Meshtastic channel to my radio configuration called "mqtt". They claim that this paragraph makes that requirement clear, but
1. This paragraph is only about JSON downlink to send MQTT over LoRa, which is odd because MQTT uplink didn't work either, but anyway:
2. The word "channel" by itself isn't a full set of instructions for creating a new Meshtastic channel on the appropriate node. The rest of the paragraph talks about the /mqtt/ topic, which is ambiguous.
Just a couple small improvements. By adding these device classes, some history graphs will be made a bit nicer (splitting out battery percentage from channel utilization graphs) and HA can better know how to use the values. Using `this.state` is slightly better form for retaining the same sensor value since it won't look up the current value, just reuse the one HA has already looked up.