<?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[Newbie question : how to toggle a led with MQTT]]></title><description><![CDATA[<p dir="auto">Hello.</p>
<p dir="auto">I am newbie with Mysensors and iot world. So I am reading a lot actually. I am trying to do basics tests for learning. So my confiuration is</p>
<ul>
<li>MySensors lib 1.4, all arduino nano, nrf24</li>
<li>Gateway : I use the MQTT broker gateway</li>
<li>for debugging MQTT, I use MQTTLens (maybe there is a better tool)</li>
</ul>
<p dir="auto">My first test was using just one node with a DHT11. I am able to read the infos in MQTTLens.</p>
<p dir="auto">Now I am trying to toggle a led with MQTT.<br />
So, I removed the DHT11, and connected a led. I verified that hardware is ok by using a simple blink led sketch.<br />
I am using the MySensors relay example.</p>
<ol>
<li>
<p dir="auto">I added this line in Setup(). Is it ok?<br />
gw.request(sensor, V_LIGHT,0);</p>
</li>
<li>
<p dir="auto">Here is my problem, maybe a silly question, but I am learning so<br />
in MQTTLens, what command must I send ?? Is it in the subscribe or publish field? I thought that subscribe was just for receiving and publish for sending info. Maybe not?</p>
</li>
</ol>
<p dir="auto">In subscribe field, if I do  MyMQTT/20/1/V_LIGHT my Led toggle on. But How to toggle off?<br />
I think I do not understand how MQTT works yet but I will get it!</p>
<p dir="auto">Thanks for your help I hope my english is not too bad...<br />
Have a good day.</p>
]]></description><link>https://forum.mysensors.org/topic/1065/newbie-question-how-to-toggle-a-led-with-mqtt</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 16:08:49 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/1065.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Mar 2015 11:18:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Newbie question : how to toggle a led with MQTT on Tue, 03 Mar 2015 18:11:22 GMT]]></title><description><![CDATA[<p dir="auto">at 1) The RelaisActor sketch works out of the box. There is nothing to add. (I think :-) )<br />
at 2) You are right. I don't know "MQTTLens" (I use MQTTfx) but it should be another Input Field for the payload. "1" means Relais on, "0" means off.</p>
]]></description><link>https://forum.mysensors.org/post/10954</link><guid isPermaLink="true">https://forum.mysensors.org/post/10954</guid><dc:creator><![CDATA[Xander]]></dc:creator><pubDate>Tue, 03 Mar 2015 18:11:22 GMT</pubDate></item></channel></rss>