Document to create a flow for a new app

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?

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.

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

It’s explained here: Capabilities - Homey Apps SDK

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

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.

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