Hello everyone,
I am currently running openhab on Rpi3. I have created items, rule and sitemap file and I tested it before 2-3 months . It was working fine but now its causing me issue.
One of my rules is getting executed multiple times, without any reason .
Below i have mentioned my items, rules and sitemap files,.
sitemap demo label="Main Menu"
{
Frame label="STM32F4 Serial" icon="socket" {
Text item=STM32F4
Switch item=Relay
}
}
And here goes my Rules file:
rule "STM32F4"
when
Item STM32F4 received update
then
var String EPBUpdate = STM32F4.state.toString.trim
end
rule "Relay"
when
Item Relay changed
then
var state = Relay.state as OnOffType
sendCommand (STM32F4 , "R" + state + "\r")
end
Here goes my items file:
String STM32F4 "STM32F4 [%s]" { serial="/dev/ttyUSB0" }
Switch Relay "Relay (PL3)" <contact>
I am trying to send my data from OH2 to my board serialy and it was working fine few months before.
Here is my event log file :
2018-11-29 17:06:34.762 [ome.event.ItemCommandEvent] - Item ‘Relay’ received command ON
2018-11-29 17:06:34.767 [vent.ItemStateChangedEvent] - Relay changed from OFF to ON
2018-11-29 17:06:34.770 [ome.event.ItemCommandEvent] - Item ‘STM32F4’ received command RON
2018-11-29 17:06:34.778 [vent.ItemStateChangedEvent] - STM32F4 changed from F to RON
2018-11-29 17:06:34.887 [vent.ItemStateChangedEvent] - STM32F4 changed from RON
to N
2018-11-29 17:06:35.741 [ome.event.ItemCommandEvent] - Item ‘Relay’ received command OFF
2018-11-29 17:06:35.745 [vent.ItemStateChangedEvent] - Relay changed from ON to OFF
2018-11-29 17:06:35.747 [ome.event.ItemCommandEvent] - Item ‘STM32F4’ received command ROFF
2018-11-29 17:06:35.751 [vent.ItemStateChangedEvent] - STM32F4 changed from N to ROFF
2018-11-29 17:06:35.867 [vent.ItemStateChangedEvent] - STM32F4 changed from ROFF
to R
Data is recieved correctly on the board serially. and relay is turning ON and OFF serialy. Its just my STM32F4 Item misbehaving , reason unknown ?
Can anyone tell were ios the issue ?