I’m running the 2.5 snapshot from today, #1502.
OK, I’m out of ideas.
I have a device that publishes a message periodically. The contents of the message isn’t really relevant but for completeness sake it publishes a DD:HH:MM:SS String representation of the uptime of the device. I want to use this heart beat to keep track of whether the software is online (in the past I’ve had the program stop reporting but remain connected to the MQTT broker so LWT is not sufficient).
I created an On Off type Thing called heartbeat and took advantage of the new default value in the MAP transform. Basically any message received will be transformed into “ON”. So the thought is that the Item linked to this Channel should receive an ON command on every heartbeat. Then I’ll use Expire to timeout the Item to OFF if more than two heartbeats are missed.
Switch vManticore_SensorReporter_Online "Manticore sensorReporter [MAP(admin.map):%s]" <network> (gSensorStatus, gResetExpire) { channel="mqtt:topic:manticore-sr:heartbeat", expire="2m,command=OFF" }
Here is the behavior I’m seeing.
The Item first comes up as UNDEF, which is expected.
When the heartbeat message comes in the Item goes to ON as expected.
However, it immediately goes back to UNDEF.
20x2019-01-16 14:55:20.850 [ome.event.ItemCommandEvent] - Item 'vManticore_SensorReporter_Online' received command ON x
20x2019-01-16 14:55:20.854 [vent.ItemStateChangedEvent] - vManticore_SensorReporter_Uptime changed from 00:21:04 to 00:22:04 x
20x2019-01-16 14:55:20.860 [nt.ItemStatePredictedEvent] - vManticore_SensorReporter_Online predicted to become ON x
01x2019-01-16 14:55:20.863 [vent.ItemStateChangedEvent] - vManticore_SensorReporter_Online changed from UNDEF to ON x00
16x2019-01-16 14:55:20.864 [GroupItemStateChangedEvent] - gSensorStatus changed from OFF to ON through vManticore_SensorReporter_Online x
16x2019-01-16 14:55:20.867 [vent.ItemStateChangedEvent] - vManticore_SensorReporter_Online changed from ON to UNDEF xvi
cex2019-01-16 14:55:20.869 [GroupItemStateChangedEvent] - gSensorStatus changed from ON to OFF through vManticore_SensorReporter_Online
I have the mqtt binding in DEBUG and I don’t see anything logged. In TRACE I see a whole bunch of “Providing state description for channel mqtt:topic:manticore-sr:heartbeat” for the one message.
16x16-Jan-2019 15:04:18.140 [TRACE] [ternal.generic.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:manticore-sr:heartbeat x
16x16-Jan-2019 15:04:18.142 [TRACE] [ternal.generic.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:manticore-sr:heartbeat x
16x16-Jan-2019 15:04:18.145 [TRACE] [ternal.generic.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:manticore-sr:heartbeat x
16x16-Jan-2019 15:04:18.146 [TRACE] [ternal.generic.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:manticore-sr:heartbeat x
16x16-Jan-2019 15:04:18.149 [TRACE] [ternal.generic.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:manticore-sr:heartbeat x
16x16-Jan-2019 15:04:18.150 [TRACE] [ternal.generic.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:manticore-sr:heartbeat x
16x16-Jan-2019 15:04:18.151 [TRACE] [ternal.generic.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:manticore-sr:heartbeat x
16x16-Jan-2019 15:04:18.153 [TRACE] [ternal.generic.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:manticore-sr:heartbeat x
16x16-Jan-2019 15:04:18.155 [TRACE] [ternal.generic.MqttChannelStateDescriptionProvider] - Providing state description for channel mqtt:topic:manticore-sr:heartbeat x
So am I doing something wrong? Is the binding doing something wrong? Or is this expected behavior?
Ideas are welcome.