Goal:
Have Home Assistant quickly turn on/off the surround sound after it noticed the TV turn on. To ensure that the surround sound is on/off, repeat the command with the IR blaster until the Sonoff S31 identifies the enegery current is at the correct level. I am willing to go a completely different path to solving the issue if someone has an idea.
Issue:
With my current working configuration, it can take a while for the Surround Sound receiver to detect the IR blaster. This is because the Tasmota software on my Sonoff S31 smart plug can only report the TelePeriod at the fastest, every 10 seconds. I then have to wait 11 seconds for my automation to repeat so that Home Assistant can have enough time to receive the new energy current statistics from the Sonoff S31 flashed with Tasmota. 11 seconds multiplied by the number of attempts required to get the surround sound receiver to turn on can cause a decent wait, sometimes of over a minute (not a massive issue, but kind of annoying).
Current Working Configuration:
With the current working configuration, the only issue is the time it takes for the surround sound to power toggle. This is because the Sonoff S31 Smart Plug can only have the TelePeriod turned down to 10 seconds at the fastest (The range is 10 seconds to 3600 seconds.). I have to repeatedly send the signal to turn on/off the Logitech z-5500 surround sound as it isn’t always responsive with the Broadlink RM4 Mini. It always responds with my Logitech Harmony 700 remote, but that can’t be tied into automation like the Broadlink RM4 mini can. My current automation is once the TV powers on/off, send the IR signal to turn on the surround sound (condition is to check the numeric value of the energy current for the smart-plug to see if it is above 0.17), then wait 11 seconds before repeating. This works, but if it takes for example 8 attempts to turn on the surround sound for some odd reason, it will take 88 seconds to turn on. I have tried moving the IR blaster, and considered mounting it to the back of the TV with some adhesive since the receiver for the surround sound is under the TV (which I would be fine with), but even that doesn’t seem to work consistently. Sometimes the surround sound turns on first try, sometimes it takes a quite a few attempts.
YAML code for Surround Sound to turn on:
alias: Surround Sound - Turn On
description: ""
trigger:
- platform: device
type: turned_on
device_id: 5f711a4bcb91d4f239a05a4d7475e47c
entity_id: 71fd1e538c93dd8e7ff598fbea588488
domain: remote
condition: []
action:
- repeat:
sequence:
- service: script.surround_sound_power_toggle
data: {}
- delay:
hours: 0
minutes: 0
seconds: 11
milliseconds: 0
until:
- condition: numeric_state
entity_id: sensor.z5500plug_energy_current
above: 0.17
enabled: true
mode: restart
YAML code for Surround Sound to turn off:
alias: Surround Sound - Turn Off
description: ""
trigger:
- platform: device
type: turned_off
device_id: 5f711a4bcb91d4f239a05a4d7475e47c
entity_id: 71fd1e538c93dd8e7ff598fbea588488
domain: remote
condition: []
action:
- repeat:
sequence:
- service: script.surround_sound_power_toggle
data: {}
- delay:
hours: 0
minutes: 0
seconds: 11
milliseconds: 0
until:
- condition: numeric_state
entity_id: sensor.z5500plug_energy_current
below: 0.17
enabled: true
mode: restart
Hardware:
Surround Sound: Logitech Z-5500
IR Blaster: Broadlink RM4 Mini
Smart Plug: Sonoff S31 (wifi) flashed with Tasmota (version: 13.2.0)
– Smart Plug communicates to Home Assistant via MQTT with Home Assistant using Mosquitto Broker 6.3.1.
Home Assistant Installation and Versions:
Raspberry Pi 4 - 8 GB (wired Ethernet, not wireless)
Installed HassOS with Raspberry Pi Imager
Home Assistant 2023.10.3
Supervisor 2023.10.0
Operating System 11.0
Frontend 20231005.0
Mosquitto Broker: 6.3.1