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


Recommended Posts

Posted
2 hours ago, cag014 said:

2. I think this is preferred option.  You can represent (simulate) the data as after json.encode and use variables or keywords to update the values.

Please login or register to see this code.

The correct string should be:

    trueAct={{"&pushoverBody","setGlobal","&priority=0@title=Open&sound=pushover&message=Voordeur Open"}}}},

So no json.encode but just a string.

But then parsing error: "global variable 'priority' not found" because the string begins with &

  • Topic Author
  • Posted

    Ok, this is much easier.

    In order to use &, $, @ signs as characters add % after the character.

    Should be

    "&%priority=0@%title=Open&%sound=pushover&%message=Voordeur Open"

    Posted
    44 minutes ago, cag014 said:

    Ok, this is much easier.

    In order to use &, $, @ signs as characters add % after the character.

    Should be

    "&%priority=0@%title=Open&%sound=pushover&%message=Voordeur Open"

    trueAct={{"&pushoverBody","setGlobal","&%priority=0@%title=Open&%sound=pushover&%message=Voordeur Open"}}}},

    In this way AOS parsing is OK, but the accepting Pushover scene did not accept processing of the pushoverBody string ("priority has illegal value" ??), while in the Pushover scene I cannot see a faulty pushoverBody string.

    It looks like a mission impossible.

    Posted

    Trouble with HC-WebEye2. Till yesterday it has working excellent.

    Now I only get Cross-Origin Reuest Blocked on Firefox (extension CORS E enabled) and Edge (2 CORS extensions enabled).

  • Topic Author
  • Posted
    10 hours ago, Rover said:

    trueAct={{"&pushoverBody","setGlobal","&%priority=0@%title=Open&%sound=pushover&%message=Voordeur Open"}}}},

    In this way AOS parsing is OK, but the accepting Pushover scene did not accept processing of the pushoverBody string ("priority has illegal value" ??), while in the Pushover scene I cannot see a faulty pushoverBody string.

    It looks like a mission impossible.

    But the pushoverBody variable has the correct string, right?

    I assume the problem is in your scene. I can take a look if you will post the scene.

     

    13 minutes ago, Rover said:

    Trouble with HC-WebEye2. Till yesterday it has working excellent.

    Now I only get Cross-Origin Reuest Blocked on Firefox (extension CORS E enabled) and Edge (2 CORS extensions enabled).

    Working fine on Firefox (80.0) and Chrome.

    Please check IP address of HC2 ...

     

    Posted (edited)
    8 hours ago, cag014 said:

    But the pushoverBody variable has the correct string, right?

    I assume the problem is in your scene. I can take a look if you will post the scene.

    Yes the string in the scene looks OK.:

     

    --[[
    %% properties
    %% globals
    pushoverBody
    --]]
    --Prevents the scene from running again when the Global pushoverBody variable get's reset to 0 the end of this scene
    if (tonumber(fibaro:getGlobalValue("pushoverBody")) == 0) then
        fibaro:abort();
    end
    local selfhttp = net.HTTPClient({timeout=2000})
    local tkn = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    local usr = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
    local msg = fibaro:getGlobalValue("pushoverBody")
    print("msg= "..msg)
    local requestBody = 'token=' ..tkn ..'&user=' ..usr ..msg
    print(requestBody);
    selfhttp:request('https://api.pushover.net/1/messages.json', {
    options={
    headers = selfhttp.controlHeaders,
    data = requestBody,
    method ='POST',
    timeout =5000
    },
    success =function(status)
    local result = json.decode(status.data);
    print("status: ",status);
    if result.status ==1 then
     print("successful");
     print("Request: "..result.request);
    else
     print("failed");
     print(status.data);
    end
    end,
    error =function(error)
    print"ERROR"
    print(error)
    end})
    --Reset the global pushoverBody variable to 0,this makes sure that when the same pushover message is send again it will change the global variable and trigger this scene.
    fibaro:setGlobal("pushoverBody","0")

    8 hours ago, cag014 said:

     

    8 hours ago, Rover said:

    Trouble with HC-WebEye2. Till yesterday it has working excellent.

    Now I only get Cross-Origin Reuest Blocked on Firefox (extension CORS E enabled) and Edge (2 CORS extensions enabled).

    Working fine on Firefox (80.0) and Chrome.

    Please check IP address of HC2 ...

    Yes it was an error in the IP address of HC2! ?

    So Firefox (80.0) runs OK, but Edge still has its Cross-Origin Request Blocked for HC2 and HC3.

    Edited by Rover
    Posted

    Cag just a question about delay time in action : must the delay number be an integer?

     

    i need to send 2 pulses to fgs-223 to drive an electric gate...

    something like this:

    {0,"`igate`",{state="centralSceneSupport=1.Pressed",trueAct={{"`gate`","turnOn",""},{"`gate`","turnoff","0.2"}}}}},

  • Topic Author
  • Posted (edited)
    4 minutes ago, gggizmo said:

    Cag just a question about delay time in action : must the delay number be an integer?

     

    i need to send 2 pulses to fgs-223 to drive an electric gate...

    something like this:

    {0,"`igate`",{state="centralSceneSupport=1.Pressed",trueAct={{"`gate`","turnOn",""},{"`gate`","turnoff","0.2"}}}}},

    The time delay based on os.time() function which has resolution of seconds only.

    What is the maximum requirements for time between the pulses?

    I think I can create a command like

    "turnON,pulse2"

    which will turn ON/OFF the switch according to defined pulses number.

    Let me know which option will work best for you?

    Edited by cag014
    Posted
    2 minutes ago, cag014 said:

    The time delay based on os.time() function which has resolution of seconds only.

    What is the maximum requirements for time between the pulses?

     

    usually pulse must be 200-500ms, no mandatory interval between pulses

  • Topic Author
  • Posted (edited)
    3 minutes ago, gggizmo said:

     

    usually pulse must be 200-500ms, no mandatory interval between pulses

    Unfortunately the os.time() gives minimum one second.

    Try to use one second and see if it works.

    by the way I assume you have it in some scene... can you post how you do it?

    Edited by cag014
    Posted
    5 minutes ago, cag014 said:

    Unfortunately the os.time() gives minimum one second.

    Try to use one second and see if it works.

    ok tnx

  • Topic Author
  • Posted
    On 9/1/2020 at 4:16 PM, Rover said:


    data = requestBody,

     

    Yes it was an error in the IP address of HC2! ?

    So Firefox (80.0) runs OK, but Edge still has its Cross-Origin Request Blocked for HC2 and HC3.

    1.

    You do realize that data=requestBody is not a json array?

    Maybe you need to wrap it as a json array

    data="["..requestBody.."]"

    How it worked before using AOS?

     

    2.

    Edge has no way to unblock CORS yet. According to Microsoft it will be in the future.

     

    Posted
    6 minutes ago, gggizmo said:

    ok tnx

     

     

    Any news about the next release of aoq? Have you figured out how to drive a slave hc2/hcl?

     

  • Topic Author
  • Posted
    44 minutes ago, gggizmo said:

     

     

    Any news about the next release of aoq? Have you figured out how to drive a slave hc2/hcl?

     

    Yes, it works already for Zwave devices.

    This Monday will release the version.

    Next release will control VDs, Scenes and variables... hope sow...

    Posted
    2 minutes ago, cag014 said:

    Yes, it works already for Zwave devices.

    This Monday will release the version.

    Next release will control VDs, Scenes and variables... hope sow...

    Perfect. I have only devices on slave gateway. I create scene only on primary gateway.For now i create a block scene on hcl for irrigation.

    I noticed a better zwave range in hc3, but noticed the sometimes hc3 is " less reactive". Randomly i have some delay in light scenes, and  cpu load seems to be higher in hc3 than in hc2, more spikes.

     

    Worst part...migration: i had to soft reconfigure every single device (70) to have them recognized in alexa. And after a backup hc3 restard in recovery mode. I had to reset to defaults and restore the last backup.

    And there's not any tablet app...

    Last week end  was not easy...

     

  • Topic Author
  • Posted
    2 minutes ago, gggizmo said:

    Perfect. I have only devices on slave gateway. I create scene only on primary gateway.For now i create a block scene on hcl for irrigation.

    I noticed a better zwave range in hc3, but noticed the sometimes hc3 is " less reactive". Randomly i have some delay in light scenes, and  cpu load seems to be higher in hc3 than in hc2, more spikes.

     

    So you have primary HC2 and slave HC2?

    Device are on slave HC2?

    It should be interesting to see if AOQ can directly control slave HC2. Right now I control devices on my primary HC2.

    Posted
    2 hours ago, cag014 said:

    Unfortunately the os.time() gives minimum one second.

    Try to use one second and see if it works.

    by the way I assume you have it in some scene... can you post how you do it?

    I used to have a pulse light as signal in HC2 by means of

    fibaro:call(GIAID, "turnOff")
        fibaro:sleep(500)
        fibaro:call(GIAID, "turnOn")
        fibaro:sleep(500)
        fibaro:call(GIAID, "turnOff")

    but I saw indeed that

     trueAct={{"`GIA`","turnOff","","{`BewegingHal`:value=true}"},{"`GIA`","turnOn","0.4","{`BewegingHal`:value=true}"},{"`GIA`","turnOff","0.5","{`BewegingHal`:value=true}"}}}},

    in AOS created a "pulse" of a too long pulsetime, apparently 1 second.

    So if it is possible to have a delay time less then 1 second, I support the wish to have it.

    Posted
    2 hours ago, cag014 said:

    You do realize that data=requestBody is not a json array?

    Maybe you need to wrap it as a json array

    data="["..requestBody.."]"

    How it worked before using AOS?

    Yes, requestBody is a string.

    Before AOS:

        local prio ="0"
        local ttl ="Open"
        local msg ="Voordeur open"
        local snd ="none"
        local requestBody ='&priority='..prio ..'&title='..ttl ..'&sound='..snd ..'&message='..msg
        fibaro:setGlobal("pushoverBody", requestBody)

    which in the Pushover scene in unpacked as string and further processed:

       local msg = fibaro:getGlobalValue("pushoverBody")
       print("msg= "..msg)
       local requestBody = 'token=' ..tkn ..'&user=' ..usr ..msg
       print(requestBody);
       selfhttp:request('https://api.pushover.net/1/messages.json', {
       options={
       headers = selfhttp.controlHeaders,
       data = requestBody,
       method ='POST',
       timeout =5000

       etc.

    In AOS the Pushover scene complains with "msg is empty" ???

  • Topic Author
  • Posted (edited)

    @Rover

    May I ask you why in AOS you're using '@" character in title?

    "&%priority=0@%title=Open&%sound=pushover&%message=Voordeur Open"

    According to your scene it should be the same as for others '&"

    so in AOS it should be -

    "&%priority=0&%title=Open&%sound=pushover&%message=Voordeur Open"

    Edited by cag014
    Posted (edited)
    15 minutes ago, cag014 said:

    @Rover

    May I ask you why in AOS you're using '@" character in title?

    "&%priority=0@%title=Open&%sound=pushover&%message=Voordeur Open"

    According to your scene it should be the same as for others '&"

    so in AOS it should be -

    "&%priority=0&%title=Open&%sound=pushover&%message=Voordeur Open"

    @cag014,

    ?? Im so glad you are awake! It works from AOS!

    Edited by Rover

    Join the conversation

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

    Guest
    Reply to this topic...

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