Rules not working and "how to send data to 3rd party"
Posted: 06 Nov 2018, 11:45
Firstly, a new comer to this forum. The posts look really useful and I enjoy reading them.
I have a Sonoff TH16 that I've flashed with "ESP_Easy_mega-20181105_normal_ESP8266_1024.bin".
Attached is a temperature/humidity gauge "Environment - DHT11/12/22 SONOFF2301/7021" .
On the single relay I have a 2kW fan heater.
The temperature and humidity are correctly displayed in the "devices" section.
I can happy turn the heater on/off from either the tools command "GPIO,12,[0,1]" or via a web request "http://sonoff_ip_address/control?cmd=gpio,12,0"
I ideally want to be able to sent the temperature being measured by the Sonoff to my Loxone home automation system. This is my existing control for my lighting, heating, etc. The Loxone can then make decisions about what temperature the office should be and control the heater.
My initial thought was to use a rule with SendToHTTP i.e.
on OfficeTemp#Temp do
SendToHTTP userId:passwd@loxone_ip_address,80,/dev/sps/io/OfficeTemp/[OfficeTemp#Temp]
SendToHTTP laptop_ip_address,8001,/control?cmd=7dt,[OfficeTemp#Temp]
endon
where userId, passwd, loxone_ip_address and laptop_ip_address would be the actual account, password and ip address of my Loxone box. OfficeTemp is the name I've given to the output of the gauge in the devices section . I've checked in the log and can see I must be going something correct as I see this
60325492: DHT : Temperature: 26.70
60325492: DHT : Humidity: 49.00
60325495: EVENT: OfficeTemp#Temp=26.70
60325516: ACT : SendToHTTP xxx:yyy@zzz,80,/dev/sps/io/OfficeTemp/26.7
60325533: ACT : SendToHTTP vvvv,8001,/control?cmd=7dt,26.7
60325553: EVENT: OfficeTemp#Humidity=49.00
Where xxx, yyy,zzz and vvvv are all correct. and the number is the current temperature being displayed on my devices. My problem is I can not tell what is actually being sent to my Loxone box. If I use "Postman" and "post" a command like this
http://userId:passwd@loxone_ip_address/dev/sps/io/OfficeTemp/23
My Loxone box does indeed show 23 in the OfficeTemp. However, this SendToHTTP is not having the same affect and no value is being received.
I added the second SendToHTTP call to my laptop so I could see what was coming in via wireshark. There doesn't appear to be a http request in here at all (filtered to only show ip from sonoff_ip_address.
So, to have a temporary solution to this I'd thought I could use a rule to turn the heater on and off when some hard-coded limits were reached.
So, another rule
on [OfficeTemp#Temp] < 18.0 do
GPIO,12,1
endon
and a 3rd rule
on [OfficeTemp#Temp] > 20.0 do
GPIO,12,0
endon
These rules do not appear to trigger at all no matter how hot or cold it gets.
I'm sure this is newbie stupidity but I can't see it.
I have a Sonoff TH16 that I've flashed with "ESP_Easy_mega-20181105_normal_ESP8266_1024.bin".
Attached is a temperature/humidity gauge "Environment - DHT11/12/22 SONOFF2301/7021" .
On the single relay I have a 2kW fan heater.
The temperature and humidity are correctly displayed in the "devices" section.
I can happy turn the heater on/off from either the tools command "GPIO,12,[0,1]" or via a web request "http://sonoff_ip_address/control?cmd=gpio,12,0"
I ideally want to be able to sent the temperature being measured by the Sonoff to my Loxone home automation system. This is my existing control for my lighting, heating, etc. The Loxone can then make decisions about what temperature the office should be and control the heater.
My initial thought was to use a rule with SendToHTTP i.e.
on OfficeTemp#Temp do
SendToHTTP userId:passwd@loxone_ip_address,80,/dev/sps/io/OfficeTemp/[OfficeTemp#Temp]
SendToHTTP laptop_ip_address,8001,/control?cmd=7dt,[OfficeTemp#Temp]
endon
where userId, passwd, loxone_ip_address and laptop_ip_address would be the actual account, password and ip address of my Loxone box. OfficeTemp is the name I've given to the output of the gauge in the devices section . I've checked in the log and can see I must be going something correct as I see this
60325492: DHT : Temperature: 26.70
60325492: DHT : Humidity: 49.00
60325495: EVENT: OfficeTemp#Temp=26.70
60325516: ACT : SendToHTTP xxx:yyy@zzz,80,/dev/sps/io/OfficeTemp/26.7
60325533: ACT : SendToHTTP vvvv,8001,/control?cmd=7dt,26.7
60325553: EVENT: OfficeTemp#Humidity=49.00
Where xxx, yyy,zzz and vvvv are all correct. and the number is the current temperature being displayed on my devices. My problem is I can not tell what is actually being sent to my Loxone box. If I use "Postman" and "post" a command like this
http://userId:passwd@loxone_ip_address/dev/sps/io/OfficeTemp/23
My Loxone box does indeed show 23 in the OfficeTemp. However, this SendToHTTP is not having the same affect and no value is being received.
I added the second SendToHTTP call to my laptop so I could see what was coming in via wireshark. There doesn't appear to be a http request in here at all (filtered to only show ip from sonoff_ip_address.
So, to have a temporary solution to this I'd thought I could use a rule to turn the heater on and off when some hard-coded limits were reached.
So, another rule
on [OfficeTemp#Temp] < 18.0 do
GPIO,12,1
endon
and a 3rd rule
on [OfficeTemp#Temp] > 20.0 do
GPIO,12,0
endon
These rules do not appear to trigger at all no matter how hot or cold it gets.
I'm sure this is newbie stupidity but I can't see it.