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



jgab

Recommended Posts

Hello Jan,

 

Excellent error reporting!! This device is giving me headache!!! Yesterday I added >>error no configuration and now it disappeared??

 

Please login or register to see this image.

/monthly_2019_08/image.png.38fb24b9adbaa458a2c45b3a14d2c861.png" />

Link to comment
Share on other sites

  • Topic Author
  • 1 hour ago, jompa68 said:

    same behavior in WC

    Please login or register to see this code.

     

     

    Ok, the problem is trueFor. I have changed the execution model for ER rules but I haven't (yet) changed it for trueFor. I thought I could get away with it but it turns out that trueFor doesn't work with rules that also have 'wait' in them.

    I will spend the morning rewriting trueFor using the new model and hopefully everything will be smooth again...

    • Like 1
    Link to comment
    Share on other sites

  • Topic Author
  • Pushed v3, B26

    -new implementation of 'trueFor', now compatible with 'wait' and much cleaner. It was something I needed to do anyway but had pushed for the future...

    (the coffee example runs for me now. There was a syntax bug in the example I gave, missing a ';' in " $coffeeTimer -= 60;". Fixed in earlier post)

    Link to comment
    Share on other sites

    I had to rollback to version 2.0 yesterday evning, the light wouldent light up.

    i got this errorcode.

     

    Please login or register to see this image.

    /monthly_2019_08/image.png.4806dad12635ea7dfedbdb5de2a908d2.png" />

     

    rule 11 below

    Please login or register to see this code.

     

    Function "turnOnAllChildrenLamps" below

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 6 minutes ago, sonnyboy said:

    I had to rollback to version 2.0 yesterday evning, the light wouldent light up.

    i got this errorcode.

     

    Please login or register to see this link.

     

    rule 11 below

    Please login or register to see this code.

     

    Function "turnOnAllChildrenLamps" below

    Please login or register to see this code.

     

    _copy has changed to Util.copy

    Edited by jgab
    Link to comment
    Share on other sites

  • Topic Author
  • 3 minutes ago, sonnyboy said:

    Wow that worked :)

    Big thanks!

     

    Just pushed v3, B27.

    -new function HM(<time>), formats a time into "HH:MM"

    Ex. rule("log('Time is %s',HM(now))")

    -new function Util.randomizeList(list). Takes an table/list of elements and return a randomised version of the list

     

    @sonnyboy version of turning on lamps could thus be written

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • Here is a simple Telegram integration in ER without having to rely on Node-red.

    Go to BotFather in Telegram and create a new bot - and get a bot HTTP access key

    Please login or register to see this code.

     

    then you can make ER rules like this

    Please login or register to see this code.

    I will probably add this as a standard function in ER when I tested it a bit more.

    Edited by jgab
    Fixed support of multiple bots
    Link to comment
    Share on other sites

    @jgab

    both this coffeTimer and dishTimer rules gives now error and i cannot see why.

     

    Please login or register to see this code.

    Error

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 27 minutes ago, jompa68 said:

    @jgab

    both this coffeTimer and dishTimer rules gives now error and i cannot see why.

     

    Please login or register to see this code.

    Error

    Please login or register to see this code.

     

     

    Sorry, miss in my previous fix. Pushed v3 B28.

    Now there is both  HM() and HMS() - latter returns "HH:MM:SS"

    So you can remove the Lua version of HM.

     

    There is a variable '_MARSHALL' that if set to false will not auto convert string in fibaro globals to values. However, when one gets used to it it is quite convenient.

    Now it supports numbers, booleans and "time strings" (HH:MM[:SS])

    I was thinking to auto convert tables back and forth too - then one could do

    Please login or register to see this code.

    The criteria would be that if the string stored in the global starts with '{' or '[' it would be considered a json.table.

    Would that be a good idea? Any potential problems?

    Edited by jgab
    Link to comment
    Share on other sites

    @jgab

     can i replace physical sensors to virtual sensors from pub scene?

    Please login or register to see this code.

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 11 minutes ago, jompa68 said:

    @jgab

     can i replace physical sensors to virtual sensors from pub scene?

    Please login or register to see this code.

    Please login or register to see this code.

     

     

    No, not directly.

     

    As I understand it, you have sensors that are triggered by scene A and A then publish them as Virtual sensors?

    Then you have a scene B that subscribe to Virtual sensors and carry out actions when it receive a Virtual sensor?

     

    Because they are physical devices and  you can call fibaro:call and fibaro:get on the devices from scene B, there is an easier approach.

    In scene B:

    Please login or register to see this code.

    The #VirtualSensor event that you receive in B you re-post inside B as a #property event - this will look exactly like a fibaro trigger for the rules.

    You can then reat them like any device that have triggered B and do things like this in B:

    Please login or register to see this code.

    Was that an answer to you question?

    Link to comment
    Share on other sites

    11 minutes ago, jgab said:

    Was that an answer to you question?

    Yeah, sounds right but not working. I can see event comes in from pub scene but then nothing happens. No post (added a log to that line)

    Link to comment
    Share on other sites

  • Topic Author
  • 17 minutes ago, jompa68 said:

    Yeah, sounds right but not working. I can see event comes in from pub scene but then nothing happens. No post (added a log to that line)

    I assumed that they had deviceID and value. How do the VirtualSensor structure look like?

    Link to comment
    Share on other sites

    Hello Jan,

    My telegrams are not coming by NodeRed
    ESceneID contains:

    _myNodeRed   = "http://192.168.1.89:1880/eventrunner" -- Ex. used for Event.postRemote(_myNodeRed,{type='test'})
    local _defaultNodeRed= "http://192.168.1.89:1880/eventrunner"


      function telegram(ref,msg)
        local tmsg = Util.copy(ref)
        print (json.encode(tmsg))
        tmsg.content=msg
        Event.postRemote(_defaultNodeRed,{type='telegram',msg=tmsg})
       Event.postRemote(_myNodeRed,{type='telegram',msg=tmsg})--oud
    end

     


    rule I use to send telegram:
    $Telegram='basis huis is bewaakt'


    This will send to Nodered
    Event.postRemote(NodeRed,{type='echo', data='ESceneID'})
    Event.postRemote(NodeRed,{type='echo', data='1516'})
    How to solve?
    Please advice
     
      

    Link to comment
    Share on other sites

    13 minutes ago, jgab said:

    I assumed that they had deviceID and value. How do the VirtualSensor structure look like?

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    I think something is broken in the code, this should work.

    Please login or register to see this code.

    i see the event arrive to sub scene but nothing more

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 50 minutes ago, jompa68 said:

    I think something is broken in the code, this should work.

    Please login or register to see this code.

    i see the event arrive to sub scene but nothing more

    Please login or register to see this code.

     

     

    Yes, bug! Pushed V3, B30

    Link to comment
    Share on other sites

    @jgab in ZBS: ID:448 does not support property 'TCPPort'

    Same in HC2:

    Error loading rules:fibaro:get(Koupelnaprizemi.Vypinacuzrcadla,"TCPPort"),/opt/fibaro/scenes/228.lua:3181: ID:448 does not support property 'TCPPort'

     

    Thanks for adding.

     

    Edited by petrkl12
    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, petrkl12 said:

    @jgab in ZBS: ID:448 does not support property 'TCPPort'

    Same in HC2:

    Error loading rules:fibaro:get(Koupelnaprizemi.Vypinacuzrcadla,"TCPPort"),/opt/fibaro/scenes/228.lua:3181: ID:448 does not support property 'TCPPort'

     

    Thanks for adding.

     

     

    Will push a fix tomorrow morning

    Link to comment
    Share on other sites

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