LCD display works but is not accessible from Domoticz

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

LCD display works but is not accessible from Domoticz

#1 Post by manjh » 26 May 2016, 15:51

I attached a J204A display to a NodeMCU and configured it according to the example in the Wiki: put the uptime in line 1, and some test lines in 2, 3 and 4.
It comes up just fine: first text ESPEasy, then the 4 lines, and backlit mode switches off after a while.

I tried to send these commands from a dummy switch in Domoticz , as on/off actions:

http://10.0.0.206/control?cmd=lcd, 1, 1, on
http://10.0.0.206/control?cmd=lcd, 1, 1, off

But this never comes on the screen.
I'm sure Domoticz can send commands this way, I used it on my Sonoff a few days ago.

What am I doing wrong here?

User avatar
egkman
New user
Posts: 9
Joined: 25 May 2016, 21:28

Re: LCD display works but is not accessible from Domoticz

#2 Post by egkman » 26 May 2016, 16:57

Hi, did you try to set the display time-out setting to 0 in the Task settings?
Normally it is set to 60 (1 minute)
Unless you know the code, it has no meaning.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: LCD display works but is not accessible from Domoticz

#3 Post by manjh » 26 May 2016, 18:41

Yes, that did it! I can now send commands from the dummy device or from LUA, which opens up the door to what I want: a message box to which I can send status and warning messages. Great.

Is there a list of commands for the LCD? I see on, off and clear in the Wiki. Anything else?

User avatar
egkman
New user
Posts: 9
Joined: 25 May 2016, 21:28

Re: LCD display works but is not accessible from Domoticz

#4 Post by egkman » 26 May 2016, 19:14

glad it worked!
i think there are not so many options, however you could check the ESPEasy Core code and the included lcd plugin for further information on commands.
just load the latest source from github and load into arduino IDE.
Unless you know the code, it has no meaning.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: LCD display works but is not accessible from Domoticz

#5 Post by manjh » 26 May 2016, 19:20

egkman wrote:glad it worked!
i think there are not so many options, however you could check the ESPEasy Core code and the included lcd plugin for further information on commands.
just load the latest source from github and load into arduino IDE.
I think I will do that as soon as I can find the time, and then perhaps post it on the Wiki.
I can imagine there is not that much more, but I am thinking of things like clearline, and the tree alignments (left, mid,right).

Also, when I send a text thru http, is there a way to include a space? If I do that in the regular text it ends the text.
So when i send "this is a sentence" all that comes up is "this" ...
I can use underscores, but it does not look quite as nice.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: LCD display works but is not accessible from Domoticz

#6 Post by manjh » 26 May 2016, 21:22

I just checked the code, and as far as I can see only three commands were implemented: on, off and clear.
Obviously the author wanted to keep the code lean and mean...

The one command I am really missing is clearline. I want to use the four lines independently, and sometimes characters remain on the line from the previous message when the new one is shorter.
Is there a way around this?

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: LCD display works but is not accessible from Domoticz

#7 Post by kr0815 » 26 May 2016, 22:12

why not send a empty line first ? or fill up what you send with spaces ?

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: LCD display works but is not accessible from Domoticz

#8 Post by manjh » 27 May 2016, 10:04

kr0815 wrote:why not send a empty line first ? or fill up what you send with spaces ?
How? I have trouble sending spaces with the remote command.
When doing it from Domoticz dummy device, the message cuts off at the first space, the rest is ignored.
From LUA I have been playing with different ways, no success sofar.

kr0815
Normal user
Posts: 136
Joined: 18 Nov 2015, 18:24

Re: LCD display works but is not accessible from Domoticz

#9 Post by kr0815 » 27 May 2016, 12:48

I don´t have any experience with Domotics,
but looks like a problem with url-encoding
Try to send %20 instead of the space, or maybe even +20

So, instead of "this is a sentence" try "this%20is%20a%20sentence"

kunjmon
New user
Posts: 3
Joined: 31 Jul 2016, 21:22

Re: LCD display works but is not accessible from Domoticz

#10 Post by kunjmon » 31 Jul 2016, 21:43

Hi,

i think display content using following HTTP control command. i didn't try bcz i don't have device with me now

http://<ESP IP address>/control?cmd=lcd,<row>,<col>,<text>
http://<ESP IP address>/control?cmd=oled,<row>,<col>,<text>

if this work try the following lua code in domoticz.

Code: Select all

local devicename="yourdevice name"
commandArray = {}

if devicechanged[devicename] then
    commandArray['OpenURL']='10.20.30.40/control?cmd=oled,7,1,Temp:'..otherdevices_svalues[devicename]..'*C'
   end
return commandArray
i use similar lua code to update domoticz device status to dweet.io

Code: Select all

--Internal temperature
internal_temp = 'Internal Temperature'
it = tonumber(otherdevices_svalues['Internal Temperature']) --to number

--CPU Usage
cpu_usage = 'CPU_Usage'
cu = tonumber(otherdevices_svalues['CPU_Usage'])

--Water % and Ltr
water_per = 'Water %'
wp = tonumber (otherdevices_svalues['Water %'])
water_ltr = 'Water Ltr..'
wl = tonumber (otherdevices_svalues['Water Ltr..'])

--Water level distance
tank_distance = 'Distance-MysPi'
wd = tonumber (otherdevices_svalues['Distance-MysPi'])

--motion sensor
motion_sensor = 'Security Sensor'

commandArray = {}
 
 if (devicechanged[internal_temp]) then
	commandArray['OpenURL']='https://dweet.io/dweet/for/name?IntT='..it..''
 end
 
 if (devicechanged[cpu_usage]) then
	commandArray['OpenURL']='https://dweet.io/dweet/for/name?Cu='..cu..''
 end
 
  
 if (devicechanged[tank_distance]) then
	 commandArray[1] = {['OpenURL']='https://dweet.io/dweet/for/name?WD='..wd..''}
	 commandArray[2] = {['OpenURL']='https://dweet.io/dweet/for/name?Wl='..wl..''}
	 commandArray[3] = {['OpenURL']='https://dweet.io/dweet/for/name?Wp='..wp..''}
 end
 
 if (devicechanged[motion_sensor] == 'On') then
	commandArray['OpenURL']='https://dweet.io/dweet/for/name?Mos=1'
 elseif (devicechanged[motion_sensor] == 'Off') then
	commandArray['OpenURL']='https://dweet.io/dweet/for/name?Mos=0'
 end
 
return commandArray

User avatar
jsilver
Normal user
Posts: 23
Joined: 24 May 2016, 14:45
Location: Lewes, UK
Contact:

Re: LCD display works but is not accessible from Domoticz

#11 Post by jsilver » 09 Aug 2016, 12:07

kr0815 wrote:Try to send %20 instead of the space, or maybe even +20
So, instead of "this is a sentence" try "this%20is%20a%20sentence"
Alas, sending commands this way displays the %20 literally. Use the Unicode non-breaking space or hard-space character U+00A0 instead. To get this character from your keyboard, hold down Alt and type 0160 on the numeric keypad. This displays find on every LCD/OLED I've tried.

Jon

Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests