Ezlo Secure automation with ESP Easy (status update from button push)

I am trying to get my SonOff devices to report their status back to my virtual devices that I use to control them on my Ezlo Secure hub when the physical button is pushed. I had this working on my old Vera Secure but since the upgrade I cannot get the devices to push the status update to the new hub. Below is how I am trying to configure my rule. If you guys have any ideas I am open to suggestions.

on Relay#Switch do
if [Relay#Switch]=0
gpio,13,1
else
gpio,13,0
endif
endon

on Button#Switch do
if [Relay#Switch]=0
gpio,13,1
gpio,12,1
SendToHTTP 192.168.1.3,17000,/v1/method/hub.item.value.set?_id=610971e793ac1d140ba40fb2&value_bool=true
else
gpio,13,0
gpio,12,0
SendToHTTP 192.168.1.3,17000,/v1/method/hub.item.value.set?_id=610971e793ac1d140ba40fb2&value_bool=false
endif
endon

Hello @rlargent,
This code is written for the SonOff hub, correct?
I’m curious to know why you have commas instead of colons after the IP address and the port. I mean something like this:
SendToHTTP 192.168.1.3:17000/v1/method/hub.item.value.set?_id=610971e793ac1d140ba40fb2&value_bool=true
Have you tried this request by itself? Does it work as expected?

It is for the rules on a SonOff basic flashed with ESPEasy. I may have left out the ESPEasy part. :slight_smile:
I tried to use the syntax suggested on the command reference page for that firmware.
https://www.letscontrolit.com/wiki/index.php/ESPEasy_Command_Reference

I guess I am just hopeful that someone else has either already done this or they are up to the challenge of figuring it out. I already have a virtual device on my Ezlo hub sending commands to turn the device on/off with a scene but haven’t figured out how to push the status from the device back to the Ezlo hub.

You didn’t answer the question.

Do these commands work when just entered in to a Web browser and change the status of your virtual device on the Ezlo hub?

https://192.168.1.3:17000/v1/method/hub.item.value.set?_id=610971e793ac1d140ba40fb2&value_bool=true
https://192.168.1.3:17000/v1/method/hub.item.value.set?_id=610971e793ac1d140ba40fb2&value_bool=false

They work perfectly from a browser.
This is how I am controlling the lights via scenes and virtual devices.
I am working now to get the ESPEasy flashed Sonoff to send this command back to the Ezlo hub when the physical button is pushed. As #Oscar.Morales pointed out it is weird that the syntax in the command reference requires a comma between the IP and port number. I’ve tried it both ways from the rules section on the Sonoff without luck.

Not sure then, I’ve never seen a comma after an IP address and before a port number its always a colon.

You might be better asking on the Sonoff forums as your Ezlo Api HTTP commands are working as you said in a browser.

I found the issue! It wasn’t with my command syntax at all…
It appears that in the device’s config I had to change the protocol from “Generic HTTP” to “Domoticz HTTP”.
All is working now. Thanks for the assist.

2 Likes

Great glad you got it figured out !

Best Home Automation shopping experience. Shop at getvera!

© 2021 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules