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)
    10 hours ago, ChristianSogaard said:

    Hi Jan

     

    The whole MQTT receiver works fine

    Please login or register to see this code.

     

    The Child is created successful with

    Please login or register to see this code.

     

    But the Child dosent get updated., - The POST is there in the logs but this rule never triggers.

     

    Please login or register to see this code.

    [24.01.2024] [22:09:59] [DEBUG] [QUICKAPP2136]: message: {"qos":0,"topic":"\/watermeter\/mydatajson","retain":false,"payload":"{\"currentValue\":1029.261,\"monthStartValue\":2701306.683,\"WaterTemp\": 4,\"RoomTemp\":231,\"Dry\":\"false\",\"Reverse\":\"false\",\"Leak\":\"false\",\"Burst\":\"false\"}","dup":false}
    [24.01.2024] [22:09:59] [TRACE] [QUICKAPP2136]: Posting #watermeter{dup=false,payload="{"currentValue":1029.261,"monthStartValue":2701306.683,"WaterTemp": 4,"RoomTemp":231,"Dry":"false","Reverse":"false","Leak":"false","Burst":"false"}",qos=0,retain=false,topic="/watermeter/mydatajson"} at Wed Jan 24 22:09:59 2024

     

    This triggers but value is NIL

    Please login or register to see this code.

    This dosent triggers

    Please login or register to see this code.

     

     

    Yes, because the data was in the payload.

    Try this

    Please login or register to see this code.

     

    Edited by jgab
    Posted
    19 minutes ago, jgab said:

     

    Yes, because the data was in the payload.

    Try this

    Please login or register to see this code.

     

    Please login or register to see this code.

     

    I dont see the POST now 

    Please login or register to see this code.

     

     

  • Topic Author
  • Posted

    So my posts always seems to have bugs, for you to find :-)

    Well, fibaro.post most have an argument, the data we should post

    Please login or register to see this code.

    fixed in the previous post

    Posted
    7 minutes ago, jgab said:

    So my posts always seems to have bugs, for you to find :-)

    Well, fibaro.post most have an argument, the data we should post

    Please login or register to see this code.

    fixed in the previous post

    Yes - the POST looks better, but the original issue are still there


    This triggers but value is NIL

    rule("#watermeter => Multical21_ID:value=value")


    This dosent triggers

    rule("#watermeter{currentValue='value'} => Multical21_ID:value=value")

  • Topic Author
  • Posted
    14 minutes ago, ChristianSogaard said:

    Yes - the POST looks better, but the original issue are still there


    This triggers but value is NIL

    rule("#watermeter => Multical21_ID:value=value")


    This dosent triggers

    rule("#watermeter{currentValue='value'} => Multical21_ID:value=value")

    what does it log if you do

    rule("#watermeter => log('Event: %s',env.event)")

    Posted
    6 minutes ago, jgab said:

    what does it log if you do

    rule("#watermeter => log('Event: %s',env.event)")

    Please login or register to see this code.

     

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

    Please login or register to see this code.

     

    My bad, we want to use

    Please login or register to see this code.

    Without $ it only matches if currrentValue is the string 'value'. We want it to bind the value of the match to the ER variable 'value' and thus we use the pattern '$value'

    Edited by jgab
    • Thanks 1
    Posted
    3 minutes ago, jgab said:

    My bad, we want to use

    Please login or register to see this code.

    Without $ it only matches if currrentValue is the string 'value'. We want it to bind the value of the match to the ER variable 'value' and thus we use the pattern '$value'

     

    Now i think we are at the last error on this Class does not have setValue function defined - action ignored

    I also tried the => Multical21_ID:prop=value - but that creates another error

    Please login or register to see this code.

     

  • Topic Author
  • Posted (edited)

    :prop needs the name of the property and the value, try

    Multical21_ID:prop={'value',value}

    Edited by jgab
    Posted
    5 minutes ago, jgab said:

    :prop needs the name and the value, try

    Multical21_ID:prop={'value',value}

    Thank you Jan for you assistance - its working

    Please login or register to see this image.

    /monthly_2024_01/image.png.bafd1a70c40f72236d6f9cbdffe6272b.png" />

    • Like 1
    Posted
    On 1/25/2024 at 9:33 AM, jgab said:

    My bad, we want to use

    Please login or register to see this code.

    Without $ it only matches if currrentValue is the string 'value'. We want it to bind the value of the match to the ER variable 'value' and thus we use the pattern '$value'

    Hi Jan

     

    Can i use the same section code to post value from my GAS Sensor to MQTT - like { "volume":value} to same MQTT but to hjem/gasmaaler
    i see you added the client:publish(....) but that would then be to /watermeter/ - sould i just create one more function handleConnect(event) ?

     

    Please login or register to see this code.

     

  • Topic Author
  • Posted

     from my GAS Sensor to MQTT...? Didn't your GAS Sensor come from MQTT? or is GAS Sensor a zwave device?

    Posted (edited)
    8 minutes ago, jgab said:

     from my GAS Sensor to MQTT...? Didn't your GAS Sensor come from MQTT? or is GAS Sensor a zwave device?

    Yes - My GAS sensor is a Zwave device - you can check the

    Please login or register to see this link.

    you need inspitation. ;-)

    My Water Sensor i this project 

    Please login or register to see this link.

     - this is send to the MQTT direct from ESP32

     

    Edited by ChristianSogaard
    Typo
  • Topic Author
  • Posted

    You don't need to create any new handleConnect - I guess just publish it under the topic 'hjem/gasmaaler' ?

    like

    Please login or register to see this code.

    ...maybe?

    • Thanks 1
    Posted (edited)

    Please login or register to see this code.

     

    Please login or register to see this spoiler.

    Im Getting 

    [27.01.2024] [08:26:03] [ERROR] [QUICKAPP2136]: QuickApp crashed
    [27.01.2024] [08:26:03] [ERROR] [QUICKAPP2136]: main.lua:151: '}' expected near ':'  (

     

    Line 151 is var.ConfigGasSensor = ...

     

    i have counted the pairs of } , and it seems right . Should it be defined another way - and if yes - why?

    Edited by ChristianSogaard
  • Topic Author
  • Posted (edited)

    When you declare var.ConfigGasSensor = ... you are in Lua land, and you need to declare it as a string or a Lua table.

    I recommend Lua table as you get some syntax check from Lua when you do that (what's in a string it doesn't care about)

    You tried to declare a json table which Lua doesn't understand {"key":"value"} ...

    Please login or register to see this code.

    However publish wants it's value as a json encoded string so we call json.encode on it

    Please login or register to see this code.

    Edited by jgab
    • Thanks 1
    Posted

    @jgab

    Jan, is there a way to set hetaing zone setpoint and zone mode to manual?

    I am not talkoing about the regular thermostat but the Zone thermostat

  • Topic Author
  • Posted
    1 hour ago, Neo Andersson said:

    @jgab

    Jan, is there a way to set hetaing zone setpoint and zone mode to manual?

    I am not talkoing about the regular thermostat but the Zone thermostat

    These functions are available in ER5

    Please login or register to see this code.

     

    ...also part of the fibaroExtra library...

    • Thanks 1
    Posted

    Hi again

     

    I'm trying to set up some rules to synchronise state between devices. For context, these devices are roller blinds that are not directly connected to the Fibaro, they are Somfy so they are directly controlled by a Somfy bridge, which is linked to the HC3 via a Skaro Automation Bridge. Basically every device is a QA and the functions like "up", "down" etc are mapped to API calls against the Automation Bridge (which then somehow sends them over the Somfy cloud API in a way that is not transparent to me). 

     

    In a room I have 7 blinds in total, and each of them have individual devices. When called as a group (e.g. {blind1, blind2}:up) the Somfy bridge will loop through them and send the commands with some delay between each blind. This is OK most of the time except when you are trying to precisely position them using timing. However, it's also possible to group blinds at the radio level by associating a group of blinds with one channel on the bridge (similar to how groups work on a standard Somfy multichannel remote) - in this case it's not that the remote or bridge knows anything about a group, it simply sends out a frame with a command and a channel number and controllers in radio range that are programmed to respond to that channel number will execute the command. This method always achieves near-perfect sync between multiple blinds.

     

    So in my case I have both the individual devices, and a group device which is exported by the bridge (the bridge doesn't know the difference - for it, that group is just another blind). 

     

    (Aside: you can also create groups on the Somfy bridge but those still have the laggy loop behaviour so aren't helpful or relevant here). 

     

    What I want to do is synchronise the status between the grouped device and individual device, so for example if all blinds are open, and I "close" the group device, the 3 individual devices in the group have their status changed to "closed" without sending another "close" command to them. 

     

    I've tried

     

    Please login or register to see this code.

    This generates a runtime error:

     

    Please login or register to see this code.

     

    I have also tried using setValue(0) instead of updateProperty, with the same result, even if I go to the quickapps and add a definition for setValue

     

    Please login or register to see this code.

     

    Any ideas?

    Posted (edited)

    Please login or register to see this code.


    @jgabIs this rule still retained?
    Edited by lux

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