Webthing Property manualModeProperty request

I think I have a seldom case that is not covered by the webthing schemas.

I made my own electronic device so this case might be really rare. The fact that software breaks to fast is a real problem of all digital controlled devices I have met so far. My device has a workaround that lets me control the device manually in any case.

You can imagine a stairway, it has a switch on each floor it passes. Every switch is able to turn on or off the light. Its called a multiway switch.

What I have done is to integrate that to a circuit that lets me control the power of that device as if it would be a normal power switch combined with a software switch. And therefore is not relying on software but can be enhanced with.

It looks like this Block schematic:


I think the Electronic schematic is much easier to read:
electronics
Now I made a truth table for it:
Bildschirmfoto 2020-03-24 um 23.02.03
As you can see, the Digital Switch (what I would like to see in gateway) is not correlating to the Device State.
Actually none of my states correlate in all cases to the Device state.

This leads me to the assumption that I need a Property where UI state and switch state can be set manually.

Did I miss something?

I would request something like this:

manaulModeProperty :
A manualy set Property for decoupled Thing Status and Switch.
type: string, 
enum: ["on", "off","switchOn","switchOff"]

It then makes sense to make all Basic UI Properties available, like a manualBooleanProperty as well as a manualOpenProperty and manualPushedProperty.

edit:
Maybe a hiddenOnOffProperty works for all those different options in one? So I can have a not displayed but persistent switch that syncs the OnOffProperty to the right UI and Switchstate.

There might be another possible solution:

Until now, I used Value() as forwarder for a switching over the UI.

Value() takes two arguments: initial_valueand value_forwarder, where the last does not let me add parameter Variables. (please let me know if my tests were wrong!)

What I tested was like this :
Value(self.get(topic, state), self.set(topic, state))
and the result was that set was not called at all.

If I change it to this:
Value(self.get(topic, state), self.set)
then set gets called.

What I try to do, is to determine if the call of self.set comes from the UI switch, or from an self.set_property('digitalswitch',state) eg. a 3rd-Party.
In my case the Relay1.

Maybe somebody has another idea how to solve this?

edit: linking my working directory.
@mstegeman can i have a few minutes of your attention here?

Fixed that with self.state.notify_of_external_update(boolean) that’s what makes the UI Switch toggle without calling a switch function.
It’s just poorly documented.

1 Like