Re: [mh] mqtt_discovery

Dave Neudoerffer <[email protected]> Sat, 14 Feb 2026 13:42:07 -0500
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <CAOFx8LNRAjgXOCL_V3z_k69w8GfmYN5kiuzAs-A=22L+2Acifw@mail.gmail.com>
--===============3271867244084203378==
Content-Type: multipart/alternative; boundary="000000000000df4215064acd1467"

--000000000000df4215064acd1467
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanx for the trace Brian.  The discovery topics and templates being used
are slightly different from anything I have seen before.  It shouldn't be
too hard to enhance the MH discovery to handle this.  The Jinja templates
are a bit of a nuisance, but I will fudge something...  It will take me a
few days to get to this...

Dave

On Fri, Feb 13, 2026 at 7:01=E2=80=AFPM Brian M <misterhouse-ng1@silverflas=
h.net>
wrote:

> Thanks, Dave. Mostly I'm in good shape, but I've got some edge cases.
>
> My primary problem at the moment seems to be that I can't set the
> brightness for my ZWave dimmer switches via ZWave-JS-UI. The correct MQTT
> string in one instance is:
>
>
> app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/targ=
etValue/set
>
> Writing "3" to that MQTT topic (via MQTT-Explorer)  causes the light to
> come on at 3%, as expected. However, in MH setting it to 3, '3', or '3%'
> results in the light being turned on 100%.
>
> I can't tell if this is a problem in with the discovery itself, or the
> implementation of of setting the MQTT_DISCOVEREDITEM.  Here are some
> details:
>
> The MQTT discovered_item entry:
>
> MQTT_DISCOVEREDITEM, Upstairs_Landing_Stairs, mqtt_discovery2,
> app/zwave-js-ui/config/light/Upstairs_Landing-Stairs/dimmer/config,
> {"command_topic":"app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilev=
el/endpoint_0/targetValue/set","state_topic":"app/zwave-js-ui/Upstairs_Land=
ing/Stairs/switch_multilevel/endpoint_0/currentValue","state_value_template=
":"{{
> \"OFF\" if value_json.value =3D=3D 0 else \"ON\"
> }}","brightness_command_topic":"app/zwave-js-ui/Upstairs_Landing/Stairs/s=
witch_multilevel/endpoint_0/targetValue/set","brightness_scale":99,"brightn=
ess_state_topic":"app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel=
/endpoint_0/currentValue","brightness_value_template":"{{
> value_json.value
> }}","on_command_type":"brightness","supported_color_modes":["brightness"]=
,"availability":[{"payload_available":"true","payload_not_available":"false=
","topic":"app/zwave-js-ui/Upstairs_Landing/Stairs/status","value_template"=
:"{{'true'
> if value_json.value else
> 'false'}}"},{"topic":"app/zwave-js-ui/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/=
status","value_template":"{{'online'
> if value_json.value else
> 'offline'}}"},{"payload_available":"true","payload_not_available":"false"=
,"topic":"app/zwave-js-ui/driver/status"}],"availability_mode":"all","devic=
e":{"identifiers":["zwavejs2mqtt_0xc92945ec_node259"],"manufacturer":"Zooz"=
,"model":"Dimmer
> (ZEN72)","name":"Upstairs_Landing-Stairs","sw_version":"4.0.1"},"name":"U=
pstairs_Landing_Stairs","unique_id":"zwavejs2mqtt_0xc92945ec_259-38-0-curre=
ntValue"}
>
> Relevant log messages (MQTT debug level 2):
>
> 2026-02-13 15:54:59 [MQTT D2]: Pending $Upstairs_Landing_Stairs-->set( 3%=
,
> ,  ) cleared
> 2026-02-13 15:54:59 [MQTT D1]: unable to process template
> {{"OFF"ifvalue_json.value=3D=3D0else"ON"}}
> 2026-02-13 15:54:59 [MQTT D2]: fishing template value out of json with
> '$value =3D $value_json->{value}'
> 2026-02-13 15:54:59 [MQTT D1]: remote item MQTT to MH
> Upstairs_Landing_Stairs set(95%, '')
> 2026-02-13 15:54:59 [MQTT D2]: remote item $Upstairs_Landing_Stairs
> received message R:0
> T:app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/cu=
rrentValue
> M:{"time":1771026899727,"value":95,"nodeName":"Stairs","nodeLocation":"Up=
stairs_Landing"}
> 2026-02-13 15:54:59 [MQTT D1]: unable to process template
> {{"OFF"ifvalue_json.value=3D=3D0else"ON"}}
> 2026-02-13 15:54:59 [MQTT D2]: fishing template value out of json with
> '$value =3D $value_json->{value}'
> 2026-02-13 15:54:59 [MQTT D1]: remote item MQTT to MH
> Upstairs_Landing_Stairs set(95%, 'mqtt')
> 2026-02-13 15:54:59 [MQTT D1]: mqttserver Rcv'd: R:0
> T:'app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/d=
uration'
> M:'{"time":1771026899728,"value":{"value":0,"unit":"seconds"},"nodeName":=
"Stairs","nodeLocation":"Upstairs_Landing"}'
> 2026-02-13 15:54:59 [MQTT D2]: UNHANDLED MESSAGE
> app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/dura=
tion
> --
> {"time":1771026899728,"value":{"value":0,"unit":"seconds"},"nodeName":"St=
airs","nodeLocation":"Upstairs_Landing"}
> 2026-02-13 15:54:59 [MQTT D1]: mqttserver Rcv'd: R:0
> T:'app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/t=
argetValue'
> M:'{"time":1771026899728,"value":95,"nodeName":"Stairs","nodeLocation":"U=
pstairs_Landing"}'
> 2026-02-13 15:54:59 [MQTT D2]: UNHANDLED MESSAGE
> app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/targ=
etValue
> --
> {"time":1771026899728,"value":95,"nodeName":"Stairs","nodeLocation":"Upst=
airs_Landing"}
> 2026-02-13 15:54:59 [MQTT D1]: mqttserver Rcv'd: R:0
> T:'app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/c=
urrentValue'
> M:'{"time":1771026899858,"value":95,"nodeName":"Stairs","nodeLocation":"U=
pstairs_Landing"}'
> 2026-02-13 15:54:59 [MQTT D2]: remote item $Upstairs_Landing_Stairs
> received message R:0
> T:app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/cu=
rrentValue
> M:{"time":1771026899858,"value":95,"nodeName":"Stairs","nodeLocation":"Up=
stairs_Landing"}
> 2026-02-13 15:54:59 [MQTT D1]: unable to process template
> {{"OFF"ifvalue_json.value=3D=3D0else"ON"}}
> 2026-02-13 15:54:59 [MQTT D2]: fishing template value out of json with
> '$value =3D $value_json->{value}'
> 2026-02-13 15:54:59 [MQTT D1]: remote item MQTT to MH
> Upstairs_Landing_Stairs set(95%, 'mqtt')
> 2026-02-13 15:54:59 [MQTT D2]: remote item $Upstairs_Landing_Stairs
> received message R:0
> T:app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/cu=
rrentValue
> M:{"time":1771026899858,"value":95,"nodeName":"Stairs","nodeLocation":"Up=
stairs_Landing"}
> 2026-02-13 15:54:59 [MQTT D1]: unable to process template
> {{"OFF"ifvalue_json.value=3D=3D0else"ON"}}
> 2026-02-13 15:54:59 [MQTT D2]: fishing template value out of json with
> '$value =3D $value_json->{value}'
> 2026-02-13 15:54:59 [MQTT D1]: remote item MQTT to MH
> Upstairs_Landing_Stairs set(95%, 'mqtt')
>
>
> Clearly it's not happy, but I haven't been able to chase down the root
> cause. BTW, the "95%" mentioned in the logs was the switch's existing
> brightness level before I tried to change it.
>
> Hopefully, this is clearer to you than to me.
>
>                           -B.
>
>
>
>
> On 2/13/26 15:08, Dave Neudoerffer wrote:
>
> You are correct Brian. HA_Item is about mirroring home assistant
> entities.  Howard uses HA to host most of his devices and MH for
> automations using HA_Items. Without a HA service, HA_Item makes no sense.
>
> In implementing mqtt_items, I had a few different sources of mqtt devices=
,
> but not a huge variety. No did not have any zwave2mqtt stuff. I have used
> the zigbee2mqtt stuff.  I am actually in the process of enhancing the MH
> discovery stuff to handle the new HA device discovery methodology.  If
> there is something I can help with, let me know.
>
> Dave
>
>
>

--000000000000df4215064acd1467
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanx for the trace Brian.=C2=A0 The discovery topics and =
templates being used are slightly different from anything I have seen befor=
e.=C2=A0 It shouldn&#39;t be too hard to enhance the MH discovery to handle=
 this.=C2=A0 The Jinja templates are a bit of a nuisance, but I will fudge =
something...=C2=A0 It will take me a few days to get to this...<div><br></d=
iv><div>Dave</div></div><br><div class=3D"gmail_quote gmail_quote_container=
"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Feb 13, 2026 at 7:01=E2=80=
=AFPM Brian M &lt;<a href=3D"mailto:[email protected]">mister=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex"><u></u>

 =20
   =20
 =20
  <div>
    <p>Thanks, Dave. Mostly I&#39;m in good shape, but I&#39;ve got some ed=
ge
      cases.=C2=A0</p>
    <p>My primary problem at the moment seems to be that I can&#39;t set th=
e
      brightness for my ZWave dimmer switches via ZWave-JS-UI. The
      correct MQTT string in one instance is:</p>
    <p>=C2=A0 =C2=A0
app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/target=
Value/set</p>
    <p>Writing &quot;3&quot; to that MQTT topic (via MQTT-Explorer)=C2=A0 c=
auses the
      light to come on at 3%, as expected. However, in MH setting it to
      3, &#39;3&#39;, or &#39;3%&#39; results in the light being turned on =
100%.</p>
    <p>I can&#39;t tell if this is a problem in with the discovery itself,
      or the implementation of of setting the MQTT_DISCOVEREDITEM.=C2=A0 He=
re
      are some details:</p>
    <p>The MQTT discovered_item entry:</p>
    <blockquote>
      <p><font face=3D"monospace">MQTT_DISCOVEREDITEM,
          Upstairs_Landing_Stairs, mqtt_discovery2,
          app/zwave-js-ui/config/light/Upstairs_Landing-Stairs/dimmer/confi=
g,
{&quot;command_topic&quot;:&quot;app/zwave-js-ui/Upstairs_Landing/Stairs/sw=
itch_multilevel/endpoint_0/targetValue/set&quot;,&quot;state_topic&quot;:&q=
uot;app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/cu=
rrentValue&quot;,&quot;state_value_template&quot;:&quot;{{
          \&quot;OFF\&quot; if value_json.value =3D=3D 0 else \&quot;ON\&qu=
ot;
}}&quot;,&quot;brightness_command_topic&quot;:&quot;app/zwave-js-ui/Upstair=
s_Landing/Stairs/switch_multilevel/endpoint_0/targetValue/set&quot;,&quot;b=
rightness_scale&quot;:99,&quot;brightness_state_topic&quot;:&quot;app/zwave=
-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/currentValue&qu=
ot;,&quot;brightness_value_template&quot;:&quot;{{
          value_json.value
}}&quot;,&quot;on_command_type&quot;:&quot;brightness&quot;,&quot;supported=
_color_modes&quot;:[&quot;brightness&quot;],&quot;availability&quot;:[{&quo=
t;payload_available&quot;:&quot;true&quot;,&quot;payload_not_available&quot=
;:&quot;false&quot;,&quot;topic&quot;:&quot;app/zwave-js-ui/Upstairs_Landin=
g/Stairs/status&quot;,&quot;value_template&quot;:&quot;{{&#39;true&#39;
          if value_json.value else
&#39;false&#39;}}&quot;},{&quot;topic&quot;:&quot;app/zwave-js-ui/_CLIENTS/=
ZWAVE_GATEWAY-zwave-js-ui/status&quot;,&quot;value_template&quot;:&quot;{{&=
#39;online&#39;
          if value_json.value else
&#39;offline&#39;}}&quot;},{&quot;payload_available&quot;:&quot;true&quot;,=
&quot;payload_not_available&quot;:&quot;false&quot;,&quot;topic&quot;:&quot=
;app/zwave-js-ui/driver/status&quot;}],&quot;availability_mode&quot;:&quot;=
all&quot;,&quot;device&quot;:{&quot;identifiers&quot;:[&quot;zwavejs2mqtt_0=
xc92945ec_node259&quot;],&quot;manufacturer&quot;:&quot;Zooz&quot;,&quot;mo=
del&quot;:&quot;Dimmer
(ZEN72)&quot;,&quot;name&quot;:&quot;Upstairs_Landing-Stairs&quot;,&quot;sw=
_version&quot;:&quot;4.0.1&quot;},&quot;name&quot;:&quot;Upstairs_Landing_S=
tairs&quot;,&quot;unique_id&quot;:&quot;zwavejs2mqtt_0xc92945ec_259-38-0-cu=
rrentValue&quot;}</font></p>
    </blockquote>
    <p>Relevant log messages (MQTT debug level 2):</p>
    <blockquote>
      <p><font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: Pending
          $Upstairs_Landing_Stairs--&gt;set( 3%, ,=C2=A0 ) cleared</font><b=
r>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: unable to
          process template {{&quot;OFF&quot;ifvalue_json.value=3D=3D0else&q=
uot;ON&quot;}}</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: fishing
          template value out of json with &#39;$value =3D
          $value_json-&gt;{value}&#39;</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: remote
          item MQTT to MH Upstairs_Landing_Stairs set(95%, &#39;&#39;)</fon=
t><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: remote
          item $Upstairs_Landing_Stairs received message <a>R:0</a>
<a>T:app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/c=
urrentValue</a>=C2=A0
M:{&quot;time&quot;:1771026899727,&quot;value&quot;:95,&quot;nodeName&quot;=
:&quot;Stairs&quot;,&quot;nodeLocation&quot;:&quot;Upstairs_Landing&quot;}<=
/font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: unable to
          process template {{&quot;OFF&quot;ifvalue_json.value=3D=3D0else&q=
uot;ON&quot;}}</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: fishing
          template value out of json with &#39;$value =3D
          $value_json-&gt;{value}&#39;</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: remote
          item MQTT to MH Upstairs_Landing_Stairs set(95%, &#39;mqtt&#39;)<=
/font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: mqttserver
          Rcv&#39;d: <a>R:0</a>
<a>T:&#39;app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoin=
t_0/duration</a>&#39;
M:&#39;{&quot;time&quot;:1771026899728,&quot;value&quot;:{&quot;value&quot;=
:0,&quot;unit&quot;:&quot;seconds&quot;},&quot;nodeName&quot;:&quot;Stairs&=
quot;,&quot;nodeLocation&quot;:&quot;Upstairs_Landing&quot;}&#39;</font><br=
>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: UNHANDLED
          MESSAGE
app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/durati=
on
          --
{&quot;time&quot;:1771026899728,&quot;value&quot;:{&quot;value&quot;:0,&quo=
t;unit&quot;:&quot;seconds&quot;},&quot;nodeName&quot;:&quot;Stairs&quot;,&=
quot;nodeLocation&quot;:&quot;Upstairs_Landing&quot;}</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: mqttserver
          Rcv&#39;d: <a>R:0</a>
<a>T:&#39;app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoin=
t_0/targetValue</a>&#39;
M:&#39;{&quot;time&quot;:1771026899728,&quot;value&quot;:95,&quot;nodeName&=
quot;:&quot;Stairs&quot;,&quot;nodeLocation&quot;:&quot;Upstairs_Landing&qu=
ot;}&#39;</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: UNHANDLED
          MESSAGE
app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/target=
Value
          --
{&quot;time&quot;:1771026899728,&quot;value&quot;:95,&quot;nodeName&quot;:&=
quot;Stairs&quot;,&quot;nodeLocation&quot;:&quot;Upstairs_Landing&quot;}</f=
ont><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: mqttserver
          Rcv&#39;d: <a>R:0</a>
<a>T:&#39;app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoin=
t_0/currentValue</a>&#39;
M:&#39;{&quot;time&quot;:1771026899858,&quot;value&quot;:95,&quot;nodeName&=
quot;:&quot;Stairs&quot;,&quot;nodeLocation&quot;:&quot;Upstairs_Landing&qu=
ot;}&#39;</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: remote
          item $Upstairs_Landing_Stairs received message <a>R:0</a>
<a>T:app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/c=
urrentValue</a>=C2=A0
M:{&quot;time&quot;:1771026899858,&quot;value&quot;:95,&quot;nodeName&quot;=
:&quot;Stairs&quot;,&quot;nodeLocation&quot;:&quot;Upstairs_Landing&quot;}<=
/font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: unable to
          process template {{&quot;OFF&quot;ifvalue_json.value=3D=3D0else&q=
uot;ON&quot;}}</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: fishing
          template value out of json with &#39;$value =3D
          $value_json-&gt;{value}&#39;</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: remote
          item MQTT to MH Upstairs_Landing_Stairs set(95%, &#39;mqtt&#39;)<=
/font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: remote
          item $Upstairs_Landing_Stairs received message <a>R:0</a>
<a>T:app/zwave-js-ui/Upstairs_Landing/Stairs/switch_multilevel/endpoint_0/c=
urrentValue</a>=C2=A0
M:{&quot;time&quot;:1771026899858,&quot;value&quot;:95,&quot;nodeName&quot;=
:&quot;Stairs&quot;,&quot;nodeLocation&quot;:&quot;Upstairs_Landing&quot;}<=
/font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: unable to
          process template {{&quot;OFF&quot;ifvalue_json.value=3D=3D0else&q=
uot;ON&quot;}}</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D2]: fishing
          template value out of json with &#39;$value =3D
          $value_json-&gt;{value}&#39;</font><br>
        <font face=3D"monospace">2026-02-13 15:54:59 [MQTT D1]: remote
          item MQTT to MH Upstairs_Landing_Stairs set(95%, &#39;mqtt&#39;)<=
/font></p>
    </blockquote>
    <p><br>
      Clearly it&#39;s not happy, but I haven&#39;t been able to chase down=
 the
      root cause. BTW, the &quot;95%&quot; mentioned in the logs was the sw=
itch&#39;s
      existing brightness level before I tried to change it.</p>
    <p>Hopefully, this is clearer to you than to me.</p>
    <p>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 -B.</p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div><br>
    </div>
    <div>On 2/13/26 15:08, Dave Neudoerffer
      wrote:<br>
    </div>
    <blockquote type=3D"cite">
     =20
      <div dir=3D"auto">
        <div>You are correct Brian. HA_Item is about mirroring home
          assistant entities.=C2=A0 Howard uses HA to host most of his
          devices and MH for automations using HA_Items. Without a HA
          service, HA_Item makes no sense.=C2=A0</div>
        <div dir=3D"auto"><br>
        </div>
        <div dir=3D"auto">In implementing mqtt_items, I had a few
          different sources of mqtt devices, but not a huge variety. No
          did not have any zwave2mqtt stuff. I have used the zigbee2mqtt
          stuff.=C2=A0 I am actually in the process of enhancing the MH
          discovery stuff to handle the new HA device discovery
          methodology.=C2=A0 If there is something I can help with, let me
          know.=C2=A0</div>
        <div dir=3D"auto"><br>
        </div>
        <div dir=3D"auto">Dave</div>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div>

--000000000000df4215064acd1467--


--===============3271867244084203378==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============3271867244084203378==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users


--===============3271867244084203378==--