<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Help sending nodes commands from openhab]]></title><description><![CDATA[<p dir="auto">Communication Path<br />
openhab 2.2 snapshot --&gt;  mosquitto (Broker) --&gt; mysensors mqtt gateway --&gt; mysensors node</p>
<p dir="auto">I can send the following command to my mosquitto broker and it works with no issue to turn a node on and off.</p>
<pre><code>mosquitto_pub -t 'mysgateway-in/5/0/1/0/2' -m 'OFF'
mosquitto_pub -t 'mysgateway-in/5/0/1/0/2' -m 'ON'
</code></pre>
<p dir="auto">I am using HabPanel and set up a switch to basically toggle from OFF to ON</p>
<p dir="auto">The OpenHab item is "mqttsw1"</p>
<p dir="auto">my items file looks like this</p>
<pre><code>Switch mqttsw1 "Switch 1" (all) {mqtt="&gt;[mysgateway-in/5/0/1/0/2:command:*:default],&gt;[mysgateway-in/5/0/1/0/2:command:off:default,&lt;[mysgateway-in/5/0/1/0/2:command:*:default&rsqb;&rsqb;"}

</code></pre>
<p dir="auto">My mqtt-eventbus.cfg looks like this. I believe the issue is in the commandPublishTopic and if I comment out the existing line and replace it with the one right below I can get at least that switch to work.</p>
<pre><code class="lang-#">broker=mosquitto

# When available, all status updates which occur on the openHAB event bus are published to the provided topic. The message content will
# be the status. The variable ${item} will be replaced during publishing with the item name for which the state was received.
#statePublishTopic=

# When available, all commands which occur on the openHAB event bus are published to the provided topic. The message content will be the
# command. The variable ${item} will be replaced during publishing with the item name for which the command was received.
commandPublishTopic=mysgateway-in/${item}
#commandPublishTopic=mysgateway-in/5/0/1/0/2

# When available, all status updates received on this topic will be posted to the openHAB event bus. The message content is assumed to be
# a string representation of the status. The topic should include the variable ${item} to indicate which part of the topic contains the
# item name which can be used for posting the received value to the event bus.
stateSubscribeTopic=mosquitto/stateUpdates/${item}/state

# When available, all commands received on this topic will be posted to the openHAB event bus. The message content is assumed to be a
# string representation of the command. The topic should include the variable ${item} to indicate which part of the topic contains the
# item name which can be used for posting the received value to the event bus.
commandSubscribeTopic=mosquitto/commandUpdates/${item}/command
</code></pre>
<p dir="auto">Here is what I get when I subscribe to the topic with the eventbus file above.</p>
<pre><code>Client mosqsub/12310-raspberry received PUBLISH (d0, q0, r0, m0, 'mysgateway-in/mqttsw1', ... (3 bytes))
OFF
Client mosqsub/12310-raspberry received PUBLISH (d0, q0, r0, m0, 'mysgateway-in/mqttsw1', ... (2 bytes))
ON

</code></pre>
<p dir="auto">Of course it doesnt work because it is using the name of the device instead of "mysgateway-in/5/0/1/0/2" for this instance.</p>
<p dir="auto">Any clue what I can be doing wrong? I just cant seem to find anything on the web to help me out with this and I am sure its something simple.</p>
]]></description><link>https://forum.mysensors.org/topic/8840/help-sending-nodes-commands-from-openhab</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 08:34:47 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/8840.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 06 Jan 2018 15:17:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help sending nodes commands from openhab on Sat, 06 Jan 2018 23:06:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rozpruwacz" aria-label="Profile: rozpruwacz">@<bdi>rozpruwacz</bdi></a> said in <a href="/post/83245">Issue with item names when sending my nodes a command from openhab to my arduino -&gt; mysensors mqtt gateway / openhab 2.2 snapshot / mosquitto</a>:</p>
<blockquote>
<p dir="auto">t help You with your setup because actually I don't understand what You are doing  But why You do it this way ? I have it like that: HabPanel is just an UI for OpenHAB, so I don't send anything from HabPanel just controll OH items. Some of them are mqtt items and they send/receive data to/from</p>
</blockquote>
<p dir="auto">Oh sorry I meant Arduino Nano is my gateway not a broker ( I edited above post to fix). I only have one broker which is the Raspberry Pi. So its basically the same thing but I want to send controls to my sensors via the HabPanel. I can receive from the sensors with no problems. It's the sending that doesnt work when I use the variable "${item}".</p>
]]></description><link>https://forum.mysensors.org/post/83247</link><guid isPermaLink="true">https://forum.mysensors.org/post/83247</guid><dc:creator><![CDATA[fifo]]></dc:creator><pubDate>Sat, 06 Jan 2018 23:06:09 GMT</pubDate></item><item><title><![CDATA[Reply to Help sending nodes commands from openhab on Sat, 06 Jan 2018 22:05:27 GMT]]></title><description><![CDATA[<p dir="auto">You have two brokers ? I thought that there must be one broker, why do You need two brokers ? I can't help You with your setup because actually I don't understand what You are doing :P But why You do it this way ? I have it like that: HabPanel is just an UI for OpenHAB, so I don't send anything from HabPanel just controll OH items. Some of them are mqtt items and they send/receive data to/from mosquitto broker on raspberry pi, which in turn sends to mysensors gateway. And this is working perfectly.</p>
]]></description><link>https://forum.mysensors.org/post/83245</link><guid isPermaLink="true">https://forum.mysensors.org/post/83245</guid><dc:creator><![CDATA[rozpruwacz]]></dc:creator><pubDate>Sat, 06 Jan 2018 22:05:27 GMT</pubDate></item><item><title><![CDATA[Reply to Help sending nodes commands from openhab on Sat, 06 Jan 2018 23:05:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rozpruwacz" aria-label="Profile: rozpruwacz">@<bdi>rozpruwacz</bdi></a> said in <a href="/post/83224">Issue with item names when sending my nodes a command from openhab to my arduino -&gt; mysensors mqtt gateway / openhab 2.2 snapshot / mosquitto</a>:</p>
<blockquote>
<p dir="auto">what is this mqtt-eventbus.cfg file for</p>
</blockquote>
<p dir="auto">Ok I am by no means an expert, but what I understand it to be is to get all OpenHab events to look like an MQTT message and to thus allow you to update status of items in OpenHab using MQTT messages</p>
<p dir="auto">So I have my GUI (HabPanel) sending messages to my broker (Raspberry Pi3) who sends info to my  gateway (Arduino Nano) who in turn sends the data to my sensor whatever it may be.</p>
<p dir="auto">It also works in reverse (this reverse part is working as I can get status update from some temp and PIR sensors I have running already)..</p>
]]></description><link>https://forum.mysensors.org/post/83244</link><guid isPermaLink="true">https://forum.mysensors.org/post/83244</guid><dc:creator><![CDATA[fifo]]></dc:creator><pubDate>Sat, 06 Jan 2018 23:05:31 GMT</pubDate></item><item><title><![CDATA[Reply to Help sending nodes commands from openhab on Sat, 06 Jan 2018 15:51:01 GMT]]></title><description><![CDATA[<p dir="auto">what is this mqtt-eventbus.cfg file for ? and what is mqtt eventbus ? I have all commented out in this file and everything is working fine form me.</p>
]]></description><link>https://forum.mysensors.org/post/83224</link><guid isPermaLink="true">https://forum.mysensors.org/post/83224</guid><dc:creator><![CDATA[rozpruwacz]]></dc:creator><pubDate>Sat, 06 Jan 2018 15:51:01 GMT</pubDate></item></channel></rss>