I have a little sensor module that sends its values to some http service as a given time.
I use rules for that but the "code" doesn't look that nice. I would prefere to define the apikey of the http service and also the execution time at the beginning of the rules to make it easier to configure/change them.
Something like:
Code: Select all
def apikey=abc123
def sendtime=07:00
On Clock#Time=All,%sendtime% do
SendToHTTP www.pushsafer.com,80,/api?k=%apikey%&i=81&t=%sysname%%20Status&m={urlencode:"Temperature [Sensor#Temperature]°C Humidity [Sensor#Humidity]% Dew Point %c_dew_th%([Sensor#Temperature],[Sensor#Humidity])°C at time: %lcltime%"}
endon
Bye, Burb