Page 1 of 1

Two IC2 displays

Posted: 27 Mar 2021, 10:05
by RadovanCiz
Hi, I have two I2C displays connected to Wemos D1 Pro via the same I2C bus. I would like to send a text to the second LCD. Sending to the first one via command LCD works fine but I didn't find any command like lcd1 or MQTT possibilities on how to send it to the second one. Anyone have an idea?

Re: Two IC2 displays

Posted: 27 Mar 2021, 10:30
by TD-er
Have you tried this command prefix for addressing a specific task when you're running multiple instances of the same plugin?
https://espeasy.readthedocs.io/en/lates ... f-a-plugin

Re: Two IC2 displays

Posted: 27 Mar 2021, 11:12
by RadovanCiz
I've tried
192.168.1.95/control?cmd=lcd,4,1,"A"
Ok - the first LCD
192.168.1.95/control?cmd=2.lcd,4,1,"A"
Command unknown: 2.lcd,4,1,"A"
192.168.1.95/control?cmd=[2].lcd,4,1,"A"
Command unknown: [2].lcd,4,1,"A"
192.168.1.95/control?cmd=LCDDolni.lcd,4,1,"A"
Command unknown: LCDDolni.lcd,4,1,"A"
192.168.1.95/control?cmd=[LCDDolni].lcd,4,1,"A"
Command unknown: [LCDDolni].lcd,4,1,"A"

I'm using ESP_Easy_mega_20201130_normal_ESP8266_4M1M firmware
Devices in ESP  Easy
Devices in ESP Easy
I2C.PNG (8.17 KiB) Viewed 6854 times

Re: Two IC2 displays

Posted: 27 Mar 2021, 12:12
by TD-er
Not sure if it does work like that when sending commands via HTTP.

You could try to send it as an event, with the string as an eventvalue (not 100% sure strings as event value will work here)

So you call your events something like displayone and displaytwo.
The event you try to send is something like this:

Code: Select all

event,'displayone=4,1,"A"'
N.B. see the extra single quotes on the parameter of the event command.

Then in the rules you do something like this:

Code: Select all

on displayone do
  [LCDHorni].lcd,%eventvalue1%,%eventvalue2%,%eventvalue3%
endon

on displaytwo do
  [LCDDolni].lcd,%eventvalue1%,%eventvalue2%,%eventvalue3%
endon

Re: Two IC2 displays

Posted: 27 Mar 2021, 12:14
by Ath
RadovanCiz wrote: 27 Mar 2021, 11:12 I'm using ESP_Easy_mega_20201130_normal_ESP8266_4M1M firmware
The feature of prefixing a command with its taskname has been merged on January 3rd, 2021, so is not available in the build you are using.
Please upgrade to a newer build to use that feature.

Re: Two IC2 displays

Posted: 27 Mar 2021, 12:37
by RadovanCiz
It works with ESP_Easy_mega_20210223_normal_ESP8266_4M1M firmware. I didn't notice that the firmware remain the same after ESP web device update. Thank you