thx @wutu
i upgrade to R95, but i couldn`t find “Rules”?
@xCite86
It is to be enabled in Tools> Advanced
Pimatic = Smart Home
@wutu veeeeeryyyy nice, much thx… works like a charm
i have invert the switch On/OffMessage
{
"class": "MqttSwitch",
"id": "switch_az",
"name": "Arbeitszimmer",
"topic": "/switch_az/gpio/2",
"stateTopic": "/switch_az/Switch_1/Switch",
"onMessage": "0",
"offMessage": "1"
},
this settings
and a little rule
on Switch_1#Switch do
if [Switch_1#Switch]=1
gpio,2,0
else
gpio,2,1
endif
endon
…and now i`m hope the R95 was stable ^^
now i have 2 ESPEasy-devices with R95 in my network…
but i lost very often the connection to the broker.
Log
476501 : SW : GPIO 2 Set to 0
476593 : SW : GPIO 2 Set to 0
487299 : WD : Uptime 8 ConnectFailures 27 FreeMem 27528
487299 : MQTT : Connection lost
488325 : MQTT : Connected to broker
488332 : Subscribed to: /switch_sz/#
517300 : WD : Uptime 8 ConnectFailures 29 FreeMem 27528
517300 : MQTT : Connection lost
518318 : MQTT : Connected to broker
518325 : Subscribed to: /switch_sz/#
it seems they have the same Client-Names “ESPClient0”
pi@raspberrypi:~ $ mosquitto
1459520003: mosquitto version 1.3.4 (build date 2014-08-22 06:10:51+0000) starting
1459520003: Using default config.
1459520003: Opening ipv4 listen socket on port 1883.
1459520003: Opening ipv6 listen socket on port 1883.
1459520006: New connection from 192.168.0.33 on port 1883.
1459520006: New client connected from 192.168.0.33 as ESPClient0 (c1, k15).
1459520007: New connection from 127.0.0.1 on port 1883.
1459520007: New client connected from 127.0.0.1 as pimatic_2e6a6fa9 (c1, k180).
1459520016: New connection from 192.168.0.34 on port 1883.
1459520016: Client ESPClient0 already connected, closing old connection.
1459520016: New client connected from 192.168.0.34 as ESPClient0 (c1, k15).
1459520036: New connection from 192.168.0.33 on port 1883.
1459520036: Client ESPClient0 already connected, closing old connection.
1459520036: New client connected from 192.168.0.33 as ESPClient0 (c1, k15).
1459520047: New connection from 192.168.0.34 on port 1883.
1459520047: Client ESPClient0 already connected, closing old connection.
1459520047: New client connected from 192.168.0.34 as ESPClient0 (c1, k15).
where i could configure that name??
Only Unit nr:
On the Config page. The result is ESPClient + Unit nr.
Pimatic = Smart Home
thanks, works well
pi@raspberrypi:~ $ mosquitto
1459595937: mosquitto version 1.3.4 (build date 2014-08-22 06:10:51+0000) starting
1459595937: Using default config.
1459595937: Opening ipv4 listen socket on port 1883.
1459595937: Opening ipv6 listen socket on port 1883.
1459595941: New connection from 127.0.0.1 on port 1883.
1459595941: New client connected from 127.0.0.1 as pimatic_90afb63f (c1, k180).
1459595952: New connection from 192.168.0.34 on port 1883.
1459595952: New client connected from 192.168.0.34 as ESPClient2 (c1, k15).
1459595955: New connection from 192.168.0.33 on port 1883.
1459595955: New client connected from 192.168.0.33 as ESPClient1 (c1, k15).
1459595958: New connection from 192.168.0.38 on port 1883.
1459595958: New client connected from 192.168.0.38 as ESPClient3 (c1, k15).
@noxx @xCite86
I finally had time to test it. Configuration is unnecessarily complex. It is due to change default topic.
If you use a device name: “gpio” and Value name as GPIO numbers.
It works with one topic.
{
"class": "MqttSwitch",
"id": "switch_az",
"name": "Arbeitszimmer",
"topic": "/switch_az/gpio/2",
"onMessage": "0",
"offMessage": "1"
}
EDIT:
If you do not need to change the basic parameters of the actuator. It is not necessary to configure ESPEasy at all. Immediately after flash, everything works.
Topics can be derived from http commands.
http://<ESP IP address>/control?cmd=GPIO,<pin>,0 == topic: /sysname/gpio/2 message:0/1 (0.00/1.00 for R78)
http://<ESP IP address>/control?cmd=PWM,<pin>,<level> == topic: /sysname/pwm/<pin> message: <level>
http://<ESP IP address>/control?cmd=pcapwm,<pin>,<Level> == topic: /sysname/pcapwm/<pin> message: 0-4095
And so on
Pimatic = Smart Home
today i update my esp to espeasy build 103
now, i cant control my relays with pimatic
it works with my browser, e.g.
http://192.168.1.226/control?cmd=GPIO,15,1
http://192.168.1.226/control?cmd=GPIO,15,0
but not with pimatic
plugin mqtt 0.8.9 is installed
my config:
{
"plugin": "mqtt",
"host": "127.0.0.1",
"port": 1883
}
{
"class": "MqttSwitch",
"id": "ESPeasyR1",
"name": "Beleuchtung (R1)",
"topic": "/espeasy01/gpio/12",
"stateTopic": "/espeasy01/Beleuchtung_R1/state",
"onMessage": "1",
"offMessage": "0"
},
{
"class": "MqttSwitch",
"id": "ESPeasyR2",
"name": "Beleuchtung (R2)",
"topic": "/espeasy01/gpio/13",
"stateTopic": "/espeasy01/Beleuchtung_R2/state",
"onMessage": "1",
"offMessage": "0"
},
{
"class": "MqttSwitch",
"id": "ESPeasyR3",
"name": "Beleuchtung (R3)",
"topic": "/espeasy01/gpio/14",
"stateTopic": "/espeasy01/Beleuchtung_R3/state",
"onMessage": "1",
"offMessage": "0"
},
{
"class": "MqttSwitch",
"id": "ESPeasyR4",
"name": "Heizung (R4)",
"topic": "/espeasy01/gpio/15",
"stateTopic": "/espeasy01/Heizung_R4/state",
"onMessage": "1",
"offMessage": "0"
}
mosquttito works also fine
pi@raspberrypi:~ $ sudo service mosquitto status
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
Loaded: loaded (/etc/init.d/mosquitto)
Active: active (running) since Do 2016-04-21 21:23:16 CEST; 23h ago
CGroup: /system.slice/mosquitto.service
└─2166 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
Apr 21 21:23:16 raspberrypi mosquitto[2161]: Starting network daemon:: mosqu....
Apr 21 21:23:16 raspberrypi systemd[1]: Started LSB: mosquitto MQTT v3.1 mes....
Hint: Some lines were ellipsized, use -l to show in full.
pi@raspberrypi:~ $ mosquitto_sub -v -t /# /espeasy01/Temperatur/Temperature 18.81
/espeasy01/Beleuchtung_R1/state 0
/espeasy01/Beleuchtung_R2/state 0
/espeasy01/Beleuchtung_R3/state 0
/espeasy01/Heizung_R4/state 0
/espeasy01/system/uptime 72.00
/espeasy01/system/freeram 26656.00
/espeasy01/Temperatur/Temperature 18.81
/espeasy01/Beleuchtung_R1/state 0
/espeasy01/Beleuchtung_R2/state 0
^C
pi@raspberrypi:~ $
EspEasy Log:
5160390 : SW : State 0.00
5161449 : SYS : 72.00
5162418 : SYS : 26656.00
5164354 : DS : Temperature: 18.81 (28-ff-4a-a6-71-15-2-57)
5164586 : SW : State 0.00
5165599 : SW : State 0.00
5166612 : SW : State 0.00
5167693 : SW : State 0.00
5168749 : SYS : 72.00
5169719 : SYS : 26768.00
...
@noxx I do not see reason to use state topic.
Everything it should work only on the topic /espeasy01/<Name>/state.
There are softwares that send status to a side channel, but ESPEasy not one of them.
Pimatic = Smart Home
i use Stage to get the correct status.
if I push the button and have no connection, pimatic show the wrong value
but I think that is not the reason of my problem
Edit:
But, i will try it with
{
"class": "MqttSwitch",
"id": "ESPeasyR1",
"name": "Beleuchtung (R1)",
"topic": "/espeasy01/gpio/12",
"onMessage": "1",
"offMessage": "0"
},
EDIT 2:
ok, it runs better without stateToptic, but Pimatic shows wrong states if i switch ESPeasy with other devices, e.g. browser
Did you solve the problem of the wrong state?
Edit…Okay its simple…for state the same command like for topic
Can anyone show me the how dit i connect a 4 Relay Module to the WEMOS d1 Mini?
Hey @schmucke,
I used:
gpio/12
gpio/13
gpio/14
gpio/16
Pimatic = Smart Home
Dit you have it connect direct from the ESP to the relay? How dit you connect the relay with 5v? Direct from the ESP?
@schmucke said in ESPeasy - add a relay:
Can anyone show me the how dit i connect a 4 Relay Module to the WEMOS d1 Mini?
See https://www.letscontrolit.com/wiki/index.php/Relais
Dit you have it connect direct from the ESP to the relay? How dit you connect the relay with 5v? Direct from the ESP?
As you can see VCC on the input side is wired to 3.3V. The relay board should have an extra VCC in for the relay coils which is wired to 5V as shown in the diagram
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Thank you!
i give them a try.