Problems with MQTT & Automations. Was working, then borked

Hey there, I have a few automations that just suddenly stopped working. Not sure why, they were working fine on .43.2, .44.1, and .45.1, then today I had a unknown error that required me to reboot the Pi and when it came back up, this stuff no longer worked.

First of all I have an automation that is triggered when my front door is unlocked, via MQTT to a Smartthings hub. Since the reboot today, the MQTT message is not being received by HASS. Subscribing to my MQTT feed, I see that the message is being posted by the Smartthings bridge:

message from Smartthings-MQTT-Bridge logs:
0|smartthi | info: Incoming message from MQTT: smartthings/Unlock Notifier Sean/switch = on

message from Mosquitto logs:
smartthings/Unlock Notifier Sean/switch on

…but it doesn’t show up in the HASS logs. Here is my automation which shows that HASS should be subscribed to this topic:

- alias: Sean Unlock Routine
  trigger:
    platform: mqtt
    topic: smartthings/Unlock Notifier Sean/switch
    payload: 'on'
  action:
    - service: media_player.volume_set
      entity_id: media_player.living_room_home
      data:
        volume_level: 0.7
    - service: tts.google_say
      entity_id: media_player.living_room_home
      data:
        message: 'Welcome home Boss!'

Also worth mentioning, I can manually trigger this automation and it performs as it should, it’s just not subscribing to the MQTT topic.

The second problem automation is simply not acting, even though it IS seeing the MQTT trigger event. It’s a motion sensor in my kitchen that is supposed to turn on the lights at night. HASS sees the MQTT event:
17-06-02 00:26:45 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on smartthings/Xiaomi Motion/motion: active

and is setup to trigger under these conditions, which are all satisfied:

- alias: Kitchen Motion Light
  trigger:
    platform: state
    entity_id: binary_sensor.kitchen_motion
    to: 'on'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: switch.kitchen_motion_switch
        state: 'on'
      - condition: or
        conditions:
        - condition: sun
          after: sunset
          after_offset: "-0:45:00"
        - condition: sun
          before: sunrise
          before_offset: "1:00:00"
  action:
    service: homeassistant.turn_on
    entity_id: script.timed_light_k

here’s the binary sensor:

- platform: mqtt
  name: "Kitchen Motion"
  state_topic: "smartthings/Xiaomi Motion/motion"
  payload_on: "active"
  payload_off: "inactive"
  retain: true

and the required switch shows to be “on” in the states panel:
switch.kitchen_motion_sensor on friendly_name: Kitchen Motion Sensor

…but it never fires or gives any errors in the logs. Again, I can trigger this manually in ‘states’

I tried reverting from 45.1 to 44.1 and 43.2 but it’s the same story. Previously I have been able to reboot this Pi and everything comes up running fine. Mosquito was recently updated to 1.4.12 as part of sudo apt update/upgrade. What the hell is going on here??? Any insight?

To add one detail: I have the following errors at startup:

2017-06-02 00:57:58 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/discovery.py", line 119, in scan_devices
    None, _discover, netdisco)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/discovery.py", line 145, in _discover
    netdisco.scan()
  File "/home/homeassistant/.homeassistant/deps/netdisco/discovery.py", line 57, in scan
    self.ssdp.scan()
  File "/home/homeassistant/.homeassistant/deps/netdisco/ssdp.py", line 38, in scan
    self.update()
  File "/home/homeassistant/.homeassistant/deps/netdisco/ssdp.py", line 86, in update
    entry for entry in scan()
  File "/home/homeassistant/.homeassistant/deps/netdisco/ssdp.py", line 270, in scan
    return sorted(entries.values(), key=lambda entry: entry.location)
TypeError: unorderable types: NoneType() < str()

I finally figured this out. Apparently the automation now requires: initial_state: true for it to subscribe to the MQTT topic. Why this started behaving weird when it did is beyond me - not in line with an update and not fixable with a rollback. Weird.