I have a home built sensor that publishes via mqtt an “On” or “Off” status. Using “Mqtt Explorer” I can see the topic and value appearing on the HA device. I can also configure the device using configure.yaml so that it appears in the devices/entities list, But I cant get it to display as a 0/1 in a line graph using mini-graph-card.
MQTT Explorer:
Devices/Entities:
Mini-Graph-Card:
Finally got it to work after stumbling around for many more hours than it should have taken.
The main fix, was to define the fans as “switch” in the mqtt.yaml rather than sensor or binary_sensor.
` - name: "allan-testfan"
command_topic: "cmnd/allan/testfan"
state_topic: "allan/testfan"
state_on: "On"
state_off: "Off"`
This required an additional “command_topic” as switch is a 2 way function.
Then in the mini-graph-card definition I set them up as per the “Non-numeric sensor states” in the mini-graph-card documentation.
https://github.com/kalkih/mini-graph-card?tab=readme-ov-file#non-numeric-sensor-states