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

change globalvariable with php


Question

Posted

Hello,

 

let me first tell my idea. i want to get a push message with information about my expected travel time. i have raspberry pi with apache for my php scripts and geofency to trigger this scripts.

 

i have made a script that gets the travel time from google maps, the next thing is put it in a global variable of my HC2.

this last part doesn't work. i have the following php code:

Please login or register to see this code.

does anyone have a idea to get this code working.

2 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    I've found my problem.

    Please login or register to see this image.

    /emoticons/default_icon_redface.gif" alt=":oops:" /> i forgot a comma. in the httpheader array

    Please login or register to see this image.

    /emoticons/default_icon_confused.gif" alt=":-?" /> . this one works now:

    Please login or register to see this code.

    i'm using a rpi because multiple reasons. first i'm using geofency to trigger the php script, to access the script i need to portforward the rpi. i'm not sure if it is a good idea to portforward my HC2 to the outside world. so i'm using the rpi for safety.

    and i'm not satisfied with the stability of the HC2, i tried in the past to use Net.FHttp but after a while de vd stops working after a while. so i stopt trying.

     

    my code works perfect now. whe i leave my work, i get my travel time from work (with expected traffic). and my wife gets a push message: get the food ready in xx minutes.

    Please login or register to see this image.

    /emoticons/default_icon_razz.gif" alt=":-P" />

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    • 0
    Posted

       You can try the following (don't know if it is working:

    Please login or register to see this code.

    Question: why do you use a rpi for this and not from a scene?

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