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?