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

http output in a VD


Question

Posted

Hello,

 

I am trying to read my Smile P1 interface to my electricity- and gasmeter. If I call this URL in my browser: 

Please login or register to see this link.

I receive a response just in plain text that holds the data I need.

However, if I use this in a VD using the following code I do not see any data in the variable response, in fact the debug output does not even show this line (the one in bold). Despite the html status 200, Fibaro errorcode 0 and when I evaluate the response length it provides a number that could fit the browsers response.

 

PI1 = Net.FHttp("my_local_ipaddress");

PI1:setBasicAuthentication("smile", "my_smile_id");

 

local response, status, errorCode;

response, status, errorCode = PI1:GET("/core/domain_objects");

fibaro:debug("Response length: " .. string.len(response));

fibaro:debug("Response: " .. response);

fibaro:debug("Status: " .. status);

fibaro:debug("Errorcode: " .. errorCode);

 

Here the debug info:

[DEBUG] 13:04:35: Status: 200
[DEBUG] 13:04:35: Errorcode: 0
[DEBUG] 13:05:08: This device: 95
[DEBUG] 13:05:08: Response length: 23541
[DEBUG] 13:05:08: Status: 200
[DEBUG] 13:05:08: Errorcode: 0
[DEBUG] 13:05:41: This device: 95
[DEBUG] 13:05:41: Response length: 23541
[DEBUG] 13:05:41: Status: 200
[DEBUG] 13:05:41: Errorcode: 0
[DEBUG] 13:06:14: This device: 95
[DEBUG] 13:06:15: Response length: 23541
[DEBUG] 13:06:15: Status: 200
[DEBUG] 13:06:15: Errorcode: 0
 
 

 

I am obviously missing something so help would be much appreciated.

 

Ron

3 answers to this question

Recommended Posts

  • 0
Posted

escape response. just replace html tags. fibaro ban html output in debug windows.

it's a long story. 

  • 0
  • Inquirer
  • Posted

    @haterThanks for your response. Can you be a bit more specific or post a piece of code I can use. Thanks in advance.

    Ron

    • 0
    Posted

    Please login or register to see this code.

     

    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...