Change status on switch from ESPEasy

Moderator: leecollings

Post Reply
ulfh2018
Posts: 65
Joined: Sunday 11 November 2018 9:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Oslo
Contact:

Change status on switch from ESPEasy

Post by ulfh2018 »

I have seen this question adressed before, and they say there is a solution but as far as I can see, it does not work. I have a virtual switch and I want to change the status from ESP Easy. I am using the commands
SendToHTTP x.x.x.x,8080,/json.htm?type=command&param=udevice&idx=10&nvalue=1
and
SendToHTTP x.x.x.x,8080,/json.htm?type=command&param=udevice&idx=10&nvalue=0

Both commands turns the switch off, so how can I turn it on?

Have tried with svalue On / Off - same problem

Best regards

Ulf
kimot
Posts: 113
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: Change status on switch from ESPEasy

Post by kimot »

And where did you find this command format again?

It should be:

SendToHTTP x.x.x.x,8080,/json.htm?type=command&param=switchlight&idx=26&switchcmd=On

It 100% works.

Always read Domoticz JSON/API documentation :

https://www.domoticz.com/wiki/Domoticz_ ... Fswitch_on
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
ulfh2018
Posts: 65
Joined: Sunday 11 November 2018 9:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Oslo
Contact:

Re: Change status on switch from ESPEasy

Post by ulfh2018 »

Thank you. Tried this before, and it did not work, but I have tested again manually, and it works, so there must be something wrong with the logic in my rules. I'll check it out tomorrow.

BTW the other syntax I found using google.
wvries
Posts: 31
Joined: Sunday 05 March 2017 11:49
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Lo Santiago, Murcia, Spain
Contact:

Re: Change status on switch from ESPEasy

Post by wvries »

Curious: why do you not use the Device tab in the web interface of ESPEASY and enter the IDX etc in there ?
I am working with about 15 different ESP's with different setups and all running ESPEasy.... using tis method to update switches.
kimot
Posts: 113
Joined: Saturday 25 November 2017 17:18
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Czech Rep.
Contact:

Re: Change status on switch from ESPEasy

Post by kimot »

Curious too:
How you change switch status in Domoticz from rules using device tab?
For example indicating that temperature is below certain level or heater is heating?
RPi2 Domoticz v 4.10717
10 x Sonoff Basic - ESPeasy
1 x Wemos D1 - ESPeasy
1 x Shelly Plus Plug S
1 x Sonoff S26 - ESPeasy
1 x Shelly 1
1 x MySensors HC-SR04
1 x MySenosrs wifi gateway
1 x RFLink
4x Cam IPC-T240H
ulfh2018
Posts: 65
Joined: Sunday 11 November 2018 9:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Oslo
Contact:

Re: Change status on switch from ESPEasy

Post by ulfh2018 »

I have changed the whole project, and I'm now using Telldus sensors and RFXtrx433XL. Had a problem with wireless connections and stability at some of the rooms, but RF at 433 MHz is working perfec. I also changed and control everything from using the IDX.

When I used rules, it would look like this:

on BadNede do
TaskValueSet 2,1,%eventvalue%
if [Variables#Soverom1]>32
TaskValueSet,2,1,32
endif
timerSet,1,5
if [%eventvalue%] <= [Floor#Bad-Nede]
TaskValueSet 5,1,1
gpio 16,1
SendToHTTP 10.0.0.89,8080,/json.htm?type=command&param=switchlight&idx=10&switchcmd=On
endif
if [%eventvalue%] > [Floor#Bad-Nede]
TaskValueSet 5,1,0
gpio 16,0
SendToHTTP 10.0.0.89,8080,/json.htm?type=command&param=switchlight&idx=10&switchcmd=Off
endif
endon
on Soverom1 do
TaskValueSet 2,3,%eventvalue%
if [Variables#Soverom1]>32
TaskValueSet,2,3,32 // Verdi til Soverom1
endif
TaskValueSet 2,4,([Variables#Soverom1]-[Room#Soverom-1])
timerSet,1,5
if [%eventvalue%] <= [Room#Soverom1]
TaskValueSet 1,1,1
gpio 16,1
SendToHTTP 10.0.0.89,8080,/json.htm?type=command&param=switchlight&idx=11&switchcmd=On
endif
timerSet,1,5
if [%eventvalue%] > [Room#Soverom1]
TaskValueSet 1,1,0
gpio 16,0
SendToHTTP 10.0.0.89,8080,/json.htm?type=command&param=switchlight&idx=11&switchcmd=Off
endif
endon
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest