OH2.2. RPI3.
On the OH v2 I had the same problem, but more often.
Just install OH v2.2.
Install mosquitto through comand “openhabian-config”.
In “PaperUI” install MQTT Actions, MQTT Binding, MQTT Persistence.
mqtt.cfg:
localmosquitto.url=tcp://localhost:1883
localmosquitto.clientId=RPI3OH22
test.items:
Color RGBLedKorr "Корридор"
String RGBLedColorKorr {mqtt=">[localmosquitto:RPI/W2813/command/korr:command:*:default]"}
test.sitemap:
sitemap test label="Для тестов"
{
Colorpicker item=RGBLedKorr
}
// vim: syntax=Xtend
test.rules:
rule "Set HSB value of item RGBLed to RGB color value"
when
Item RGBLedKorr changed
then
val hsbValue = RGBLedKorr.state as HSBType
val brightness = hsbValue.brightness.intValue
val redValue = ((((hsbValue.red.intValue * 255) / 100) *brightness) /100).toString
val greenValue = ((((hsbValue.green.intValue * 255) / 100) *brightness) /100).toString
val blueValue = ((((hsbValue.blue.intValue * 255) / 100) *brightness) /100).toString
val color = redValue + "," + greenValue + "," + blueValue
sendCommand( RGBLedColorKorr, color)
end
rule "TestCron1"
when
Time cron "1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59 * * * * ?"
then
RGBLedKorr.sendCommand(OFF)
end
rule "TestCron2"
when
Time cron "2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * ?"
then
RGBLedKorr.sendCommand(ON)
end
Rule sends a command RGBLedKorr every second to ON or OFF.
In “Items” mqtt send data.
Everything is working.
But sometimes we have an errors.
OH writes an error. Commands don’t go away to mqtt.
After about 20 seconds all commands go away in 2 seconds.
tail -f /var/log/openhab2/openhab.log:
2018-01-08 18:32:24.421 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 18:34:50.081 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 18:35:57.076 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 18:46:37.093 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 18:51:32.034 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 18:56:32.082 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:16:42.106 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:17:23.092 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:21:36.071 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:21:46.850 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:22:23.100 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:22:38.829 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:23:15.056 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:23:24.779 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:23:35.010 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:28:18.070 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:28:28.776 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:30:12.092 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
2018-01-08 19:35:33.077 [WARN ] [ore.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@8a97c8' takes more than 5000ms.
Can anyone help me?
Otherwise we have “Stupid home”, but we want “Smart home”.