MQTT devices of type "number"

For devices supporting the Auto Discovery feature. Like ZWaveJS2MQTT, Zigbee2MQTT.

Moderator: leecollings

Post Reply
Maciek90
Posts: 67
Joined: Friday 05 March 2021 23:01
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

MQTT devices of type "number"

Post by Maciek90 »

In Domoticz, devices reported via MQTT as type "number" do not appear as new devices. To locate them, you must navigate to the menu: "MQTT auto discovery client gateway with LAN interface" > "Configuration."
Is there any way to make a device reported as type "number" appear in the main devices menu?
I have a Shelly BLU TRV, which reports its valve opening percentage to MQTT (via Zigbee2MQTT) as a "number" type. I would really like to be able to see it as a device and control it directly from within Domoticz.
User avatar
gizmocuz
Posts: 3072
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MQTT devices of type "number"

Post by gizmocuz »

The issue is your Shelly BLU TRV, it should not report this as a number value but as a normal sensor, please report there
Quality outlives Quantity!
Maciek90
Posts: 67
Joined: Friday 05 March 2021 23:01
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: MQTT devices of type "number"

Post by Maciek90 »

Sorry for the silly question. Am I correct in understanding that this should be reported to Shelly, or is it an issue for Zigbee2MQTT?
Alternatively, is there any way in Domoticz to "copy" the behavior of a `number` type device—found under "MQTT auto discovery client gateway with LAN interface > Configuration"—to a normal sensor?
User avatar
imautohuttraeger
Posts: 445
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Germany
Contact:

Re: MQTT devices of type "number"

Post by imautohuttraeger »

You can copy the number via dzvents script into a virtual sensor device. Simply ask AI for assistance.
Last edited by imautohuttraeger on Tuesday 10 November 2026 15:10, edited 1 time in total.
Stop, look and listen.
Maciek90
Posts: 67
Joined: Friday 05 March 2021 23:01
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: MQTT devices of type "number"

Post by Maciek90 »

I’ve been trying to get this done for the past few days with the help of AI (Gemini and ChatGPT), but neither has been able to write a working dzVents script.
User avatar
gizmocuz
Posts: 3072
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MQTT devices of type "number"

Post by gizmocuz »

Good point, and thanks for the clear example.

The reason "number" entities were not turned into devices is that I assumed they were all configuration or diagnostic values (calibration offsets, reporting intervals, limits), the kind of tuning knob that belongs on the gateway Configuration page rather than in the device list. That assumption was wrong: in Home Assistant a "number" only counts as such when it carries entity_category "config" or "diagnostic". A "number" with no entity_category is a primary, controllable value, exactly like your Shelly BLU TRV valve position.

So I have changed it. In the next beta:

- A "number" without an entity_category (and with a command_topic, which these always have) is created as a settable Setpoint device. The slider's min, max, step and unit come from the discovery config.
- You can change it from within Domoticz and it is published back to the device. If the entity uses a command_template (Zigbee2MQTT usually wraps the value in a JSON set payload), that template is honored, so the device actually receives the value.
- "number" entities marked as configuration or diagnostic stay on the Configuration page as before.

After you update, your valve percentage should show up as a normal device that you can read and set directly. Note that an existing "number" will only appear automatically if you have "accept new hardware" (and, to have it enabled, "enable new devices by default") set; otherwise it is added but not used, and you can enable it from Setup > Devices.
Quality outlives Quantity!
Post Reply