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

Thanks for the advice.

I will download the 45 version, I am now on 42 and will see what happens.

8 is a typo I saw it later and changed it.thanks

Doesn't "woonkamer.gordijnvoor:open" work?  >>>>Yes it works great! If I use this it will open 99% in the log. The same as in a lua scene that is why I tried the value=100>>>> no difference so I have let the value command in. I will change and use both so I know when I need 50%.opening how to do.

Please read for all values 99 because curtains are open and not as stated 45-87-88%

Please login or register to see this attachment.

Link to comment
Share on other sites

  • Topic Author
  • I think the value only goes to 99? Like dimmers?

    I have uploaded a new version v2.0, B46  where the setValue bug is fixed. Please use this one and not B45.

    Link to comment
    Share on other sites

  • Topic Author
  • On 5/19/2019 at 1:33 PM, Sjakie said:

    Hi jgab,

    Question about hue

     

    _homeTable   = "HomeTable" -- Name", of your HomeTable variable (fibaro global)
    _HueUserName ="3SMuZzruMd9ZedzEFZlrxEaxNHZn5qMWy465roai" -- set to Hue user name            -- Hue bridges, Ex. {{name='Hue',user=_HueUserName,ip=_HueIP}}
    _HueHubs ={{name='Hue',user=_HueUserName,ip= "192.168.1.126"}}
    _myNodeRed   = "http://192.168.1.50:1880/eventrunner" -- Ex. used for Event.postRemote(_myNodeRed,{type='test'})

    if here is a refernce to "HomeTable"why ist should be listed in each scene where "HomeTable"is used?

    can the hue data be stored in "HomeTable"?

    Thanks for your support

     

     

    The variable '_homeTable' is only there for your own convenience. It can be good to set it to the name of the fibaro  global and to use

    Please login or register to see this code.

    especially if you reference the name in many places in the code.

     

    Yes, Hue lamps can be defined in the HomeTable - but you need to use a trick.

    First you need to invent your own deviceID values for your Hue devices. Use values > 10000 so they don't conflict with real HC2 devices.

    Ex.

    Please login or register to see this code.

    Here, living, leftwindow, middlewindow, globe, bedroof, timroof, bedroom are my Hue devices and I have given them deviceIDs starting from 12000. The other devices are normal HC2 devices.

    Now you need to tell ER what Hue devices corresponds to what deviceID.

    Hue devices are identified with the name they have in the Hue app.

    So, my globe lamp has the Hue name "Globe" in the Hue app. timroof has the name "Tims roof lamp" in the Hue app.

    The way to tell ER that deviceID 12004 should correspond to the Hue device "Globe" is done with the command Hue.define()

    Please login or register to see this code.

    (Don't pay attention to the second argument, nil, as it is not used at the moment)

    After that Hue.define, if we do a fibaro:call(12004,"turnOn") it will make a call to the Hue hub and turn on the Hue device with name "Globe"

    The map between deviceID and Hue name can also be stored in the HomeTable

    Please login or register to see this code.

    Then we can do like this

    Please login or register to see this code.

    ...then you can use

    Please login or register to see this code.

    It is also possible to send Hue properties like colors etc. See 

     

     

    Link to comment
    Share on other sites

    Thanks for the explanation! Ifollowed it and I think I did it, my hue lights are working (partly)

    It gives the next error

    Please advice

    Please login or register to see this image.

    /monthly_2019_05/image.png.737b4bb0ce1d0587ff98421dc0828123.png" alt="image.png.737b4bb0ce1d0587ff98421dc0828123.png" />

     

    if I reverse the last two orders it will

    Please login or register to see this image.

    /monthly_2019_05/image.png.737b4bb0ce1d0587ff98421dc0828123.png" alt="image.png.737b4bb0ce1d0587ff98421dc0828123.png" />

    Please login or register to see this image.

    /monthly_2019_05/image.png.737b4bb0ce1d0587ff98421dc0828123.png" alt="image.png.737b4bb0ce1d0587ff98421dc0828123.png" />

    Please login or register to see this image.

    /monthly_2019_05/image.png.737b4bb0ce1d0587ff98421dc0828123.png" alt="image.png.737b4bb0ce1d0587ff98421dc0828123.png" />

    give

    Link to comment
    Share on other sites

  • Topic Author
  • 16 minutes ago, Sjakie said:

    Thanks for the explanation! Ifollowed it and I think I did it, my hue lights are working (partly)

    It gives the next error

    Please advice if I reverse the last two orders it will

    give

     

    I think you posted the same picture 3 times...

    Does it work sometimes? Does it manage to turn off/on any light ?

    So, when ER calls the Hue hubb to turn off light with Hue ID 5 it gets a "connection reset" back.

    Can you verify that you have a Hue lamp with ID 5?

    Do a Hue.dump() after you have made Hue.define()

    Please login or register to see this code.

    ...and it will list all devices that it found in the Hue hub and you will see name and numeric ID value.

     

    A bit unsure but it may help to increase the timeout value for Hue API calls.

    To do that, set _HueTimeout to a value like 10000, that is 10s, and do it in before main(), together with the other global ER variables 

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    sorry was to place other pic showing the same error when I changed the last order but it was switching more hue's off. I thought the problem was in rule("televisie  ...ID 5 is in here

    Switching Hue on is never a problem so far I know. Switching off yes also in the lua scene I used. Recently I changed to switch all hue's on if we are at home I gues after that the problem started. The time out did not solve>>> same error shall put wait(00:00:10) between switch off every group?

    We have total of 10 hue's 2x3 & 2x2

     

    Please login or register to see this image.

    /monthly_2019_05/image.png.0265f9994491b12a1f9c10acbfedfa12.png" alt="image.png.0265f9994491b12a1f9c10acbfedfa12.png" />

    Link to comment
    Share on other sites

    wait(00:00:10) in between switch off>>> no error did it 2x

    Link to comment
    Share on other sites

  • Topic Author
  • 2 minutes ago, Sjakie said:

    sorry was to place other pic showing the same error when I changed the last order but it was switching more hue's off. I thought the problem was in rule("televisie  ...ID 5 is in here

    Switching Hue on is never a problem so far I know. Switching off yes also in the lua scene I used. Recently I changed to switch all hue's on if we are at home I gues after that the problem started. The time out did not solve>>> same error shall put wait(00:00:10) between switch off every group?

    We have total of 10 hue's 2x3 & 2x2

     

    Please login or register to see this link.

     

    You could try to put a small wait between, 10s is probably a bit excessive, try a smaller value 2-4s...

    Anyway, if that is the problem, I would recommend to create a Hue group with the lights. Groups get names and IDs like normal Hue lamps, and can be registered

    with Hue.define(<Hue group name>,nil,<Hue group ID>), and then you can turn on/off groups of lights with one command (and one API call to the Hue hub).

    (You can still have individual Hue.defines for each lamp in the group).

     

    Link to comment
    Share on other sites

    Thanks.

    The 10 seconds doest bite me. The hue's will be switched off if activate my phone charger located in the bedroom.

    I am using this to group

    rule("huelinks={ woonkamer.spotbeeldlinks , woonkamer.spotschilderijlinks , woonkamer.spotkastlinks }")
         rule("huerechts={ woonkamer.spotbeeldrechts , woonkamer.spotschilderijrechts }")
            but I noticed its not working reliable or perhaps also due to the error I have had.

    Will try to change according your advice.

    Thanks again

    Link to comment
    Share on other sites

    hello jgab,
    Hue where switch on yesterday after a few corrections.

    I downloaded your NodeRed nodes from the 18th of January, can it work if I copy it and may do that?
    Modified IP numbers from ZBS, HC2, Sonos.
    in

    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.


    Please login or register to see this link.

    Please login or register to see this link.

    Please login or register to see this link.


    Please login or register to see this link.

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, Sjakie said:

    hello jgab,
    Hue where switch on yesterday after a few corrections.

    I downloaded your NodeRed nodes from the 18th of January, can it work if I copy it and may do that?

     

    Ok, great you have a node-red up and running?

    You need to deploy the latest version of my node-red flow, just to be sure I repost it here. I believe that Jan 18 is not the latest.

    Please login or register to see this attachment.

    Please login or register to see this spoiler.

     

    When you have done that. Try to make the basic work.

    Configure the HC2 node in the upper part of the flow with the credentials to your HC2 box. 

    Please login or register to see this attachment.

    The URL should be

    Please login or register to see this code.

     with the IP of your box. Then go into the "Address" node in the upper part and set the sceneID of an ER scene on your box.

    Please login or register to see this attachment.

    In my case, in the example above, I set it to sceneID 4, that is an ER scene on my HC2.

    In that ER scene on the HC2 add the rule

    Please login or register to see this code.

    Then in the node-red flow, click on the grey-blue "Test" node (or the square just to the left of the node) that will send an event to your ER scene.

    It will be of type #alexa and print out the whole event in the ER log on the  the HC2.

    If you get that up and running we can start make the other stuff work. 

    Note that the "sonosTTS" node require some setup on Amazon AWS (it's free but a bit involved).

    Edited by jgab
    Link to comment
    Share on other sites

    wow thankss,

    Yep it has send the payload.I have tried it a few days now without any positive result. Thank you very much I appreciate your time and effort.

    Btw I dont have an Alexa, will see first whats going with Sonos. Perhaps its a bigger WAF than I will not hesitate to collect one.

    Please login or register to see this image.

    /monthly_2019_05/image.png.6e29dafed276e3d79766ee40083b2ecf.png" alt="image.png.6e29dafed276e3d79766ee40083b2ecf.png" />

    image.png.fc2c3a1267c6e49730082c0e365338d7.png

    Link to comment
    Share on other sites

  • Topic Author
  • 11 hours ago, Sjakie said:

    wow thankss,

    Yep it has send the payload.I have tried it a few days now without any positive result. Thank you very much I appreciate your time and effort.

    Btw I dont have an Alexa, will see first whats going with Sonos. Perhaps its a bigger WAF than I will not hesitate to collect one.

     

    OK, great!

    The get your Sonos to speak it's the "sonospollytts" node

    Please login or register to see this attachment.

    To see that this works, you re re-wire the flow, from the "getData" to the purple "talk" node that will use the speaker of the web browser showing the node-red GUI.

    If you the run 

    Please login or register to see this code.

    it will say "Hello" in the webbrowser. _myNodeRed variable needs to have the IP and PORT of the machine that runs node-red (is it a Raspberry-Pi?) and end with "eventrunner"

    Ex.  _myNodeRed   = "http://192.168.1.50:1880/eventrunner"

     

    However, the sonospollytts is much better and speaks to you Sonos.  You can find some docs here 

    Please login or register to see this link.

    but my flow hides much of that. What you need thous is to configure the node.

    To do that you need to create account on Amazon Webservices (AWS) and get an access key and a secret key to allow you to access the service (It's free for normal home use).

    There are instructions here 

    Please login or register to see this link.

      (don't forget to write down / save the keys somewhere)

    When you have that, you use the keys to configure the sonospollytts node with the keys (under the Polly Config" option) and the IP addresses of the sonos and the node-red computer

    Please login or register to see this attachment.

     

    You can chose a voice that suits your language etc.

    To speak from the HC2 you do

    Please login or register to see this code.

    If you have a lot of speak commands in you rules you can easily define your now speak event-handler

    Please login or register to see this code.

    If you have different sonos speaker in the house you want to "speak" you duplicate the sonospollytts node with the different IP addresses of the sonos speakers.

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

    Thanks for the siupport,

    I am lost on >>>Ex.  _myNodeRed   = "http://192.168.1.50:1880/eventrunner"  where to do?

    Error in config of Polly but I can not find also on Google whre I can add API key and ID user

    Please advice

    Polly is working with Sonos  I installed a test node and I here some sound from Sonos

    Link to comment
    Share on other sites

  • Topic Author
  • 22 hours ago, Sjakie said:

    Thanks for the siupport,

    I am lost on >>>Ex.  _myNodeRed   = "http://192.168.1.50:1880/eventrunner"  where to do?

    Error in config of Polly but I can not find also on Google whre I can add API key and ID user

    Please advice

    Polly is working with Sonos  I installed a test node and I here some sound from Sonos

     

    You have to setup the address to the computer running node-red, as the HC2 box needs to send messages to that computer.

    So in ER you define

    Please login or register to see this code.

    in the beginning of the scene (same place as  _sceneName, _homeTable, _HueHubs etc). Your IP address is probably not 192.168.1.50, because that is just my own example.

     

    The sonospollytts node for node-red is designed to use AWS speech service and not Google. It is probably possible to use a flow combining google tts and a sonos control node but I'm not aware of that and haven't looked into that. The advantage with sonospollytts is that the node is actively developed and maintained by the node-red community.

    Edited by jgab
    Link to comment
    Share on other sites

    thanks,

    Noderred is on my RaspberryPi , I was confused because its also written:

     

    _sceneName   = "Demo"      -- Set to scene/script name
    _homeTable   = "HomeTable" -- Name of your HomeTable variable (fibaro global)
    _HueHubs     = {}          -- Hue bridges, Ex. {{name='Hue',user=_HueUserName,ip=_HueIP}}
    _myNodeRed   = "http://192.168.1.89:1880/eventrunner"-- Ex. used for Event.postRemote(_myNodeRed,{type='test'})

     

    Sorry that I expressed myself wrong.

    I dont mean Google assistant.

    I was searching on Google where in SonosPollytts I must give the API key. I found it should go in the config file but fro there I am lost.

    Could not find any direction in Google search to make it working.

     

    Link to comment
    Share on other sites

    Good morning jgab,

    Since I am using HomeTable I can not see in HC2 event panel witch lamp has switched on or off. I am using the same name for the same type of lamp but Event panel dont mention the room name. Is there a solution in ER?

    There is a small problem with my lights my kitchen light goes on and I cant find whre the trigger is coming from

    For the hue light I cant see nothing in event panel because its out of there range ER>>>Hue bridge.

    Is there a way I can create a report or ask an overview?

    In my old alarm system I could see :

    date   time  trigger    action

    Something similar should be great

    Thanks for your support

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, Sjakie said:

    Good morning jgab,

    Since I am using HomeTable I can not see in HC2 event panel witch lamp has switched on or off. I am using the same name for the same type of lamp but Event panel dont mention the room name. Is there a solution in ER?

    Eh, I don't  understand this. The Event panel in HC2 logs using the name you assigned the device when creating it. It has nothing to do with the HomeTable. and it shows the room in the lower left corner of the log item.

    2 hours ago, Sjakie said:

    There is a small problem with my lights my kitchen light goes on and I cant find whre the trigger is coming from

     

    If you have a rule that you don't understand how it's triggered you can turn on _debugFlags.ruleTrue

    and add a log statement to the rule. If you have

    Please login or register to see this code.

    and want to see what event caused the rule to trigger, add

    Please login or register to see this code.

    and it will print what event caused to rule to trigger.

     

    2 hours ago, Sjakie said:

    For the hue light I cant see nothing in event panel because its out of there range ER>>>Hue bridge.

     

    Hue devices are handled with API calls to the Hue hub so they don't show in the event panel. However, they do log in the Scene log window like all other fibaro calls.

     

    2 hours ago, Sjakie said:

    Is there a way I can create a report or ask an overview?

    Like a log service? There are some log scenes published in the Forum that could be used.

    It's not that difficult to make one and I'm thinking of doing one myself that is more ER based.

     

    2 hours ago, Sjakie said:

    In my old alarm system I could see :

    date   time  trigger    action

    Something similar should be great

    At the moment it is all logged in the Scene log window.

     

    2 hours ago, Sjakie said:

    Thanks for your support

     

    Link to comment
    Share on other sites

    Thanks,

    yep At the moment it is all logged in the Scene log window. If scene restart what happens very often I lost the info.

    Okay will try to find some stuff here its not that important and looking forward for your version of it.

    If ER runs and stay running I am  a happy camper.

    Thanks again

    Link to comment
    Share on other sites

    @jgab I have never used Node Red, so I have followed your instructions to @Sjakie with great interest. Got Pollysonostts, alexa and echo working in your flow that you showed earlier. But i have problems with telegram. I did send 'turn on kitchen lamp' and received:

     

    Sat/May/25,14:58:35:[20:1] Rule:1:#telegram{msg='$msg'} => cmd=msg.content; log('Telegram command:%s',cmd); 
    Sat/May/25,14:58:35:[20:1] 
    Sat/May/25,14:58:35:[20:1] Scene running
    Sat/May/25,14:58:35:[HC2 ] System trigger:{"type":"other"} to scene:20 at Sat May 25 14:58:35
    Sat/May/25,14:59:51:[20:1] Invoking:#telegram{msg='$msg'} => cmd=msg.content; log('Telegram command:%s',cmd); 
               || str=matchCommand(cmd) >> telegram(msg,str)
               || true >> telegram(msg,frm("Sorry, didn't understand '%s'",cmd))
           
    Sat/May/25,14:59:51:[20:1] [{"type":"telegram","msg":"$msg"}]>>'#telegram{msg='$msg'} => cmd=msg.content; log('Telegram command:%s',cmd); 
               || str=matchCommand(cmd) >> telegram(msg,str)
               || true >> telegram(msg,frm("Sorry, didn't understand '%s'",cmd))
           '
    Sat/May/25,14:59:51:[20:1] Telegram command:turn on
    Sat/May/25,14:59:51:[20:1] System trigger:{"type":"property","deviceID":401,"propertyName":"value"} at Sat May 25 14:59:51
    Sat/May/25,14:59:51:[20:1] fibaro:call(hjelpfunktioner.margarethas_keyfob,"turnOn")
    Sat/May/25,14:59:51:[20:1] Error in '#telegram{msg='$msg'} => cmd=msg.content; log('Telegram command:%s',cmd); 
               || str=matchCommand(cmd) >> telegram(msg,str)
               || true >> telegram(msg,frm("Sorry, didn't understand '%s'",cmd))
           ': undefined fun 'telegram'
    Program stopped (pid: 32088).
    Debugging session completed (traced 0 instructions).
    Program completed in 79.92 seconds (pid: 32088).

     

    Where does deviceID 401 come from and what is   ': undefined fun 'telegram' ? Thanks for your help.

     

     

     

     

     

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