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

    So, my first attempt was wrong. I've edited the previous post and are pretty sure it works now.

    Unfortunately we need 2 extra rules for the 'daiken flag' to keep track of if the value is within the interval...

    I have a feeling that it could be coded smarter....

    Posted

    Jan, for a long time I wanted to ask about the implementation of two-way communication with telegrams. So that we can not only send various messages about the status of our house, but also be able to make requests, for example, about temperatures, statuses of various sensors, etc... in home assistant it is quite well implemented... there are some ideas on how to do it here ?

  • Topic Author
  • Posted (edited)

    Yes, it's possible.

    Create a Telegram Bot. You will get a bot ID.

    Install 

    Please login or register to see this attachment.

    and set the BOT_ID quickAppVariable

     

    In ER inside main() you add something like the below. The TG_SUBS are a list of "topics" you want.

    If you send a message to the bot with 
    /light hall on
    the 'light' is the topic.

    If you don't have a '/' the topic will be ""

    Please login or register to see this code.

     

    These are rules that allow you to do

    /light hall off

    /light hall on

    /light bed on

    /light bed off

    /light ?

    The last commands return "hall bed"

     

    and you get a response telling you if it was successful.

    Edited by jgab
    • Like 1
    Posted
    29 minutes ago, jgab said:

    Yes, it's possible.

    Create a Telegram Bot. You will get a bot ID.

    Install 

    Please login or register to see this attachment.

    and set the BOT_ID quickAppVariable

     

    In ER inside main() you add something like the below. The TG_SUBS are a list of "topics" you want.

    If you send a message to the bot with 
    /light hall on
    the 'light' is the topic.

    If you don't have a '/' the topic will be ""

    Please login or register to see this code.

     

    These are rules that allow you to do

    /light hall off

    /light hall on

    /light bed on

    /light bed off

     

    and you get a response telling you if it was successful.

    you wrote: Create a Telegram Bot. You will get a bot ID. 

    bot ID - maybe you meant a token?

     

    Posted

    well...somehow I managed to turn on the light...but I can't turn it off...there are a lot of errors in the bau logs...and in general, I didn't really want to send commands, but to have nice buttons...how to implement it correctly?

     

    Please login or register to see this attachment.

    Posted
    On 3/4/2023 at 6:41 PM, jgab said:

     

    You could do

    Please login or register to see this code.

    The 'once' part will only be true when you cross 75 but it will not send a message unless value >= 80

     

     

    You want the combined above rule? The below could work... We only get a message when one of them goes over 80.

    Please login or register to see this code.

     

    There are 2 different ways for the push message depending on what id you have. See

     

    Thanks - I've put those in, will give it a test run over the next few days (it's very dry currently, but never stays that way for very long!)

    Posted

    @jgab Is there a simpler way?it's for 

    Please login or register to see this link.

    Please login or register to see this code.

     

    Posted (edited)

    d

    Edited by lux
    Posted

    Hello Jan,

    If I properly understod in arming scene

    partition 0 is whole house

    if I do

    Please login or register to see this code.

    The debug shows nicely all partions with their devices.

    Partion 0 ONLY shows devices listed in Partition 1

    Posted

    Hello All

    from time to time i've got an error from one of my rules :

    Please login or register to see this code.

    the data are passes from node-red 

    Please login or register to see this attachment.

     

    Are the data passed incorrectly , how to prevent it ? thnx for any advice.

    Posted
    13 hours ago, domin12 said:

    Hello All

    from time to time i've got an error from one of my rules :

    Please login or register to see this code.

    the data are passes from node-red 

    Please login or register to see this attachment.

     

    Are the data passed incorrectly , how to prevent it ? thnx for any advice.

     

     

    After HA connection, it is easier to make quick app on HC3

    Please login or register to see this attachment.

    Posted

    Jan, tell me how to use emoji in telegrams or push messages?

    Posted

    About emoticons... the essence of the previous question is not how to send, but why they are decoded by the system, and in other cases they are sent as just text...
    here on the screenshots I used the watch emoticon, which in UTF-8 has the corresponding code \xE2\x8C\x9A
    In my 1st report, it decoded fine, and the other 2 came just as text...

     

    Please login or register to see this image.

    /monthly_2023_03/image.png.214ee69d84afae0fb0fb1cb480f4570e.png" />

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

     

     

    Posted

    i found the problem...
    the whole problem is [[ here these square brackets]]
    if the rule is described through "", then everything is ok

    Please login or register to see this image.

    /monthly_2023_03/image.png.88dda40c4cee1b542e9cb3839bc9e88d.png" />

    Please login or register to see this attachment.

    Posted (edited)
    11 godzin temu, minsad79 napisał:

     

     

    After HA connection, it is easier to make quick app on HC3

    Please login or register to see this attachment.

    Node red is working fine , just from time to time have this error,it doesn't do anything, the role continuously running

    Please login or register to see this image.

    /monthly_2023_03/image.png.16ac597696a04f4c2b9115e3ac768d03.png" />

    Edited by domin12
    Posted

    Jan,

    r is listed in Global Variable

    Please login or register to see this code.

    Getting error

    Please login or register to see this code.

    Please advice

    Posted
    20 hours ago, fastvd said:

    i found the problem...
    the whole problem is [[ here these square brackets]]
    if the rule is described through "", then everything is ok

    Please login or register to see this link.

    Please login or register to see this attachment.

    Jan, any ideas how to fix this problem?

  • Topic Author
  • Posted (edited)

    \xE2\x8C\x9A are codes that a "..." string replaces with the byte values.

    That substitution doesn't happen in [[....]] strings

    Try
     

    Please login or register to see this code.

     

     

    Edited by jgab
  • Topic Author
  • Posted (edited)
    18 hours ago, Sjakie said:

    Jan,

    r is listed in Global Variable

    Please login or register to see this code.

    Getting error

    Please login or register to see this code.

    Please advice

     

    Well, it's kind of a bug. You can't have #trueFor{rule=r,start=true} with r being the rule because the rule data structure is self-referring so when the rule is copied by the compiler it copy infinitely - which causes the stack overflow.
    I should add a rule index that you could match against - maybe next version. For now you can do

    Please login or register to see this code.

     

    Edited by jgab
    Posted

    Jan, awesome rule! Working nicely.

    Thanks

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