Getting null door lock status, Mqtt verified as working

  • Platform information:

    • Raspberry pi B+
    • OS: _Openhab 2.2.0-1
      Release = Raspbian GNU/Linux 8 (jessie)
      Kernel = Linux 4.9.35+
  • The status of my door lock used to display on both the web UI and the Android mobile app UI. This is no longer the case, and the status of Locked vs. Unlocked is null. I’ve tested mosquitto and it works just fine. I’ve updated and upgraded and rebooted.
    The GO button for garage no longer sends the signal to the relay, but I can manually publish a topic that will make it work.
    Android notification also stopped working.
    Dimmer lights still work

  • [21:37:50] openhabian@openHABianPi:/$ mosquitto_sub -v -t Garage/Locked
    Garage/Locked LOCKED
    Garage/Locked UNLOCKED
    This shows that mqtt is working properly with the pi

//This is the rules file

//Garage door is up notification
rule "Garage Door Notification"
when
        Item GarageStatus changed from OPENING to UP
then
        sendBroadcastNotification("Garage Door Is Up")
end

//This is the Items File

//Demo items
Switch DEMOSW "Demo Switch"
Switch GARAGE "Garage Button" <garagedoor-closed> {autoupdate="false",mqtt=">[broker:Garage/Relay:command:ON:1]"}

//Garage Status
String GarageStatus "Garage door is [%s]"<garage>{mqtt="<[broker:Garage/Status:state:default]"}

//Side Door Deadbolt
String SideDoorBolt "Side Door is [MAP(side.map):%s]"<door>{mqtt="<[broker:Garage/Locked:state:default]"}

// Lamp 1
Dimmer Living_Lamp "Lamp 1"     {channel="hue:0100:xxxxxxxxxxxx:1:brightness"}
Dimmer Living_Lamp_W "Lamp by window" {channel="hue:0100:xxxxxxxxxxxx:2:brightness"}
sitemap home label="Stack Smart Home"
{
        Frame label="Kitchen"
        {
                Switch item=DEMOSW
        }

        Frame label="Living Room"
        {
                Slider  item=Living_Lamp
                Slider  item=Living_Lamp_W
        }

        Frame label="Hall"
        {
                Switch item=DEMOSW
        }

        Frame label="Master Bedroom"
        {
                Switch item=DEMOSW
        }

        Frame label="Bathroom"
        {
                Switch item=DEMOSW
        }

        Frame label="Side Door"
        {
                Text item=SideDoorBolt
        }
        Frame label="Garage"
        {
                Switch item=GARAGE mappings=[ON="Go"]

                Text item=GarageStatus
        }

        Frame label="Outside"
        {
                Switch item=DEMOSW
        }

}

How does your mqtt.cfg looks like? And a log from openhab starting could also be helpfull.

MQTT.cfg

#
# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.
#

# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
broker.url=tcp://192.168.1.22:1883

# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.
#<broker>.clientId=<clientId>

# Optional. True or false. If set to true, allows the use of clientId values
# up to 65535 characters long. Defaults to false.
# NOTE: clientId values longer than 23 characters may not be supported by all
# MQTT servers. Check the server documentation.
#<broker>.allowLongerClientIds=false

# Optional. User id to authenticate with the broker.
#<broker>.user=<user>

# Optional. Password to authenticate with the broker.
#<broker>.pwd=<password>

# Optional. Set the quality of service level for sending messages to this broker.
# Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2
# (Deliver exactly once). Defaults to 0.
#<broker>.qos=<qos>

# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.
#<broker>.retain=<retain>

# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.
#<broker>.async=<async>

# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>
#<broker>.lwt=<last will definition>



I forgot to mention that I started having this problem shortly after installing a new wireless router. As far as I know the settings are the same.

As far as you know, they could have changed too!!
Check the connected devices in your router settings and check the assigned IPs

MQTT.cfg

#
# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.
#

# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
broker.url=tcp://192.168.1.22:1883

# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.
#<broker>.clientId=<openhab2>

# Optional. True or false. If set to true, allows the use of clientId values
# up to 65535 characters long. Defaults to false.
# NOTE: clientId values longer than 23 characters may not be supported by all
# MQTT servers. Check the server documentation.
#<broker>.allowLongerClientIds=false

# Optional. User id to authenticate with the broker.
#<broker>.user=<user>

# Optional. Password to authenticate with the broker.
#<broker>.pwd=<password>

# Optional. Set the quality of service level for sending messages to this broker.
# Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2
# (Deliver exactly once). Defaults to 0.
#<broker>.qos=<qos>

# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.
<broker>.retain=<true>

# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.
<broker>.async=<false>

# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>
#<broker>.lwt=<last will definition>

Also what should my router settings be for openhab2

View of Basic UI with Notes

The items you say which are not working work with my mqtt.
I added some whitespaces!

String SideDoorBolt "Side Door is [MAP(de.map):%s]" <door> {mqtt="<[mymosquitto:433MHz:state:MAP(side.map)]" }

My mqtt.cfg contains only:

mymosquitto.url=tcp://localhost:1883
mymosquitto.user=<user>
mymosquitto.pwd=<password>

Often it helps to uninstall and reinstall the binding.

So what does the log say when restarting openhab? Everything related to mqtt is interresting.

I ended up getting a larger and faster SD card and starting over from scratch. Everything works properly now. I believe my old card was corrupted. Thanks everyone for your input.