iRule  Universal Remote Control

Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Getting feedback value from Domoticz

Wouter van der Post Feb 10, 2018 03:05PM EST

Hello,

I'm trying to get a feedback value from Domoticz and display it in iRule.
To turn on/off the lights I already created a network code entry with a URL suffix:
json.htm?type=command&param=switchlight&idx=5&switchcmd=On
this all works as expected.

To get the status of the device from Domoticz, this URL suffix is used:
json.htm?type=devices&rid=5

The reply from Domoticz is in JSON format (I've removed some fields for brevity):
{
"ActTime" : 1518286842,
"result" : [
{
"AddjMulti" : 1.0,
"Data" : "Off",
.....
"Description" : "",
"Favorite" : 0,
"HardwareID" : 4,
"idx" : "5"
}
],
"status" : "OK",
"title" : "Devices"
}

I've created a feedback device with these properties:
starts with: *"Data"
ends with: "
tokenized: no

Then a textual feedback item with these properties:
prefix: *"Data" : "
suffix: "*

And lastly a value item under the textual with:
target value: *

I've created a label and attached the textual to the label, however no text is shown.
Can you help me out with this?

Up 0 rated Down
iRule Support Team Feb 10, 2018 03:57PM EST Builder & App Support Support
Wouter,

You need this:

Prefix: *"Data" : "
Suffix: ",*
Target Value: *
Up 0 rated Down
Wouter van der Post Feb 10, 2018 05:41PM EST
Hello,

Thanks for the quick reply.
Unfortunately this also doesn't seem to be working.

To make sure I haven't missed anything, the only difference is the extra comma in the suffix?
Is there some way to debug iRule, do you have an emulator that runs on a PC/Mac so that you can see some more info?
Up 0 rated Down
iRule Support Team Feb 10, 2018 05:49PM EST Builder & App Support Support
The only way to debug is trial and error. And there is no emulator.
Up 0 rated Down
Wouter Feb 10, 2018 06:09PM EST
Can you look into my project/account and see if I made a mistake anywhere?
Up 0 rated Down
Wouter van der Post Feb 14, 2018 03:57PM EST
Or can I email you an export so you can have a look at it?
Up 0 rated Down
Wouter Feb 17, 2018 07:36AM EST
For anyone running into this problem, it turns out the "starts with" and "ends with" fields on the root level Feedback device have to be empty.

Only use the Prefix en Suffix fields on the Textual and fill them like support said, in my case:

Prefix: *"Data" : "
Suffix: ",*
Target Value: *

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Recent Discussions

Ajax-loader-small
customer-service@iruleathome.com
https://cdn.desk.com/
false
iruleathome
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
true
Invalid characters found
/customer/en/portal/articles/autocomplete
There was an error contacting Get Satisfaction
View All
0
discussions
replies
Questions
Ideas
Problems
Praise