Jump to content

Recommended Posts

  • Replies 167
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

hi!   here is my new node-red node for FIBARO HCx   https://flows.nodered.org/node/node-red-contrib-fibaro-devices   now you can use finaroSenor node - for any sensors in

.41 nothing new just "glamour"      

hi @petrho you get the status with Actornode when you enable the "event passtrough" 

Posted Images

some usefull flows

1) get rooms and store in global context

[{"id":"1d26f4e7.9d038b","type":"comment","z":"3622cde7.a8ae82","name":"HC2","info":"","x":150,"y":60,"wires":[]},{"id":"4c3f9007.565a","type":"fibaroAPI","z":"3622cde7.a8ae82","name":"HC2","server":"d3e7cc13.01e39","pollingInterval":"2","passthrough":true,"outputs":2,"x":190,"y":120,"wires":[["5e02b81e.d9e608","7f26cada.b8b0c4"],["6eff0f96.7e36d","427476c7.5db498"]]},{"id":"5e02b81e.d9e608","type":"change","z":"3622cde7.a8ae82","name":"","rules":[{"t":"set","p":"payload.action","pt":"msg","to":"topic","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":60,"wires":[["7f8e6d0f.8e5de4"]]},{"id":"7f26cada.b8b0c4","type":"switch","z":"3622cde7.a8ae82","name":"is rooms inited?","property":"rooms","propertyType":"global","rules":[{"t":"null"}],"checkall":"true","repair":false,"outputs":1,"x":440,"y":120,"wires":[["f29e9d75.06ccb"]]},{"id":"427476c7.5db498","type":"debug","z":"3622cde7.a8ae82","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":430,"y":240,"wires":[]},{"id":"a967a70.7f1b158","type":"json","z":"3622cde7.a8ae82","name":"","property":"payload","action":"","pretty":false,"x":610,"y":180,"wires":[["633003dc.de3a5c"]]},{"id":"f29e9d75.06ccb","type":"change","z":"3622cde7.a8ae82","name":"request rooms","rules":[{"t":"set","p":"topic","pt":"msg","to":"rooms","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":120,"wires":[["4c3f9007.565a"]]},{"id":"7f8e6d0f.8e5de4","type":"mqtt out","z":"3622cde7.a8ae82","name":"","topic":"home/fibaro","qos":"","retain":"","broker":"e252cfee.3c86b","x":670,"y":60,"wires":[]},{"id":"633003dc.de3a5c","type":"change","z":"3622cde7.a8ae82","name":"save rooms","rules":[{"t":"set","p":"rooms","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":180,"wires":[[]]},{"id":"6eff0f96.7e36d","type":"switch","z":"3622cde7.a8ae82","name":"is room response?","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"/rooms","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":180,"wires":[["a967a70.7f1b158"]]},{"id":"d3e7cc13.01e39","type":"fibaro-server","z":"","name":"HC2","ipaddress":"192.168.1.36"},{"id":"e252cfee.3c86b","type":"mqtt-broker","z":"","name":"local MQTT server","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

 

image.png.8ead5805fb514e82af5f5f697baa4402.png

 

2) het all ligths and sjow in table

[{"id":"997c8d6b.3d429","type":"inject","z":"6bc4f3ef.74205c","name":"","topic":"visible=true&enabled=true&interface=light&property=[isLight,true]","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":150,"y":480,"wires":[["466b8608.2576f8"]]},{"id":"2b41271b.2fde98","type":"debug","z":"6bc4f3ef.74205c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":870,"y":440,"wires":[]},{"id":"de099ed8.8ad1d","type":"mqtt in","z":"6bc4f3ef.74205c","name":"","topic":"home/fibaro","qos":"2","datatype":"json","broker":"e252cfee.3c86b","x":310,"y":420,"wires":[["a698c6a7.f97318"]]},{"id":"a698c6a7.f97318","type":"function","z":"6bc4f3ef.74205c","name":"only lighting","func":"if (msg.payload.action == \"DevicePropertyUpdatedEvent\" &&\n    msg.payload.property == \"value\") {\n    var devices = flow.get(\"lighting\") || [];\n    var device = devices.find(x => x.id == msg.payload.id)\n    if (device) {\n        //node.warn(device);\n        node.warn(msg.payload);\n        device.state = msg.payload.newValue === 0 || msg.payload.newValue === false ?\"grey\":\"yellow\";\n        msg.payload = devices;\n        return msg;    \n    }\n}\n","outputs":1,"noerr":0,"x":490,"y":420,"wires":[["e3469337.cca7c"]]},{"id":"e3469337.cca7c","type":"change","z":"6bc4f3ef.74205c","name":"","rules":[{"t":"set","p":"lighting","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":480,"wires":[["2b41271b.2fde98","acdb021b.b3da4"]]},{"id":"466b8608.2576f8","type":"fibaroQuery","z":"6bc4f3ef.74205c","name":"query lighting","server":"d3e7cc13.01e39","x":310,"y":480,"wires":[["c1381ca5.9c675"]]},{"id":"d5fd1ce1.cab98","type":"ui_template","z":"6bc4f3ef.74205c","group":"55a5f0b2.b6185","name":"","order":1,"width":6,"height":6,"format":"<table border=\"1\">\n    <tr><td>Name</td><td>State</td></tr>\n    <tr ng-repeat=\"(k,v) in msg.payload\">\n        <td>{{v.name}}</td>\n        <td><font color=\"{{v.state}}\"><i class=\"fa fa-lightbulb-o fa-2x\"></i></font></td>\n    </tr>\n</table>\n\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1040,"y":480,"wires":[[]]},{"id":"c1381ca5.9c675","type":"function","z":"6bc4f3ef.74205c","name":"adopt data","func":"var newData = msg.currentState.map(function(item) {\n    return {\n        id: item.id,\n        roomID: item.roomID,\n        name: item.name,\n        state: item.properties.value == \"0\" || item.properties.value == \"false\" ?\"grey\":\"yellow\"\n    };\n});\n\nmsg.payload = newData;\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":480,"wires":[["e3469337.cca7c"]]},{"id":"acdb021b.b3da4","type":"function","z":"6bc4f3ef.74205c","name":"final adopt","func":"msg.payload.sort((a,b) => (a.roomID > b.roomID) ? -1 : ((b.roomID > a.roomID) ? 1 : 0));\nvar rooms = global.get(\"rooms\")||[];\nmsg.payload = msg.payload.map(function(item) {\n    var room = rooms.find(x => x.id == item.roomID)\n    var roomName = room ? room.name : \"*\"; \n    return {\n        id: item.id,\n        roomID: item.roomID,\n        name: roomName + \" : \"+ item.name,\n        state: item.state\n    };\n});\nreturn msg;","outputs":1,"noerr":0,"x":870,"y":480,"wires":[["d5fd1ce1.cab98"]]},{"id":"e252cfee.3c86b","type":"mqtt-broker","z":"","name":"local MQTT server","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"d3e7cc13.01e39","type":"fibaro-server","z":"","name":"HC2","ipaddress":"192.168.1.36"},{"id":"55a5f0b2.b6185","type":"ui_group","z":"","name":"Home","tab":"22f8eda2.68de22","order":2,"disp":true,"width":"6","collapse":true},{"id":"22f8eda2.68de22","type":"ui_tab","z":"","name":"Home","icon":"fa-home","order":1,"disabled":false,"hidden":false}]

 

image.thumb.png.9d098d51ecc9e77014cb188edfed0e4a.png

 

image.png.aa69aa7d46af3a495385bff41141aacb.png

 

Link to post
Share on other sites

ad.2 return empty area, why?

31.01.2020, 12:48:33node: 3a33ce9c.9201ba

visible=true&enabled=true&interface=light&property=[isLight,true] : msg : Object

object

_msgid: "38a46297.e48cbe"

topic: "visible=true&enabled=true&interface=light&property=[isLight,true]"

payload: 1580471313713

currentState: array[0]

 

31.01.2020, 12:48:33node: b61a848f.ccb63visible=true&enabled=true&interface=light&property=[isLight,true] : msg.payload : array[0]

[ empty ]

Link to post
Share on other sites
52 minutes ago, drboss said:

ad.2 return empty area, why?

31.01.2020, 12:48:33node: 3a33ce9c.9201ba

visible=true&enabled=true&interface=light&property=[isLight,true] : msg : Object

object

_msgid: "38a46297.e48cbe"

topic: "visible=true&enabled=true&interface=light&property=[isLight,true]"

payload: 1580471313713

currentState: array[0]

 

31.01.2020, 12:48:33node: b61a848f.ccb63visible=true&enabled=true&interface=light&property=[isLight,true] : msg.payload : array[0]

[ empty ]

query by string supported >0.32

Edited by 10der
  • Thanks 1
Link to post
Share on other sites

You update to fast 😀 at last night I updated to fresh 0.32 and today I don't things to check for new version. 

Thx

Link to post
Share on other sites

For query can I use any of parameters and property, i things yes? and for VD too? I ask because I'm on trip without stable access to my test HC2. Another question about global variable, is it possible to use it as (like) the sensor if changed.

Link to post
Share on other sites
26 minutes ago, drboss said:

For query can I use any of parameters and property,

yes. aby for devices.

 

27 minutes ago, drboss said:

about global variable,

it's pain.

 

reading not impemented yet

changing - pain pain pain :) no admin access

Link to post
Share on other sites

Yes i know limitation for no admin access, i things for most case only reading is ok. For change, if needed and acceptable from risk point of view, is no problem use rest api. But for use as trigger in mqtt ... we wait for next step of your big work ;-)🍻

Link to post
Share on other sites

I forgot, but error generate by FibaroApi without debug returned (i not remember exactly the version from return):

{ text: "error: [object Object]", error: object }
1.02.2020, 11:55:03node: 2f207907.611326msg : Object
{ text: "error: [object Object]", error: object }
1.02.2020, 11:59:33node: 2f207907.611326msg : Object
{ text: "error: [object Object]", error: object }
1.02.2020, 12:14:36node: 2f207907.611326msg : Object
object
text: "error: [object Object]"
error: object
code: 400

 

Link to post
Share on other sites
4 hours ago, drboss said:

I forgot, but error generate by FibaroApi without debug returned (i not remember exactly the version from return):

{ text: "error: [object Object]", error: object }
1.02.2020, 11:55:03node: 2f207907.611326msg : Object
{ text: "error: [object Object]", error: object }
1.02.2020, 11:59:33node: 2f207907.611326msg : Object
{ text: "error: [object Object]", error: object }
1.02.2020, 12:14:36node: 2f207907.611326msg : Object
object
text: "error: [object Object]"
error: object
code: 400

 

Payload empty json {}
topic query

Link to post
Share on other sites

Another issue after upgrade > 32

FibaroSensor stopped inform about scene events. Before they give payload.value.keyId and payload.value.keyAttribute when any buttom for ex on remote is pressed if "Handle additional events" checked.

second method don't work too

FibaroAPI inform about scenes events:

CentralSceneEvent : msg.payload : Object
object
keyId: 4
keyAttribute: "Pressed"
icon: object
empty

but without device ID. And it's not usable without device ID.

Link to post
Share on other sites
1 hour ago, drboss said:

Another issue after upgrade > 32

FibaroSensor stopped inform about scene events. Before they give payload.value.keyId and payload.value.keyAttribute when any buttom for ex on remote is pressed if "Handle additional events" checked.

second method don't work too

FibaroAPI inform about scenes events:

CentralSceneEvent : msg.payload : Object
object
keyId: 4
keyAttribute: "Pressed"
icon: object
empty

but without device ID. And it's not usable without device ID.

Opps 

sorry 

in work trip 

will be at home tomorrow 

Link to post
Share on other sites

don't worry, the world is better with your app with this small problem that without this apps. I wait and quiet return to home

Link to post
Share on other sites

hi,

can somebody say me what i has to wirte in the example node from 10der?

my Problem:

 

in the example there is a motion sensor with lux an timeofday with dimming stats, my problem is that i dont have a rgb aktor is use the dimmer2 and i dont know what i has to write in the passtru node so that the dimmer will dimm my lamps automitacally in the night and other in the day.

 

actually there is wirtten: 

if (msg.payload > 0) {
    msg.payload = {
        name: "setColor", 
        arg1:255, 
        arg2:255,
        arg3:255,
        arg4:255
    };
} else {
    msg.payload = {
        name: "turnOff"
    }
}
return msg;

 

 

and this i need for dimmer 2 not for rgb.

thanks for your help

Link to post
Share on other sites

@ctyd LoL

 

[{"id":"6e44e0e5.490de","type":"inject","z":"c5417749.a123c8","name":"","topic":"","payload":"50","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":760,"wires":[["892bf04a.b8b9f"]]},{"id":"892bf04a.b8b9f","type":"fibaroActor","z":"c5417749.a123c8","name":"Fibaro dimmer","deviceID":"608","server":"fdb022c7.4295a","events":false,"outputs":0,"x":380,"y":760,"wires":[]},{"id":"ee51e983.518528","type":"inject","z":"c5417749.a123c8","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":720,"wires":[["892bf04a.b8b9f"]]},{"id":"89c96b43.8c8768","type":"inject","z":"c5417749.a123c8","name":"","topic":"","payload":"100","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":800,"wires":[["892bf04a.b8b9f"]]},{"id":"fdb022c7.4295a","type":"fibaro-server","z":"","name":"HC2","ipaddress":"192.168.1.36"}]

please change deviceId

Link to post
Share on other sites

thx for your answer but that i dont mean my english is not so good sorry.

 

image.thumb.png.57af8e175e9a414704ab3399ed16d193.png

 

i mean the node in my picture there is code for rgb but i need code for dimmer and dont know what i have to write there.

Link to post
Share on other sites

image.png.21f6125043c42f211a96fd5cfb206468.png

you know what i mean? the Example is from you, i want that the dimmer has the dimm lvl from the example, but in your example you use a rgb aktor and i have a dimmer, i need the code for the dimmer

 

 

Edited by ctyd
Link to post
Share on other sites

Drop this node. Just drop. And replace actor on actor 

that’s all

actor can get int value as dimmer 

Link to post
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...