ACER H5360 (Emachines V700) - RS232 Control and IR Control for Yamaha AV - Solved

In the process of making my Emachines V700 (Acer H5360 clone) working with Google assistant, with Home Assistant and ESP8266 (Wemos D1 Mini).

Almost every Acer projector uses same commands, you just need to find pin-out of RS232 of your specific model.

My first test was done in an very old laptop, so the only terminal SW that worked in xp was Termite.

I was able to power ON and OFF projector using RS232, and commands as showed in image:

In my case, the PIN-out od the DIN 3-Pins in projector is as followed (used a straight cable, so I had to cross TX with RX):

So my next step is to connect Wemos D1 Mini to a TTL-RS232 IC.
I will use the max233 (no capacitors needed) and because that’s what I have available at home electronics junk :slight_smile:

I will use GPIO1 and GPIO3 for that from ESP8266.
I will keep you all posted for more developments, cause I know i will step in some nails regarding SW.

Here we go…

uart:
  id: uart_bus
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600
  data_bits: 8
  parity: NONE
  stop_bits: 1
  
#text_sensor:
#- platform: custom
#  lambda: |-
#    auto my_custom_sensor = new UartReadLineSensor(id(uart_bus));
#    App.register_component(my_custom_sensor);
#    return {my_custom_sensor};
#  text_sensors:
#    id: "uart_readline"

switch:
# switch via IR

  - platform: template
    name: "Yamaha Audio ON"
    id: Power_yamaha_audio_ON
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [8943, -4484, 553, -577, 575, -1628, 604, -1626, 603, -1651, 579, -1648, 636, -1568, 579, -1649, 578, -581, 547, -1654, 630, -523, 551, -578, 549, -551, 579, -575, 549, -605, 607, -521, 522, -1706, 499, -602, 552, -1678, 549, -581, 576, -1681, 630, -469, 607, -1623, 576, -577, 579, -548, 553, -1678, 525, -550, 631, -1622, 499, -629, 525, -1702, 500, -656, 497, -1735, 522, -1703, 472]
          carrier_frequency: 38kHz
          repeat:
            times: 3
            wait_time: 10ms
  - platform: template
    name: "Yamaha Audio Off"
    id: Power_yamaha_audio_OFF
    turn_on_action:
      - remote_transmitter.transmit_raw:
          code: [8943, -4484, 553, -577, 575, -1628, 604, -1626, 603, -1651, 579, -1648, 636, -1568, 579, -1649, 578, -581, 547, -1654, 630, -523, 551, -578, 549, -551, 579, -575, 549, -605, 607, -521, 522, -1706, 499, -602, 552, -1678, 549, -581, 576, -1681, 630, -469, 607, -1623, 576, -577, 579, -548, 553, -1678, 525, -550, 631, -1622, 499, -629, 525, -1702, 500, -656, 497, -1735, 522, -1703, 472]
          carrier_frequency: 38kHz
          repeat:
            times: 3
            wait_time: 10ms

#Switch via UART


  - platform: uart
    name: "POWER ON PROJECTOR"
    data: '* 0 IR 001\r'

Able to make connection between ESP and MAX233…seems not
Getting only strange data.
Termite is ok, cause I didnt change config since I was able to send commands to projector.

Any sugestions?

I would use this, but no clue about parameters:

Any suggestions? Yeah post some logs.

Got it…at least I have correct uart comunication.
Rookie error…didnt read the small letters…wire diagram is diferent for DIP20 and SO20…maxim tricks :frowning:

I have so many questions…but lets start with \r and \n
Shouldnt I sent a command per line, so the projector can read it?

In the picture I am sending:

  - platform: uart
    name: "POWER ON PROJECTOR"
    data: '* 0 IR 001\r'

In that case I pressed 3 times.
I got same result with \n\r or \r\n

So I need to send

data: '* 0 IR 001'

and then click return and move to next line

The second question is how to treat this as a switch with on and off (not separated pulses) and read projector feedback status, cause after sending correct code the projector sends “000” for correct trigger and “001” for fail.

Help needed,

For question one, its seems to be yaml issue.
https://yaml.org/spec/1.2/spec.html#id2776092
Need to use double quotes…I will try this tomorrow:

  - platform: uart
    name: "POWER OFF PROJECTOR"
    data: "* 0 IR 002\r\n"

Double quotes was the issue…Now \r\n works.

Moving now to the read (rx) part after sending a message.

Any help appreciated.

With the code bellow, when I Switch On (press), the data for on state is sent, but switch goes immediately back to off (does not send off state data)

always_off_position turns_on

  - platform: template
    name: "POWER PROJECTOR"
    id: turn_projector_power
    turn_on_action: 
      uart.write: "* 0 IR 001\r\n"
    turn_off_action: 
      uart.write: "* 0 IR 002\r\n"  

Do I need to start working in “read status from UART” or is it possible to have a working switch without status?

Simple things seem the hardest.
Just want a switch to toggle on/off and write uart data for on and off.

then i would focus in binary status reading from uart

Project finished - Sucess:
Well I had to move from ESPHome to Tasmota since I was not able to get the results:

Serial config for projector and IRconfig for AV Receiver

  • Load Tasmota firmware tasmota-zbbridge.bin
  • Configure Tasmota webpage (from ip) to generic18
  • Assing gpio1 e gpio3 to serialtx and serialrx
  • To set Tasmota Serial connection to 9600, we had to enter this command in the console: baudrate 9600
  • Make a wire loop in HW from TX and RX to test its working:
  • In the console (tasmota IP webpage), write SerialSend XXXX would see a SerialReceived XXXX. Proof that sending and receiving does something.
  • I use idx3 meaning serialsend3:
    serialsend3 \r* 0 IR 001#\r (power on do acer)
    serialsend3 \r* 0 IR 002#\r (power off do acer)
  • In this case I am sending *0 IR 001 (commando to power on ACER projector)
  • Acer should respond *000 (IRReceived in console). If received 001 means Notok
    (If projector is on and you send 0 IR 001 you will receive 001. In this case means it could not comply with request cause projector was already on)
    23:22:27.624 CMD: Grp 0, Cmnd ‘SERIALSEND’, Idx 3, Len 12, Data '\r
    0 IR 001#\r’
    23:22:27.629 MQT: stat/SERIALIR/RESULT = {“SerialSend”:“Done”}
    23:22:27.799 MQT: tele/SERIALIR/RESULT = {“SerialReceived”:"\r
    001#\r"}
  • Configure mqtt in tasmota webpage ip (theres alot of info for this in the internet)
  • Try send command again using mqtt in HA:
  • Topic: cmnd/SERIALIR/serialsend3
  • Payload: \r*001#\r
  • Now lets the same command in a script – this script will be called from other automations.
  • Scripts uses the MQTT service to transmit a topic on MQTT.
  • You can edit Scripts.yaml or create it inside HA
projectoronemachinesv700:
  alias: Trun ON Projector Emachines V700
  sequence:
  - service: mqtt.publish
    data:
      topic: cmnd/SERIALIR/serialsend3
      payload: \r* 0 IR 001\r
  mode: single
  icon: mdi:video-vintage
projectoroffemachinesv700:
  alias: Trun OFF Projector Emachine V700
  sequence:
  - service: mqtt.publish
    data:
      topic: cmnd/SERIALIR/serialsend3
      payload: \r* 0 IR 002\r
  mode: single
  icon: mdi:video-vintage
  • Now lets create switch for those 2 scripts:(configuration.yaml)
switch:
  platform: template
  switches:
    projector_power:
      turn_on:
          service: script.projectoronemachinesv700
      turn_off:
          service: script.projectoroffemachinesv700

  • Now we have and switch called: switch.projector_power

!!Done

Next step, create the On and Off commands using IR to power ON and OFF one Yamaha RX-V371

Tasmota IR config
Yamaha RX-V371

  • I found some IR codes that work with my AV receiver, and seems to work with several others:

  • After connecting 2 IR leds with NPN transistor @5V with correct resistor (dont have correct values at this moment) in the same Tasmota that as RS232, and IR leds connected into GPIO4

  • Open tasmota web page and configure GPIO4 as IRsend

  • Testing IR send in tasmota console

  • Power on e off:
    Toggle:
    IRsend {“Protocol”:“NEC”,“Bits”:32,“Data”:“0x7E8154AB”,“Repeat”:0}
    Power On:
    IRsend {“Protocol”:“NEC”,“Bits”:32,“Data”:“0x7E817E81”,“Repeat”:0}
    PowerOff:
    IRsend {“Protocol”:“NEC”,“Bits”:32,“Data”:“0x7E81FE01”,“Repeat”:0}

Voilá…Amp turns on and off. makes no sense to use toggle.

  • Create a script for each command (ON and OFF)
    Service call
    mqtt_publish
    Topic: cmnd/SERIALIR/IRsend
    Payload: {“Protocol”:“NEC”,“Bits”:32,“Data”:“Choose code for ON or OFF”,“Repeat”:0}

  • Create a switch in configuration.yaml that will use the scripts

Switch: 
  platform: template
  switches:
    Power_yamaha:
      turn_on:
          service: script.power_yamaha_amplifier_on
      turn_off:
          service: script.power_yamaha_amplifier_off

Done…

I needed to group the 2 switchs into one, so I could tell Google assistant to turn on and off both at same time. So I went for the easiest approach.

  • Create a switch in configuration.yaml
      home_cinema:
        turn_on:
          - service: switch.turn_on
            entity_id: switch.projector_power
          - service: switch.turn_on
            entity_id: switch.power_yamaha
        turn_off:
          - service: switch.turn_off
            entity_id: switch.projector_power
          - service: switch.turn_off
            entity_id: switch.power_yamaha 
  • Sync devices with google home
  • Rename “home_cinema” to “home cinema” in google home app
  • So now I can turn on and off appliances with voice command:

Hey Google, Turn on Home cinema
Hey Google, Turn off Home cinema

Done!

1 Like

All of this writing will help me as a reminder in the future, and it may help others with similar project.

I just don’t understand why you used tasmota-zbbridge.bin ?

I read somewhere that zbbridge has serial protocol even if it is for zigbee.
Maybe tasmota.bin would work. Didnt test it.

Did not think about that one :slight_smile:

I was inspired by GitHub - samm-git/marantz-rc-esp32: Web based remote control for Matantz amplifier using ESP32 - rather than using IR Leds this uses a IR in port on the receiver, IR commands are emulated on the ESP. My Yamaha AV also has a jack in ir optionality, some digging around and combining some of the great work of others I now have a working prototype.

Using a wemos d1 mini and a mono jack connected to D2 and GND I am no able to control my old RX-V863 Yamaha through HA. Included below a link to my repo on Github: