I have made a mysensors 3D dimmer. Than following information found on the forum i made the following. But doesn’t seem to work although manual control works
#mosquitto_pub -t mygateway1-in/99/6/1/0/3 -m "100"
Than in the openhab.log i see
2016-05-14 16:39:08.487 [INFO ] [enhab.model.script.s_RGB_light] - Values28;65;13
Items
Group BED_RGB "Nachtlicht" Color s_RGB_light "Nachtlicht" <slider> (BED_RGB) Dimmer s_RGB_light_R "Red [%d %%]" <switch> (BED_RGB) {mqtt=">[mymosquitto:mygateway1-in/99/3/1/0/3:command:*:default]"} Dimmer s_RGB_light_G "Green [%d %%]" <switch> (BED_RGB) {mqtt=">[mymosquitto:mygateway1-in/99/5/1/0/3:command:*:default]"} Dimmer s_RGB_light_B "Blue [%d %%]" <switch> (BED_RGB) {mqtt=">[mymosquitto:mygateway1-in/99/6/1/0/3:command:*:default]"}
And than the Rule
`
import org.openhab.core.library.types.*
var HSBType hsbValue
var int redValue
var int greenValue
var int blueValue
var String RGBvalues
rule "Set s_RGB_light value"
when
Item s_RGB_light changed
then
hsbValue = s_RGB_light.state as HSBType
redValue = hsbValue.red.intValue
greenValue = hsbValue.green.intValue
blueValue = hsbValue.blue.intValue
postUpdate(s_RGB_light_R, redValue)
postUpdate(s_RGB_light_G, greenValue)
postUpdate(s_RGB_light_B, blueValue)
RGBvalues= "Values" + redValue.toString + ";" + greenValue.toString + ";" + blueValue.toString
logInfo( "s_RGB_light", RGBvalues )
end
`