Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Grep HTTP request


MarcoTorino71

Question

Hi All,

 

I don't know if it is possibile.

 

I have Foscam webcams.

 

I would like to create a scene that checks a certain value within the HTTP call.

 

This is the result of the HTTP call:

 

 

<CGI_Result>

    <result>0</result>

    <isEnable>1</isEnable>

    <linkage>8</linkage>

    <snapInterval>2</snapInterval>

    <sensitivity>2</sensitivity>

    <triggerInterval>5</triggerInterval>

    <isMovAlarmEnable>1</isMovAlarmEnable>

    <isPirAlarmEnable>0</isPirAlarmEnable>

    <schedule0>281474976710655</schedule0>

    <schedule1>281474976710655</schedule1>

    <schedule2>281474976710655</schedule2>

    <schedule3>281474976710655</schedule3>

    <schedule4>281474976710655</schedule4>

    <schedule5>281474976710655</schedule5>

    <schedule6>281474976710655</schedule6>

    <area0>1023</area0>

    <area1>1023</area1>

    <area2>1023</area2>

    <area3>1023</area3>

    <area4>1023</area4>

    <area5>1023</area5>

    <area6>1023</area6>

    <area7>1023</area7>

    <area8>1023</area8>

    <area9>1023</area9>

</CGI_Result>

 

I would like to extract the "isEnable" value so that I can then put it in an IF statement that I then modify the variables and change the icon.

Is there any way to do it?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
2 hours ago, MarcoTorino71 said:

Hi All,

 

I don't know if it is possibile.

 

I have Foscam webcams.

 

I would like to create a scene that checks a certain value within the HTTP call.

 

This is the result of the HTTP call:

 

 

<CGI_Result>

    <result>0</result>

    <isEnable>1</isEnable>

    <linkage>8</linkage>

    <snapInterval>2</snapInterval>

    <sensitivity>2</sensitivity>

    <triggerInterval>5</triggerInterval>

    <isMovAlarmEnable>1</isMovAlarmEnable>

    <isPirAlarmEnable>0</isPirAlarmEnable>

    <schedule0>281474976710655</schedule0>

    <schedule1>281474976710655</schedule1>

    <schedule2>281474976710655</schedule2>

    <schedule3>281474976710655</schedule3>

    <schedule4>281474976710655</schedule4>

    <schedule5>281474976710655</schedule5>

    <schedule6>281474976710655</schedule6>

    <area0>1023</area0>

    <area1>1023</area1>

    <area2>1023</area2>

    <area3>1023</area3>

    <area4>1023</area4>

    <area5>1023</area5>

    <area6>1023</area6>

    <area7>1023</area7>

    <area8>1023</area8>

    <area9>1023</area9>

</CGI_Result>

 

I would like to extract the "isEnable" value so that I can then put it in an IF statement that I then modify the variables and change the icon.

Is there any way to do it?

 

Please login or register to see this code.

 

There was also a discussion here how to parse HTML 

 

Edited by jgab
Link to comment
Share on other sites

  • 0
33 minutes ago, MarcoTorino71 said:

OK. thanks!

If you know it's only going to be a number between <isEnable> and </isEnable> you can change the grep pattern to

Please login or register to see this code.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...