With some perseverance=https://www.letscontrolit. ... php?t=9520, and help from Ath and td-er (again my thanks!!), I succeeded to make rflink and esp easy over mqtt works
now I'm goofing around with rules but bumping my head agents an action what I'd like
I want to give buttons in ESP easy their own name, so over MQTT only the name and status is sent. I thought it's easier to do the translation in ESP Easy than Home Assistant.
So !Serial#20;E2;TriState;ID=0a82a2;SWITCH=0;CMD=ON; must become dom/button/a, "on"
I've tried the lines below as test and only the first and second works. Does someone have a suggestion? I do not want to do the translation in node-red
Code: Select all
on !Serial do
Publish, %sysname%/switch, %eventvalue% // The data is added after the # as the event-parameter name
Publish, %sysname%/switch, {substring:26:32:%eventvalue%}
Let, temp, {substring:26:32:%eventvalue%}
Publish, %sysname%/switch, [var#temp]
If {equals_ci:'{0a82a2}':{substring:26:32:[%eventvalue%]} }= 1
Publish, %sysname%/switch, niet_waar
Endif
If %eventvalue% ='{TriState;ID=0a82a2;SWITCH=0;CMD=ON;}'
Publish, %sysname%/switch, niet_waar2
endif
endon
//!Serial#20;E2;TriState;ID=0a82a2;SWITCH=0;CMD=ON;
Greetings