Switch gs1 "gs1 [%s]" {http=">[ON:GET:http://admin:admin@192.168.125.101/goform/device?cmd=set&alarmout.status=1] >[OFF:GET:http://admin:admin@192.168.125.101/goform/device?cmd=set&alarmout.status=0] "}
Number gs2 "gs2 [%s]" {http="<[http://admin:admin@192.168.125.101/goform/device?cmd=get:5000:REGEX(.*?alarmout.status=.*?([0-9\\,]*).*)]"}
With the switch it is possible to turn “something” on and off.
With the number item i get 0 or 1 back.
So far so good - but is it possible to combine these two items?
Switch gs3 "gs3 [%s]" {http=">[ON:GET:http://admin:admin@192.168.125.101/goform/device?cmd=set&alarmout.status=1] >[OFF:GET:http://admin:admin@192.168.125.101/goform/device?cmd=set&alarmout.status=0] <[http://admin:admin@192.168.125.101/goform/device?cmd=get:5000:REGEX(.*?alarmout.status=.*?([0-9\\,]*).*)] "}
This can not work, because REGEX gives me 0 or 1 - is there a way to transform it to ON or OFF within the item?
Thank you…