# Document to create a flow for a new app

**URL:** <https://community.homey.app/t/document-to-create-a-flow-for-a-new-app/77678>\
**Category:** Apps\
**Tags:** app, flow\
**Created:** [March 13, 2023, 10:31pm UTC](https://community.homey.app/t/document-to-create-a-flow-for-a-new-app/77678 "2023-03-13T22:31:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anas\_Almohana](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anas_almohana/32/71026_2.png) [@Anas\_Almohana](https://community.homey.app/u/Anas_Almohana)\
**Post date:** [March 13, 2023, 10:31pm UTC](https://community.homey.app/t/document-to-create-a-flow-for-a-new-app/77678/1 "2023-03-13T22:31:07Z")

</div>

Hi All  
I have searched a lot to find an excellent document to help me in creating a fundamental flow from my app, the idea is that my app has two devices sensor and a socket when the sensor trigger the socket goes off, now I don’t need the user to add any flow, the user should use my default one. Does anyone have any ideas or documents that’s can help me?

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [March 14, 2023, 6:23am UTC](https://community.homey.app/t/document-to-create-a-flow-for-a-new-app/77678/2 "2023-03-14T06:23:04Z")

</div>

You cannot force a user to use a flow created by your app: if they want to delete it, they can.

If you _really_ want to make this a mandatory functionality, implement the switching in your app’s code.

---

<div class="post-metadata">

**Author:** ![Anas\_Almohana](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anas_almohana/32/71026_2.png) [@Anas\_Almohana](https://community.homey.app/u/Anas_Almohana)\
**Post date:** [March 14, 2023, 7:24am UTC](https://community.homey.app/t/document-to-create-a-flow-for-a-new-app/77678/3 "2023-03-14T07:24:36Z")

</div>

thanks for your reply that makes sense, because my app should be in force mode all the time and the user can’t edit it, then a good option to code the logic in the app itself. I will try to find out how I can implement that. have you any examples about how we can work directly with device capabilities I mean listener, and set values

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [March 14, 2023, 8:10am UTC](https://community.homey.app/t/document-to-create-a-flow-for-a-new-app/77678/4 "2023-03-14T08:10:03Z")

</div>

It’s explained here: [Capabilities - Homey Apps SDK](https://apps.developer.homey.app/the-basics/devices/capabilities)

---

<div class="post-metadata">

**Author:** ![Anas\_Almohana](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anas_almohana/32/71026_2.png) [@Anas\_Almohana](https://community.homey.app/u/Anas_Almohana)\
**Post date:** [March 14, 2023, 12:58pm UTC](https://community.homey.app/t/document-to-create-a-flow-for-a-new-app/77678/5 "2023-03-14T12:58:30Z")

</div>

I give up really, I can’t find any document that covers my needs if I want to use a flow card nither code the logic. I need when the user installs My-app to have everything ready, may need to click a little but not confused with other devices and logic. I have tried to config a card that can trigger when the water sensor sends a water alarm but not work, and this card should collect all the same types of alarms (all water sensors). the same for zwave-device lib it’s so complicated to make changes there, I have tried to find out how to listen to water sensor then trigger on/off with no success, can you please support me with any git repo or document to understand more the Homey app

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [March 14, 2023, 1:02pm UTC](https://community.homey.app/t/document-to-create-a-flow-for-a-new-app/77678/6 "2023-03-14T13:02:00Z")

</div>

I don’t understand your issue.

You (presumably) know how to:

- read the state of your sensors
- turn on the socket

So when you read the value of the sensor and it matches the “turn on the socket” condition (if there is one), turn it on. No need for flows or even capabilities.

---

<div class="post-metadata">

**Author:** ![Anas\_Almohana](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/anas_almohana/32/71026_2.png) [@Anas\_Almohana](https://community.homey.app/u/Anas_Almohana)\
**Post date:** [March 14, 2023, 2:06pm UTC](https://community.homey.app/t/document-to-create-a-flow-for-a-new-app/77678/7 "2023-03-14T14:06:50Z")

</div>

Exactly but Sorry I’m new in Homey world and even I can’t read my sensor from the code here is my code:  
‘use strict’;

const { ZwaveDevice } = require(‘homey-zwavedriver’);

class FibaroFloodSensorPlus extends ZwaveDevice {

onNodeInit() {  
this.registerCapability(‘alarm\_water’, ‘NOTIFICATION’);  
this.registerCapability(‘measure\_temperature’, ‘SENSOR\_MULTILEVEL’);  
this.registerCapability(‘measure\_battery’, ‘BATTERY’);

```
this.registerReportListener('SENSOR_ALARM', 'SENSOR_ALARM_GET', async (n, r) => this.log(n, r));

this.registerSetting('temperature_measure_hysteresis', (value) => value * 10);
this.registerSetting('temperature_measure_offset', (value) => value * 100);
this.registerSetting('low_temperature_threshold', (value) => value * 100);
this.registerSetting('high_temperature_threshold', (value) => value * 100);

```

}

}

module.exports = FibaroFloodSensorPlus;

I have tried to find where I should add the listener with no success, can you please lead me from here
