Giter VIP home page Giter VIP logo

Comments (3)

ArjanKranenburg avatar ArjanKranenburg commented on August 24, 2024

Solved for modes.

from virtual-devices.

MrZANE42 avatar MrZANE42 commented on August 24, 2024

UPDATED: See Last paragraph

Any chance this could be done for normal devices also?
Either that of maybe a condition card that is true if triggered from flow otherwise false?

I have a looping problem, the device keeps turning on and off very fast when I activate both my flows for this device.
My setup is like this:
I have 2 flows, one that triggers on data from MQTT (Sonoff device running Tasmota) and with better logic decides if the device was turned on or off and then sets the state of the virtual device accordingly. The problem is that this triggers my second flow that is used to check if the status of the virtual device has changed and based on it's current state send an on or off command via MQTT. Currently that then triggers the first flow again since it gets info that the state has changed.

I'm aware that this can be done by adding one more flow with some additional logic but I rather not have too many flows for each device (if avoidable)

Thanks for all the time you put into this plug-in, it's one of the best and one I cant do without. 🥇

UPDATE: I've solved the looping problem by, when receiving MQTT status, having 2 conditions (ORed): 1. Checks for VD Off and MQTT message contains "ON". 2 Checks for VD On and MQTT message contains "OFF". If either of these are true I use the VD Toggle function. This works like a charm. The idea(s) suggested at the top could still be useful though, as they could simplify the flows.

from virtual-devices.

ArjanKranenburg avatar ArjanKranenburg commented on August 24, 2024

I've tried this, but unfortunately I cannot prevent Homey from triggering the device.
The difference with a mode is that a mode has a class 'other' which means I have to define the flow-cards which in turn means I can program the flow-cards as I like.

For devices with class light, button, tv, etc. Homey creates the cards for us. I can add a card that sets the state, but as soon as the state is changed, the auto-generated tirgger-card is triggered. I cannot prevent that.

I'm glad you have a workaround.

from virtual-devices.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.