<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Smart Home: Let the Party Begin</title><link>/members-area/personalblogs/b/blog/posts/smart-home-let-the-party-begin</link><description>I decided today to try and work on the programming for the Party Ball. I had already written a c++ program to decode the MQTT messages and am using the LED Controller from MK Smart House as a basis for the code. I wanted to keep the MQTT commands rela</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Smart Home: Let the Party Begin</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/smart-home-let-the-party-begin</link><pubDate>Tue, 22 May 2018 21:53:59 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:dcdcbc4c-fb4e-4767-99e6-62a728219fb0</guid><dc:creator>mcb1</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Looks great.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;blockquote class="jive-quote"&gt;&lt;p&gt;the actual value sent to the device is 255,0,22. I Am not sure the reason&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;I&amp;#39;m not the software expert here, but I suspect the error might be here.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=String+intval+%3D+msg.substring%28found+%2B1%2C+sizeof%28msg%29%29%3B++%0A++Gval+%3D+intval.substring%280%2C+intval.indexOf%28%22%3A%22%29%29%3B++%0A++Bval+%3D+intval.substring%28intval.indexOf%28%22%3A%22%29+%2B+1%2C+sizeof%28msg%29%29%3B]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;You&amp;#39;ve created a new string (intval) which has a new length, but you&amp;#39;re still using the length of the old string (msg) to determine the end point.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I suspect it should read&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=Bval+%3D+intval.substring%28intval.indexOf%28%22%3A%22%29+%2B+1%2C+sizeof%28intval%29%29%3B]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;blockquote class="jive-quote"&gt;&lt;p&gt;The values passed to the Pixels.Color() are all multiplied by 2.55 as the RGB values received from Openhab are in the range of 0-100&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;You may want to look at the command &amp;#39;map&amp;#39;. &lt;a class="jive-link-external-small" href="https://www.arduino.cc/reference/en/language/functions/math/map/" rel="nofollow ugc noopener" target="_blank" title="https://www.arduino.cc/reference/en/language/functions/math/map/"&gt;https://www.arduino.cc/reference/en/language/functions/math/map/&lt;/a&gt; &lt;/p&gt;&lt;p&gt;it allows a smoother adjustment of 0-100 to 0-255 (or any other range you wish)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Mark&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=4857&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Smart Home: Let the Party Begin</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/smart-home-let-the-party-begin</link><pubDate>Tue, 22 May 2018 18:06:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:dcdcbc4c-fb4e-4767-99e6-62a728219fb0</guid><dc:creator>genebren</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Nice update on your lighting system.&amp;nbsp; This looks like a fun little project.&lt;/p&gt;&lt;p&gt;Keep up the good work!&lt;/p&gt;&lt;p&gt;Gene&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=4857&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>