<?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[Is V_RGB Supported in OpenHAB?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Is it possible to send a hex value (ff0000) with type 40 (V_RGB) from OpenHAB? Or is it possible to create a custom item with type 40?</p>
<p dir="auto">I want the message sent to look like this: 8;1;1;0;40;ffc550</p>
<p dir="auto">Cheers</p>
]]></description><link>https://forum.mysensors.org/topic/11253/is-v_rgb-supported-in-openhab</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 10:59:58 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/11253.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Jul 2020 23:39:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is V_RGB Supported in OpenHAB? on Sun, 12 Jul 2020 09:47:13 GMT]]></title><description><![CDATA[<p dir="auto">Thank you <a class="plugin-mentions-user plugin-mentions-a" href="/user/hard-shovel" aria-label="Profile: hard-shovel">@<bdi>hard-shovel</bdi></a>! It works. It doesn't store the value between reboots but I guess that's a different topic which I will look into.</p>
<p dir="auto">Cheers</p>
]]></description><link>https://forum.mysensors.org/post/106657</link><guid isPermaLink="true">https://forum.mysensors.org/post/106657</guid><dc:creator><![CDATA[Aloha]]></dc:creator><pubDate>Sun, 12 Jul 2020 09:47:13 GMT</pubDate></item><item><title><![CDATA[Reply to Is V_RGB Supported in OpenHAB? on Sat, 04 Jul 2020 12:05:08 GMT]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">Openhab and the MySensors binding use the HSTtype format (hue, saturation, brightness) for color information.<br />
The binding automatically converts the HSBtype to the MySensors format of RRGGBB.<br />
So you need to use the HSBType fromRGB(int R, int G,  int B) function</p>
<p dir="auto">items</p>
<pre><code>Color   Mock_RGB_LED     "Mock RGB LED (HSB)     "  (test254) { channel = "mysensors:rgbLight:gatewayWIFI3:Mock_RGB_LED:rgb" } 
String  test_RGB_HexString "Test Color RGB hexS [0x%s]" (test254) 
Number  test_RGB_Red	" Test Colour Red    [%s]"  (test254)
Number  test_RGB_Green  " Test Colour Green  [%s]"  (test254)
Number  test_RGB_Blue   " Test Colour Blue   [%s]"  (test254)
</code></pre>
<p dir="auto">Rules</p>
<pre><code>val String filename = "rgb-light.rules"

rule "System startup"
        when
                System started
        then
/*Initial value of colors*/
    if (test_RGB_Red.state == NULL) test_RGB_Red.postUpdate(0)
	if (test_RGB_Green.state == NULL) test_RGB_Green.postUpdate(0)
    if (test_RGB_Blue.state == NULL) test_RGB_Blue.postUpdate(0)
end
rule "Test Colour Channels RGB to Mysensors"
when
	Item test_RGB_Red   changed or
	Item test_RGB_Green changed or
	Item test_RGB_Blue  changed
then
    val int r = (test_RGB_Red.state as Number).intValue
    val int g = (test_RGB_Green.state as Number).intValue
    val int b = (test_RGB_Blue.state as Number).intValue
    logInfo(filename, "Input Conversion: r:" + r + " g:" + g + " b:" + b)
   var HSBType hsb = HSBType.fromRGB(r, g, b)
    logInfo(filename, "Input Conversion: hsb" + hsb)	
    Mock_RGB_LED.sendCommand(hsb)
end


rule "RGB Hex -&gt; HSB"
when
    Item test_RGB_HexString received update
then
    var rgb = test_RGB_HexString.state.toString

    var r = Integer::parseInt(rgb.substring(0, 2), 16)
    var g = Integer::parseInt(rgb.substring(2, 4), 16)
    var b = Integer::parseInt(rgb.substring(4, 6), 16)

    logInfo(filename, "Input Conversion: r" + r + " g" + g + " b" + b)
    var HSBType hsb = HSBType.fromRGB(r, g, b)
    logInfo(filename, "Input Conversion: hsb" + hsb)
    
    Mock_RGB_LED.sendCommand(hsb)	
end

/* I find this most useful for testing the node the Node */
rule "Test Colour Channels RGB to Mysensors"
when
    Item test_RGB_Red   changed or
    Item test_RGB_Green changed or
    Item test_RGB_Blue  changed
then
    var int r = (test_RGB_Red.state as Number).intValue
    var int g = (test_RGB_Green.state as Number).intValue
    var int b = (test_RGB_Blue.state as Number).intValue
    logInfo(filename, "Input Conversion: r:" + r + " g:" + g + " b:" + b)
    var HSBType hsb = HSBType.fromRGB(r, g, b)
    logInfo(filename, "Input Conversion: hsb" + hsb)	
    Mock_RGB_LED.sendCommand(hsb)
end	


</code></pre>
]]></description><link>https://forum.mysensors.org/post/106505</link><guid isPermaLink="true">https://forum.mysensors.org/post/106505</guid><dc:creator><![CDATA[hard-shovel]]></dc:creator><pubDate>Sat, 04 Jul 2020 12:05:08 GMT</pubDate></item></channel></rss>