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

the NR part of the rule does work, i get that TTS played in my speaker, error must be wait part.

Link to comment
Share on other sites

  • Topic Author
  • 3 minutes ago, jompa68 said:

    the NR part of the rule does work, i get that TTS played in my speaker, error must be wait part.

    How often? Every day?

    Link to comment
    Share on other sites

    Its Saturday so time for some new functions for my home ;)

     

    I ask alexa to turn on TV, switch inputs or change channels. Possibility is almost endless 

    Setup flow is like this

    Alexa Echo -> Node-Red -> HC2 (EventRunner) -> Node-Red


    Requirements

    Alexa, Harmony Hub, Node-Red

     

    1999634290_Skrmavbild2019-03-23kl_13_41_12.png.6c677bf47dbd7cbc212fa003482ec888.png

     

    Please login or register to see this code.

    Node-Red flow

    Please login or register to see this link.

     

    Please login or register to see this code.

    • Like 1
    Link to comment
    Share on other sites

    On 3/18/2019 at 10:41 AM, jgab said:

    I assume the rule runs every weekday between 5 and7.30. Do you get the error every day or once a week or?

    I haven't been able to replicate it with a similar rule, so let me think about a better debug statement to capture the bug next time it happens.

    During this weekend my second rule did work both days but this morning it did not work with start of Sonos radio. Error direct after TTS :-o

    Link to comment
    Share on other sites

  • Topic Author
  • 7 hours ago, jompa68 said:

    During this weekend my second rule did work both days but this morning it did not work with start of Sonos radio. Error direct after TTS :-o

    Can you run your scene in ZBS? If so, can you run _SPEEDTIME simulate a couple of days and see if you can trigger the bug?

    AT the moment I'm a bit clueless how to chase it as I haven't found any way to reproduce it. I have been going through the script instructions and none seems to be faulty. 

    Could you share the whole scene with me in a PM and I can see if I can see some other rules interfering, maybe.

    Link to comment
    Share on other sites

    Not sure if i have seen this ID:sceneID null earlier?

     

    Please login or register to see this image.

    /monthly_2019_03/1018028555_Skrmavbild2019-03-26kl_10_51_09.png.49b2ca454fb4d453a705ff418c0d80a8.png" alt="1018028555_Skrmavbild2019-03-26kl_10_51_09.png.49b2ca454fb4d453a705ff418c0d80a8.png" />

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, jompa68 said:

    Not sure if i have seen this ID:sceneID null earlier?

    It's not a problem. It's just a uninformative debug statement that tries to tell us that it was an announcement without any registered subscriptions.

    When ER scenes startup they announce the presence to each other and also add on the subscriptions they have as extra info. That is usually nil, and we get the printout in your log. I have changed it in next release.

    Link to comment
    Share on other sites

    @jgab

     

    In newest version from github and HC v.4.540 there is this error:

    HC2 returned error '404 ' - URL: 'http://192.168.1.xxx/api/devices/448/properties/port'

     

    Link to comment
    Share on other sites

  • Topic Author
  • 8 hours ago, petrkl12 said:

    @jgab

     

    In newest version from github and HC v.4.540 there is this error:

    HC2 returned error '404 ' - URL: 'http://192.168.1.xxx/api/devices/448/properties/port'

     

    Sorry, pushed a new version of HC2.lua with a proper fix.

     

    I'm keeping a bit low profile at the moment as I'm refactoring HC2.lua and adding a foundation for new features.

    • Like 1
    Link to comment
    Share on other sites

    cannot get this to work

    Please login or register to see this code.

     

    I get the event from publisher when i turnOn switch

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 16 minutes ago, jompa68 said:

    cannot get this to work

    Please login or register to see this code.

     

    I get the event from publisher when i turnOn switch

    Please login or register to see this code.

     

     

    I guess 625 is a real device with a power property? and that you subscribe to virtualSensor events from another scene?

    I general I would advice against using #events in 'for' statements. It works sometimes but I can imagine situations were it don't. In your case I guess it should work.

    You can also try this

    Please login or register to see this code.

    The first rule gets the event and re-post it as a "standard" fibaro property sourcetrigger for power events. The second rule sees this as a standard sourcetrigger so 625:power will pick it up.

    Btw, with 0 and 0.3 you don't trigger. Should it be "< 0.5" instead of "> 0.5" ?

    Link to comment
    Share on other sites

    4 minutes ago, jgab said:

    Btw, with 0 and 0.3 you don't trigger. Should it be "< 0.5" instead of "> 0.5" ?

    Ahh! ofcourse.
    Thanks for your help :D

    Link to comment
    Share on other sites

    @jgab what is the best setup of ER? I have today 1 publishing scene and many subscriber scenes, or should i re-think and do only 1 subscriber scene?

    Link to comment
    Share on other sites

    found 1thing that is not working in latest version B9 but works in B3

    Please login or register to see this code.

    last one "for" is not working

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, jompa68 said:

    found 1thing that is not working in latest version B9 but works in B3

    Please login or register to see this code.

    last one "for" is not working

    Works well for me. I haven't touched the 'for' code since B3 (only the wait code you helped me find) ... so I suspect there is something else going on

    Btw, you can simply the 'for' to directly match against '0' in the event.

    Please login or register to see this code.

    but that's not your problem in this case. You could add a log message at the start of the 'for' rule to see if it triggers?

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 12 hours ago, jompa68 said:

    @jgab what is the best setup of ER? I have today 1 publishing scene and many subscriber scenes, or should i re-think and do only 1 subscriber scene?

    It depends :-)

    In general it is better to have more subscribers than publishers. 

    What I think is important though is that the publisher should "add value" to the event. Ex. the iosLocator service I have, polls for users movement with iCloud, and keeps track of if there are someone at home or not. It can then send a more "refined" event to subscribers (someone at home or not) instead of just send out users movements. It means that the subscribers don't have to count people, just react on home or not.

    If you have a scene that monitors the power of a washing machine or other appliance, I would make the scene only publish #washingmachine{status='off'}, or #washingmachine{status='on'}, as other scenes are probably not interested in the actual power value, just if the machine is on or off.

    We know that we can't receive more than 10 (exactly) simultaneously triggers due the Fibaro's scene limitations. So if you have one subscriber and many publishers, the subscriber can reach its limit. If publishers "refine" events, there should be fewer of them. Much less on/off events vs. publishing all power changes etc. 

    Link to comment
    Share on other sites

  • Topic Author
  • I pushed a new version B10 of EventRunner.lua

    New features

    fibaro:call(id,"toggle") will toggle a light

    fibaro:call(id,"setValue",0) and fibaro:call(id,"setValue",1) works for turning off and on a switch.

     

    Sometime (that I missed) Fibaro chose to break the getValue/setValue symmetry for devices. I'm pretty sure you could do a fibaro:call(id,"setValue",0) to turn off a plug/switch in the past.

    Now if the device doesn't support "setValue" like switches that only support 'turnOff' and "turnOn", it doesn't work.

    Having the symmetry fibaro:call(id,"setValue",fibaro:getValue(id,"value")) made saving/restoring light status much more streamlined in the code... 

    Anyway, in ER fibaro:call is now patched to support setValue for switches. It means we can still do

    Please login or register to see this code.

     

    Edited by jgab
    • Like 1
    Link to comment
    Share on other sites

    I would really love to see this EventRunner in a plugin form. Then can set er_init autostart scene (with rules setup) like

    fibaro:call(<er_id>, "rule","lights={66,45,76,84}")

    And the trigger scenes:

    fibaro:call(<er_id>, "trigger", __fibaroSceneSourceTrigger)

    I guess, this way there no need polling the queue and just handle trigger events

    function er:trigger(t)
          setTimeout(function() Event.triggerHandler(t) end,5)

    end
     

    Thanks in advance

    Link to comment
    Share on other sites

    @jgab testing event_runner B14. Got this error :

     

    Program starting as '"C:\Program Files (x86)\ZeroBraneStudio\bin\lua.exe" -e "io.stdout:setvbuf('no')" "C:\Users\F\AppData\Local\Temp\.C16A.tmp"'.
    Program 'lua.exe' started in 'C:\Program Files (x86)\ZeroBraneStudio\myprograms\2B14' (pid: 21328).
    Debugging session started in 'C:\Program Files (x86)\ZeroBraneStudio\myprograms\2B14\'.
    Fri/Apr/12,12:55:55:[HC2 ] HC2 SceneRunner v0.7 fix2
    Fri/Apr/12,12:55:55:[HC2 ] Running speedtime
    Fri/Apr/12,12:55:55:[HC2 ] Local mode, will not access resources on HC2
    Fri/Apr/12,12:55:55:[HC2 ] Created Event server at 192.168.1.127:6872
    Fri/Apr/12,12:55:55:[HC2 ] Web GUI at http://192.168.1.127:6872/emu/main
    Fri/Apr/12,12:55:55:[HC2 ] Reading and decoding configuration from HC2.data
    Program completed in 1.20 seconds (pid: 21328).
    HC2.lua:687: attempt to index local 'rsrc' (a nil value)
    stack traceback:
        HC2.lua: in function 'loadConfigFromFile'
        HC2.lua:63: in function 'main'
        HC2.lua:204: in function 'startup'
        HC2.lua:3077: in main chunk
        [C]: in function 'dofile'
        BelysningER2_B14.lua:11: in main chunk
    Debugging session completed (traced 0 instructions).
     

    Could it be the structure of my HC2.data file? 

     

    [{"devicemap":"{\"toa_dusch\":{\"takdimmer\":207},\"iOS\":{\"FranksiPad\":350,\"MargarethasiPhone\":138,\"samsungSM-T700\":203,\"iPhone10,6\":89},\"scene\":{\"TwoSpottarKoek\":45,\"LarmTelegramText\":304,\"TimeOfDay\":62,\"MarkisSovrum\":211,\"DoorBirdMotion\":178,\"MarkisTVrum\":213,\"ArmAlarmScene\":...……..

     

    And if that is the case what structure would HC2.lua expect?

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