openmotics / plugins

Repository containing the gateway plugins.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible to know how long an input was pressed in plugins/mqtt-client?

pietew opened this issue · comments

In plugins/mqtt-client, the input status topic (Default: openmotics/input/{id}/state) now publishes the following information:

{"status": "OFF", "timestamp": "2022-02-01T15:55:31.748217+00:00", "id": 36, "name": "I3Geel"}

Is it possible to know the long press information that OpenMotics supports?

commented

I just tested it here at home:

I have pressed a specific switch, these were the two related messages I received.
(intermediate messages were related to changing of brightness)

So you can subscribe to a specific input (in my case 24) and keep track of ON and Off status and timestamp.

Message 716 received on openmotics/input/24/state at 21:20:
{
"status": "ON",
"timestamp": "2022-03-08T20:20:38.999321+00:00",
"id": 24,
"name": "I3.1"
}

Message 730 received on openmotics/input/24/state at 21:20:
{
"status": "OFF",
"timestamp": "2022-03-08T20:20:41.072235+00:00",
"id": 24,
"name": "I3.1"
}