Exploring Tasmota's HOLD Function for Automation Control

Hey everyone! I’ve been diving into the world of Tasmota and smart home automation, and I wanted to share my recent experience and a question I have regarding the HOLD function. I’ve been using Tasmota to control my smart bulbs and PIR sensors, and it’s been a fantastic journey so far. However, I’ve hit a snag that I’m hoping the community can help me with.

I’ve set up a PIR sensor to control a smart bulb in my bedroom. The goal is to have the bulb turn on at full brightness when motion is detected and then dim to 15% after 30 seconds of no motion. Here’s the setup I’ve used:

yaml

  • id: ‘2470561851163’
    alias: Bedroom PIR High
    trigger:

    • entity_id: binary_sensor.bedroom_pir
      from: ‘off’
      platform: state
      to: ‘on’
      condition:
    • after: ‘17:30:00’
      before: 06:00:00
      condition: time
      action:
    • data:
      brightness: 255
      entity_id: light.bedroom_bulb
      service: light.turn_on
  • id: ‘2179531861664’
    alias: Bedroom PIR Low
    trigger:

    • entity_id: binary_sensor.bedroom_pir
      for: 00:00:30
      from: ‘on’
      platform: state
      to: ‘off’
      condition:
    • after: ‘17:30:00’
      before: 06:00:00
      condition: time
      action:
    • data:
      brightness: 40
      entity_id: light.bedroom_bulb
      service: light.turn_on

This setup works perfectly, but now I want to add the ability to enable or disable this automation using a switch on another Tasmota device. I’ve configured the switch with switchmode 5 (HOLD) and created the following rule:

plaintext
on switch5#state=3 do publish BedRoom/AutoLight/state TOGGLE

However, I’m not seeing the HOLD command showing up in the console, and the automation isn’t toggling as expected. I’m wondering if I’ve made a mistake in the rule or if there’s something else I need to configure. I’ve checked the logs and everything seems to be connected properly, but the HOLD functionality isn’t working as intended.

I’m curious if others have successfully used the HOLD function with automations and if there are any tips or best practices for making this work smoothly. Any insights or suggestions would be greatly appreciated!

Looking forward to hearing from you all and learning more about the capabilities of Tasmota and Home Assistant!