bwssytems / ha-bridge

Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge.
Apache License 2.0
1.45k stars 198 forks source link

(SOLVED) Help with old Optoma projector #1208

Open smontys opened 4 years ago

smontys commented 4 years ago

Hi everybody. I need some help getting this to work. I have and old Optoma projector, model EX765W, with an embebed html web interface. I only one want to switch it ON and OFF. Optoma Web_PC_may -10-093021-2020_Conflict

There isn't a full url to do so, and I'm trying to setup with the right http headers and body. Using F12 developer tools, I'm getting the corresponding http calls when clicking 'Power On' and 'Power Off' buttons : there are two calls for each one, one for ON or OFF command and other for query:control command (sorry, locale is in spanish) Common headers for all the calls Headers

ON body ON body

OFF body OFF body

Second body call when ON and OFF Query control body

This is my setup ha-bridgeOptomaON

But got "spark.http.matching.GeneralError" with or without '[' ']', etc.

ha-bridge 5.3.1RC1 running on a Synology DS209 (DSM 4.2-3259)

Thanks for your help

asquelt commented 4 years ago

payload is supposed to be urlencoded and you send JSON.

smontys commented 4 years ago

payload is supposed to be urlencoded and you send JSON.

Thanks for your reply, @asquelt Do you mean that instead of {“command”:”~0000 1”} it should be {“command”=”~0000 1”}, at http body? I've changed with same result.

smontys commented 4 years ago

Making more test, seems the problem is with the http headers

[{"Accept":"*/*","Accept-Encoding":"gzip,deflate","Accept-Language":"es-ES","Cache-Control":"no-cache","Connection":"Keep-Alive","Content-Length":"13","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8","Cookie":"optomaprojctl=admin","Host":"192.168.222.21","Referer":"http://192.168.222.21/","User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"}] If I don't enter them, got no error.

asquelt commented 4 years ago

i think it should be just command=~0000 1 or command=%7e0000%201 (i'm not sure how java handles escaping)

smontys commented 4 years ago

i think it should be just command=~0000 1 or command=%7e0000%201 (i'm not sure how java handles escaping)

Wow, you hit the target!!! It works, without http header, just with http body exactly as you say, command=~0000 1

Many thanks!!!