Epson Printer Power Switch

Hi there!
My new Epson EcoTank L8180 network printer has been nicely discovered by the Internet Printing Protocol (IPP) integration but it is missing the ability to monitor power status and switch the printer on/off. I have sniffed the network traffic from Epson mobile app to the printer and found out that there are some APIs that are used by the mobile app. This allowed me to create a power switch to control the power status of the printer and switch it on/off remotely. Here are the POST requests I have discovered:
Control power:
http://<printer_ip>/remote_operation/v1/power/off http://<printer_ip>/remote_operation/v1/power/on
Get power status:
http://<printer_ip>/remote_operation/v1/power/get_status
Get device status, but when printer is idle does not show anything, probably has some data when printer is doing something:
http://<printer_ip>/remote_operation/v1/device/get_status

The following are the rest_commands I have implemented:

epson_printer_on:
  url: 'http://10.144.1.116/remote_operation/v1/power/on'
  method: POST
epson_printer_off:
  url: 'http://10.144.1.116/remote_operation/v1/power/off'
  method: POST

And binary sensor for power status:

- platform: rest
  resource: http://10.144.1.116/remote_operation/v1/power/get_status
  method: POST
  name: Epson Printer Power
  device_class: power
  scan_interval: 30
  value_template: >-
    {% if value_json.power %}
      {{ 'on' }}
    {% else %}
      {{ 'off' }}
    {% endif %}

And finally the template switch:

- platform: template
  switches:
    epson_printer:
      friendly_name: "Epson Printer"
      icon_template: mdi:printer
      value_template: "{{ states('binary_sensor.epson_printer_power') }}"
      turn_on:
        - service: rest_command.epson_printer_on
        - service: homeassistant.update_entity
          target:
            entity_id: binary_sensor.epson_printer_power
      turn_off:
        - service: rest_command.epson_printer_off
        - service: homeassistant.update_entity
          target:
            entity_id: binary_sensor.epson_printer_power

Most likely there are more APIs but the ones above were the most interesting for me. Any suggestions or info about additional APIs for Epson printers is more than welcome!

3 Likes

Some more info can be taken from printer web page, for mine the main page is:
https://10.144.1.116/PRESENTATION/HTML/TOP/INDEX.html
IPP integration already provides ink tank status but the status web page also provides waste tank level which can be scraped from the page with Scrape integration. Here is my code:

- platform: scrape
  resource: https://10.144.1.116/PRESENTATION/HTML/TOP/PRTINFO.HTML
  name: Epson Waste Tank
  select: 'img[src="../../IMAGE/Ink_Waste.PNG"]'
  attribute: height
  index: 1
  value_template: '{{ ((value | int) / 50*100)  |  int }}'
  unit_of_measurement: "%"
  verify_ssl: false
1 Like

I have Epson EcoTank ET-5150
The status page is working. There is also EPSON Integration for the waste tank.
Power On/Off unfortunately does not work for me. I checked with Postman app.

I have followed the rabbit hole and found out that this integration is actually doing a web scrapping (html parsing). Unfortunately owner of the epsonprinter package no longer publishes it on github. Also my printer model does not show the waste tank level in the way it would be parsed properly by this package anyway (I think) and it does not get grey ink level (which my printer has). Btw, I could not make this integration work, not sure why, my printer has the status page on the needed url.

Regarding the power on/off feature you would need to check what exact API is your printer using and actually if it at all allows to be turned on or off by the API. You can do it with network traffic monitor (e.g. https://www.wireshark.org/)

1 Like