Hello,
I have a MQTT message from an external program returning a numeric value.
This value can be one of { 2, 10, 20, 30, 40, 50, 60, 70, 80 }.
I defined a MQTT select to represent this value (and change it)
mqtt:
- select:
- name: "Voltronic Set AC Charge Current"
unique_id: voltronic_set_ac_charge_current
state_topic: "voltronic-7200/status/max_ac_charging_current/value"
command_topic: "nuc/voltronic-7200-out/cmd"
optimistic: true
retain: true
options:
- 2
- 10
- 20
- 30
- 40
- 50
- 60
- 70
- 80
command_template: >-
{{ 'MUCHGC0%02d' | format(value|int) }}
value_template: >
{% if value|is_number %}
{{ value | int }}
{% else %}
unavailable
{% endif %}
device:
name: "voltronic-7200"
identifiers: "voltronic-7200"
model: "voltronic-7200"
This generate and error in HA logs:
Invalid option for select.voltronic_set_ac_charge_current: '2' (valid options: [2, 10, 20, 30, 40, 50, 60, 70, 80])
Instead, if I define select as:
mqtt:
- select:
- name: "Voltronic Set AC Charge Current"
unique_id: voltronic_set_ac_charge_current
state_topic: "voltronic-7200/status/max_ac_charging_current/value"
command_topic: "nuc/voltronic-7200-out/cmd"
optimistic: true
retain: true
options:
- "2"
- "10"
- "20"
- "30"
- "40"
- "50"
- "60"
- "70"
- "80"
command_template: >-
{{ 'MUCHGC0%02d' | format(value|int) }}
value_template: >
{% if value|is_number %}
{{ value | int }}
{% else %}
unavailable
{% endif %}
device:
name: "voltronic-7200"
identifiers: "voltronic-7200"
model: "voltronic-7200"
it works.
But history is very ugly:
If I define an helper input_select with same options, rendering is better, I can see a graph:
Is there a way to force MQTT select to render as the helper input_select?
Thanks


