Ping binary sensor

I have a binary ping sensor for my smart tv to detect its state, I am using this sensor as part of a template switch that uses a diy mqtt to infrared blaster (D1 mini running tasmota) to turn it on and off . The problem is that the sensor takes 5 minutes to update the states - is there a way to trigger this sensor to ping in script or is the only solution to set the scan interval so it detect sooner? I have a couple of these types of sensors to do, and really want to avoid having to ping all my devices every few seconds…

On a different note mqtt to infrared blaster (D1 mini running tasmota) how did u set this up ???

It was actually simple, tasmota makes it super easy. I used a “IR - Infrared Receiver (TSOP38238)” so I can get the IR code from my remotes. (Tasmota prints this to the serial or web console and also sends it via mqtt).

For transmitting I used a infrared led (connected via transistor and resistors on a GPIO.)
Example of ir led circuit

Sending a mqtt message to topic: cmnd/YOUR_DEVICE_MQTT_TOPIC/irsend
with the payload you got from the ir receiver - payload: {“Protocol”:“NEC”,“Bits”:32,“Data”:0x8166817E}
When you receive the data the data is in quotes - I removed these quotes, I also needed to add the 0x to the data. The senors shows {“Protocol”:“NEC”,“Bits”:32,“Data”:“8166817E”}, changed to {“Protocol”:“NEC”,“Bits”:32,“Data”:0x8166817E}

Hope this helps?

You can then either use the ir receiver in one room and another d1 mini in the other to control the device. I am however planning on setting up some cards with the buttons so I do not need to have the remotes in other rooms…

Got this working using the homeassistant.update_entity. Basically have send the IR code, have a 10 seconds delay - then called the servce to check the status…