D1 Mini & OpenHab
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 10
- Joined: 16 Feb 2018, 12:06
D1 Mini & OpenHab
Hi Guys
i got a problem with my d1mini and espeasymega20190108.
go an capacitive touch sensor(with a built in led) on gpio12 and i can switch it on and off as it supposed to be.
device is a normal switch.
i can turn it on and off via openhab (mqtt) to and i get the state in openhab.
my problem is: if i turn the switch (touch) manually on it shows in openhab but if i want to turn the switch off via openhab (mqtt) i get the message in the log (SW: GPIO 12 Set to 0) but the switch is still on.
so basically i can turn it on and off only both manually or both with openhab.
is there any solution for that?
thanks a lot!!!
i got a problem with my d1mini and espeasymega20190108.
go an capacitive touch sensor(with a built in led) on gpio12 and i can switch it on and off as it supposed to be.
device is a normal switch.
i can turn it on and off via openhab (mqtt) to and i get the state in openhab.
my problem is: if i turn the switch (touch) manually on it shows in openhab but if i want to turn the switch off via openhab (mqtt) i get the message in the log (SW: GPIO 12 Set to 0) but the switch is still on.
so basically i can turn it on and off only both manually or both with openhab.
is there any solution for that?
thanks a lot!!!
Re: D1 Mini & OpenHab
I suggest updating to the latest Mega release. No promises, but it might solve your problem.
- Thomas
- Thomas
-
- Normal user
- Posts: 10
- Joined: 16 Feb 2018, 12:06
Re: D1 Mini & OpenHab
thanks for the idea but it didn´t work 

Re: D1 Mini & OpenHab
Please share your openhab config (item, thing, sitemap) concerning the device
-
- Normal user
- Posts: 10
- Joined: 16 Feb 2018, 12:06
Re: D1 Mini & OpenHab
my openhab config:
item:
Switch TouchPS4_Blau "PS4-Touch-Blau [MAP(touch.map):%s]" {mqtt=">[Sentshuas:TouchModule/gpio/14:command:ON:1.00],>[Sentshuas:TouchModule/gpio/14:command:OFF:0.00],<[Sentshuas:TouchModule/blau/blau_touch:state:MAP(touch.map)]"}
i got three of these with for sure different names and gpio
sitemap:
Switch item=TouchPS4_Blau label="Blau" mappings=[ON="ON",OFF="OFF"]
it don´t think the problem is in openhab because i see the right switch state and can control them out of openhab.
i´ve tried tasmota yesterday and there is kinda the same problem. if i switch it on and off manually everything is ok same if i do that on the software side... but if i crossfire there is no registration.
item:
Switch TouchPS4_Blau "PS4-Touch-Blau [MAP(touch.map):%s]" {mqtt=">[Sentshuas:TouchModule/gpio/14:command:ON:1.00],>[Sentshuas:TouchModule/gpio/14:command:OFF:0.00],<[Sentshuas:TouchModule/blau/blau_touch:state:MAP(touch.map)]"}
i got three of these with for sure different names and gpio

sitemap:
Switch item=TouchPS4_Blau label="Blau" mappings=[ON="ON",OFF="OFF"]
it don´t think the problem is in openhab because i see the right switch state and can control them out of openhab.
i´ve tried tasmota yesterday and there is kinda the same problem. if i switch it on and off manually everything is ok same if i do that on the software side... but if i crossfire there is no registration.
Re: D1 Mini & OpenHab
That's why I asked if it ever worked as intended, or is this a new 'expected behavior'?Michael_BruceLee wrote: ↑09 Oct 2020, 10:42 i´ve tried tasmota yesterday and there is kinda the same problem.
/Ton (PayPal.me)
-
- Normal user
- Posts: 10
- Joined: 16 Feb 2018, 12:06
Re: D1 Mini & OpenHab
hey 
no it didn´t work yet

no it didn´t work yet
Re: D1 Mini & OpenHab
It looks like an older openHAB, I had many issues before upgrading to latest. Much more complex MQTT than before, but it works better.
Can't see the reason why your setup doesn't work. logs + MQTT.fx or MQTT Explorer is the best way forward
Can't see the reason why your setup doesn't work. logs + MQTT.fx or MQTT Explorer is the best way forward

-
- Normal user
- Posts: 10
- Joined: 16 Feb 2018, 12:06
Re: D1 Mini & OpenHab
ya i don´t wanna upgrade now because of openhab 3 comming soon but i got 2.4 soo its not soo old 
ya i got mqtt.fx and even on the esp log i see that openhab sends the "message" SW: GPIO 12 Set to 0 but nothing changes on the esp.
even when i pull the string on the webbrowser with the right command i can´t get the esp to do something only if i send the on command and off command in the web not when crossover thats so weird. maybe i need a rule in esp or something

ya i got mqtt.fx and even on the esp log i see that openhab sends the "message" SW: GPIO 12 Set to 0 but nothing changes on the esp.
even when i pull the string on the webbrowser with the right command i can´t get the esp to do something only if i send the on command and off command in the web not when crossover thats so weird. maybe i need a rule in esp or something
Re: D1 Mini & OpenHab
I'm using OH 2.4 with ESPEasy. I don't have any issues. I think my success is because I never directly control GPIO. Instead, I use events and have the GPIO controlled in ESPEasy rules.
For example, here is a OH item for one of my GPIO controlled devices:
The RelayOn and RelayOff events are rules in ESPEasy that switch the relay.
You'll also need a ESPEasy rule that calls RelayOn / RelayOff events when the touch sensor is used.
- Thomas
For example, here is a OH item for one of my GPIO controlled devices:
Code: Select all
Switch Attic_AC "Attic Relay AC" <poweroutlet-us> (Equipment) ["Switchable"] {mqtt=">[mosquitto:ESPEZ_Attic/cmd:command:ON:Event,RelayOn],>[mosquitto:ESPEZ_Attic/cmd:command:OFF:Event,RelayOff],<[mosquitto:ESPEZ_Attic/STATEVAR/rlyval:state:OFF:-1],<[mosquitto:ESPEZ_Attic/STATEVAR/rlyval:state:ON:1]"}
Code: Select all
On RelayOn do
gpio,12,1
Publish %sysname%/STATEVAR/rlyval,1
endon
On RelayOff do
gpio,12,0
Publish %sysname%/STATEVAR/rlyval,-1
endon
- Thomas
Who is online
Users browsing this forum: No registered users and 13 guests