Hi,
i got a breakthrough with maveo and wanted to share my progress with you.
In the beginning I used the code for the switches from @tomu, and it worked great.
But since I also wanted to read/show the current state, I was hoping that there is another way without doing crazy python scripts and such things. So I looked for an alternative and ended up with Node-RED.
But since these were my first attempts with Node-RED, I failed mercilessly at the beginning. After reading a lot about Node-Red, and watching countless videos, I was able to report initial successes.
So, enough chatter, here’s my solution:
Note: I’m not an expert in Node-RED and not sure if all values/nodes are necessary, but it works!
Since English is not my main language and I also use the German apps/software, I try to describe and translate everything as best as I can. For this reason please forgive me small mistakes/inaccuracies.
-
I created 5 button nodes
in Node-RED, one for each possible command (open, close, stop, lightOn and lightOff).
- Edit each Entitiy Config and create a uniqe button.
-
e.g.
-
e.g.
-
- Edit each Entitiy Config and create a uniqe button.
-
Connected each of them with a change node
and as value i used a string with the command i wanted to send.
- set: msg.payload
- e.g. value: C;name of your garagedoor;open
- list of possible commands:
Important:
The commands are case sensitive, and be careful not to accidentally use a comma instead of a semicolon!- C;name of your garagedoor*;open
- C;name of your garagedoor*;close
- C;name of your garagedoor*;stop
- C;name of your garagedoor*;lightOn
- C;name of your garagedoor*;lightOff
* Replace “name of your garagedoor” with the real name of your garage door!
- list of possible commands:
-
Each of those change nodes is connected with its own tcp request node
but ensure to enable TCP in third party settings of your maveo app beforehand.
- server: your local IP adress
- port: 2785
- return: Strings
- close: never
-
all of the change node are connected with one switch node
- “enthält” means “contains”
- “ansonsten” means “else”
- since the responses contains either closed, closing, open, opening, lightOn or lightOff, i ended up with the values shown in the screenshot so that I can distinguish the answers as follows:
- door:
- S;name of your garagedoor;open
- S;name of your garagedoor;opening
- S;name of your garagedoor;close
- S;name of your garagedoor;closing
- light
- S;name of your garagedoor;lightOn
- S;name of your garagedoor;lightOff
- command
- R;OK (valid commands are confirmed in this way)
- R;Error;…(Invalid Commands will be returned in this way)
- door:
-
after that i created one tcp out
and 3 function nodes
to cut off the first part of the response (which is always the same) so that only the actual status remains.
- door function:
- connect to switch node output “clos” and “open”
- under function Tab enter following code and enter your real garagedoor name:
msg.payload = msg.payload.split('S;**your door name**;')[1].substr(0, 8); return msg;
- light function:
*see small optional addition at the end.- connect to switch node output “light”
- under function Tab enter following code and enter your real garagedoor name:
msg.payload = msg.payload.split('S;**your door name**;light')[1].substr(0, 3); return msg;
- command function:
- connect to switch node output “else”
- under function Tab enter following code:
msg.payload = msg.payload.split('R;')[1].substr(0, 5); return msg;
- tcp out
- connect every output of the switch not to this
- settings:
- connect to port: 2785
- host: your local ip address
- Then i created a text helpers for door, light and command feedback (e.g. input_text.garage_door_status). In order to fill them with the data, I needed a call service node
for each function node. Configure each node as follows:
- entity: choose the appropriate helper for each state
- e.g.
That’s all!!
Just create some dashboard cards and enjoy your fully controllable garage door including status feedback!
Small optional addition:
For the lights I wanted a tile that changes color depending on state (refer to screenshot above and below)
I couldn’t solve it any other way, so i created a few more nodes and connected these to the light function node:
-
one switch node
-
one entity switch node
-
enable input and create new device by clicking the edit button
- Name: whatever you like or call it
- Device: click edit Button and give it a name you like or call it, no further editing needed.
- Type: switch
- Name: whatever you like or call it
as you can see in the screenshot below i entered nearly the same name everywhere - Device class: switch
-
-
two call service nodes
to toggle the switch (you just created) on and off.
-
-
Now connect everything as shown in the screenshot above and your good to go.
-