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

  • Topic Author
  • Posted (edited)
    22 hours ago, SmartLifeSystems said:

    Hi cag! How can we use in the AOQ the winter/summer time? I have one line, but in the summer time it works it uppside down, because in summer time the timslot end time is before then the start time. In Hungary the sunset hour now 19:06.

     

    Here is the line:

     

    {0"`hallMS`",{state="value=true",timeSlot="$sunsetHour~19:00",trueAct={{"`hallLight`","turnOn","","{`hallLight`:value=false}"},{"`hallLight`","turnOff","","={`livingroomMS`:value=true|`hallLight`:value=true|`hallMS`:lastBreached>60|&HallLight:value=Automatic}"}}}},

    Yes, looks like daylight saving time causes an issue.... but you can add the number of hours to $sunsetHour. In your line I think you've added one hour so

     

    {0"`hallMS`",{state="value=true",timeSlot="$sunsetHour~?$sunsetHour+3600?",trueAct={{"`hallLight`","turnOn","","{`hallLight`:value=false}"},{"`hallLight`","turnOff","","={`livingroomMS`:value=true|`hallLight`:value=true|`hallMS`:lastBreached>60|&HallLight:value=Automatic}"}}}},

     

     

    In any case have added $timezoneOffset keyword to solve the problem for future use were the entire timeSlot could be shifted according to the time zone + DST.

    Pls pay attention that $timezoneOffset includes your standard time offset from GMT/UTC and should be part of your timeSlot definition.

    For example in Hungary the standard time zone offset is +1 hour and I believe now is +2 hours.

    So now your line should be like following:

    {0"`hallMS`",{state="value=true",timeSlot="$sunsetHour~?18:00+$timezoneOffset?",trueAct={{"`hallLight`","turnOn","","{`hallLight`:value=false}"},{"`hallLight`","turnOff","","={`livingroomMS`:value=true|`hallLight`:value=true|`hallMS`:lastBreached>60|&HallLight:value=Automatic}"}}}},

     

    Please download attached version for that

     

    Let me know if one of the solutions works for you ( should see the time after calculation on the table at debug window)

    Since the new version supports both solutions I suggest to use it..

     

    Please login or register to see this attachment.

    Edited by cag014
  • Topic Author
  • Posted
    On 3/24/2022 at 10:55 AM, Benrive said:

    Hello @cag014.

     

    I have this error, I have copied the complete code of the last AOQ main that you gave me but it keeps coming up.

    Because it can be?.

     

    Please login or register to see this link.


    It comes out after I modified the user_data but I really don't know what it is due to,

    Line 578 was commented out, it lets me continue but I imagine it will be necessary.

    The new version 12.1 should fixed the problem

  • Topic Author
  • Posted (edited)
    On 3/25/2022 at 9:45 AM, Benrive said:


    No, I have 2 HC3s, the ones that have given us so much trouble.  What I would like is to be able to see the variables in the yubii App, just as I can see a light or a sensor and know when its last state change was.

     

    This my variables.

    I explain them:

     

    Please login or register to see this link.

     

    GPSBenja,GPSMaria,GPSSofia It is a numeric variable that can have 0,1,2.

    They all work with geoaction.

     

    I have 2 locations, one for 400 meters and one for 150 meters

    value 2  less than 400 meters  ( In home )

    value 1 between 150 and 400 meters

    value 0 less than 150 ( In home ), It won't let me put less than 150 meters in fibaro location

    I don't know if putting less in AOQ with $geoRadius would work.

     

    This line for example  when state=enter 

    Please login or register to see this code.

     

     

    I don't know if it is possible from the App to change the state, for example, in case geofending fails, I can change the state since I use it as a condition for the fingerprint door opener to authorize the opening of the door.

    It only opens if GPSStatus of any of us is = 2

     

    Have wrote the QuickApp, here how it looks

    Please login or register to see this spoiler.

     

    By pressing the button of any user, global variable will be changed to value 2 accordingly.

    In QuickApp you have user, global and status tables. You can change it per your needs and pls update the QuickApp icon (currently shows question mark )

    Please redefine your local global as system's global variables and remove it from local table in AOQ. No need to change the jM lines (AOQ automatically will find them)

    To add more users update tables accordingly and create new buttons in QuickApp

     

    BUT by looking again on your explanation I am a little bit confused

    value 2 and value 1 both means "in home" ? 

    Could you please post exactly what label you want on the buttons?

    For example in my case I have defined two location 150 and 800, now

    value=0: over 800 : left home

    value=1: less then 800: approaching home'

    value=0: less then 150: at home

     

    That's how it shows in QuickApp below

     

    Please login or register to see this attachment.

    Make sure to update user's access to include the new QuickApp in Yubii app.

    Please let me know if you need any help regarding the code.

    Edited by cag014
    Guest Benrive
    Posted (edited)
    8 hours ago, cag014 said:

    BUT by looking again on your explanation I am a little bit confused

    value 2 and value 1 both means "in home" ? 

    Could you please post exactly what label you want on the buttons?

    For example in my case I have defined two location 150 and 800, now

    value=0: over 800 : left home

    value=1: less then 800: approaching home'

    value=0: less then 150: at home

     

     

    Thanks, this is what I needed. Thanks.
    But I don't understand how the variable being outside and inside is value 0?.

     

    I have changed it with your instructions and now it would be like this.

     

    enter location 800m value = 1

    Leave 800m value = 0

    enter 150m value = 2

     

    It's true?

     

    Any way to put an icon next to the label?, or a green, orange or red dot.
    A way to make it more visual

    Edited by Benrive
    Guest Benrive
    Posted

    Hello @cag014

     

    I'm trying to get the button to have 2 states, depending on the variable, but something about this is failing me.

     

    Please login or register to see this code.

     

  • Topic Author
  • Posted
    37 minutes ago, Benrive said:

    But I don't understand how the variable being outside and inside is value 0?.

     

    What do you mean by outside and inside? The Geofencing sends to values "enter" and "leave" for every location

    Please login or register to see this code.

    So when you enter range 800 it means you're approaching. When you leave 800, it means you left .

    You might need to add jM line with state="leave" and update the global to 0.

    45 minutes ago, Benrive said:

    Any way to put an icon next to the label?, or a green, orange or red dot.

    This is a button and no way to use HTML to set color or icon, but you can add label over every button and then you can set colors and icons

    Something like that (an example for one user)

    Please login or register to see this spoiler.

    Yes, the fibaro.getGlobalVariable() function returns string not a number so

                if fibaro.getGlobalVariable(jGlobal[i]=="0") then

     

     

    should work fine
     

     

    @Benrive

    Let me know if you want to use labels and I will rewrite the code.

    Guest Benrive
    Posted (edited)
    1 hour ago, cag014 said:

    So when you enter range 800 it means you're approaching. When you leave 800, it means you left .

    You might need to add jM line with state="leave" and update the global to 0.

     

    I have seen my error, and I have changed everything in this way.

    It's ok now?

     

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    1 hour ago, cag014 said:

    Let me know if you want to use labels and I will rewrite the code.

     

    Yes Please, It's amazing

    Edited by Benrive
  • Topic Author
  • Posted
    6 hours ago, Benrive said:

     

    I have seen my error, and I have changed everything in this way.

    It's ok now?

     

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    Please login or register to see this code.

     

     

    Yes Please, It's amazing

    Attached QA version with labels.

    The icons are actually emoji that you can find on the web. You have two options to set them:

    1. Just copy/paste emoji inside the string like that

    "<font color=red><font size=5><sub>?</sub></font></font> ",
    2. Use Unicode value of the emoji

     

    "<font color=red><font size=5><sub>&#127968</sub></font></font> "
     
     
    Here two links for emoji

    Please login or register to see this link.

      

    Please login or register to see this link.

      
     
     
    The font color of the user name is set by standard HTML definition 
    "<font color=orange>"
    Here a link for color names

    Please login or register to see this link.

    Please login or register to see this attachment.

    Guest Benrive
    Posted (edited)
    2 hours ago, cag014 said:

    Attached QA version with labels.

    The icons are actually emoji that you can find on the web. You have two options to set them:

    1. Just copy/paste emoji inside the string like that

    "<font color=red><font size=5><sub>?</sub></font></font> ",
    2. Use Unicode value of the emoji

     

    "<font color=red><font size=5><sub>&#127968</sub></font></font> "
     
     
    Here two links for emoji

    Please login or register to see this link.

      

    Please login or register to see this link.

      
     
     
    The font color of the user name is set by standard HTML definition 
    "<font color=orange>"
    Here a link for color names

    Please login or register to see this link.

    Please login or register to see this attachment.

    thanks, I have the Family hallucinating.  I will now add my youngest daughters.  I am enormously grateful to you

    Please login or register to see this attachment.

    Edited by Benrive
  • Topic Author
  • Posted
    40 minutes ago, Benrive said:

    thanks, I have the Family hallucinating.  I will now add my youngest daughters.  I am enormously grateful to you

    Please login or register to see this attachment.

    Looks fabulous ....

    Guest Benrive
    Posted
    Just now, cag014 said:

    Looks fabulous ....

    Not without your help and thanks to you.

    My daughters give you a round of applause ???.

     

    Tomorrow I will try to make one for the other 2 variables LockStatus and DepositoFull.
    Let's see how it goes. ?

  • Topic Author
  • Posted
    1 hour ago, Benrive said:

    Not without your help and thanks to you.

    My daughters give you a round of applause ???.

     

    Tomorrow I will try to make one for the other 2 variables LockStatus and DepositoFull.
    Let's see how it goes. ?

    Let me know if you need help with that also...

    By the way may I suggest to simplify your lines using trueActState() instead of writing same condition several times. More connivance way  when need to change location in the future.

    Please login or register to see this code.

     

     

     

    By looking on your lines I think it's a good idea to add an option to use $geoUser keyword as part of the global variable name, so then the line could be very simple like:

    Please login or register to see this code.

    Current version doesn't support that , but will make the changes in AOQ and post it for test. 

    Guest Benrive
    Posted
    16 minutes ago, cag014 said:

    Let me know if you need help with that also...

    By the way may I suggest to simplify your lines using trueActState() instead of writing same condition several times. More connivance way  when need to change location in the future.

    Please login or register to see this code.

     

     

     

    By looking on your lines I think it's a good idea to add an option to use $geoUser keyword as part of the global variable name, so then the line could be very simple like:

    Please login or register to see this code.

    Current version doesn't support that , but will make the changes in AOQ and post it for test. 

    Yes, I wanted to ask you if there was any way to simplify as many actions with the same condition.  But since I ask you so many questions, in the end if something is working I prefer to ask you what doesn't work or I don't know how to do it.  I think sometimes I can be too heavy and I don't ask you some things.  Tomorrow I will try to use Trueactstate, it will be very useful for me because I have many conditions in almost all JM lines.  I'll also make the switch to use GeoUser as part of the variable.  All these changes will come in handy to lower RAM consumption.  Thanks

  • Topic Author
  • Posted
    Just now, Benrive said:

    Yes, I wanted to ask you if there was any way to simplify as many actions with the same condition.  But since I ask you so many questions, in the end if something is working I prefer to ask you what doesn't work or I don't know how to do it.  I think sometimes I can be too heavy and I don't ask you some things.  Tomorrow I will try to use Trueactstate, it will be very useful for me because I have many conditions in almost all JM lines.  I'll also make the switch to use GeoUser as part of the variable.  All these changes will come in handy to lower RAM consumption.  Thanks

    The use of geoUser doesn't work yet... I will release that probably tomorrow.

    Guest Benrive
    Posted
    1 minute ago, cag014 said:

    The use of geoUser doesn't work yet... I will release that probably tomorrow.

    Yes I know .  I'll save that for when you get it.  No hurry .  Thanks 

    Guest Benrive
    Posted

    Another Question, 

    Is it possible to see the date and time of the last status change for each geouser in the virtual object?. In this screen?.

     

    Please login or register to see this attachment.

  • Topic Author
  • Posted
    16 minutes ago, Benrive said:

    Another Question, 

    Is it possible to see the date and time of the last status change for each geouser in the virtual object?. In this screen?.

     

    Yes, of course

    Were you want to display that? On the label next to name or on the button next to the status?

  • Topic Author
  • Posted

    Here is an example displaying the timestamp on both fields (label and button)

    Please login or register to see this spoiler.

     

    Were you prefer to see that?

     

     

    Guest Benrive
    Posted
    27 minutes ago, cag014 said:

    Here is an example displaying the timestamp on both fields (label and button)

    Please login or register to see this spoiler.

    I think it’s better in button.

  • Topic Author
  • Posted (edited)
    5 minutes ago, Benrive said:

    I think it’s better in button.

    Agree.

    Since you probably made some changes on the code, so to reduce your efforts for an update, please change marked lines in your QuickApp code

    function QuickApp:updateStatus() 
        local val,vTime=0,0
        for i=1,#jUser do 
        val,vTime=fibaro.getGlobalVariable(jGlobal[i])
        self:updateView(jLbl.id[i], "text", jLbl.icon[i]..jLbl.fColor[i]..jUser[i].."</font>")
        self:updateView(jBtn[i], "text", jStatus[tonumber(val)+1]..os.date("  (%d %b %H:%M)", vTime)) 
        end
    end
     
    No changes in other lines in the code
    Let me know if it's OK
    Edited by cag014

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