ooooooooops
I use a BC327
Moderators: grovkillen, Stuntteam, TD-er
Code: Select all
print "|s,i1,sOn" // Send idx 1 and value 1 to ESPEasy
printh 0a // Required print termination character
Code: Select all
cov h0.val,t1.txt,0
print t1.txt
Code: Select all
page0.t0.txt="%systm_hm_am%"
Code: Select all
http://192.168.1.158/control?cmd=NEXTION,page0.t0.txt="%systm_hm_am%"
Code: Select all
NEXTION075 : WRITE, Command is page0.t0.txt='
Code: Select all
NEXTION075 : WRITE, Command is page0.t0.txt='%systm_hm_am%'
You must convert the Nextion touch move event's slider val to a text string. Like this (see Nextion commands summary for details):How do I get the Slider to output its value through "idx" or "value"?
Code: Select all
cov h0.val,t0.txt,0
Code: Select all
print "|s,i"
cov h0.val,t0.txt,0
print t0.txt
print ",sOff"
printh 0a
Put the page0.t0.txt="%systm_hm_am%" command in the Lines Statement area and select an interval. Disable Resend Values.I can't use the "Resend Values (below) at Interval:" to constantly update a clock on my main page with page0.t0.txt="%systm_hm_am%" because it will also constantly send the latest idx/value and it makes my Home Automation system keep receiving that and it keeps activating the event (in this case toggle lighting).
http writes to Nextion plugin do not support ESPEasy system variables. Use Lines or rules if you need to work with the system variables.Why does it work fine in the "Nextion Command Statements (Optional)" section when I add it as a Line, but not when I do http?
If you go to https://www.letscontrolit.com/, then click ESP Easy and Wiki, then in the left column click ESP Easy and on the next page on 4 Supported Sensors/Actuators. and Again on Supported Sensors/Actuators, you get a whole list of supported devices.
Ah, nice. I did not know that. I was looking for that for quite some time.BTW, there's a hot link built into the Nextion plugin. So access to Nextion's technical wiki is click-accessible from within the plugin.
- Thomas
Navigating to the Nextion information isn't convenient, but it is functional. The criticism isn't unique to Nextion since all the plugins' wiki pages are found in the same way. Someone (not me) would need champion the creation of something better.If you go to https://www.letscontrolit.com/, then click ESP Easy and Wiki, then in the left column click ESP Easy and on the next page on 4 Supported Sensors/Actuators. and Again on Supported Sensors/Actuators, you get a whole list of supported devices.
@TD-er, is it possible to add this modification to the plugin?ThomasB wrote: ↑13 Aug 2018, 21:38 @BertB: Try this:
Find the code shown below in Nextion.ino's PLUGIN_WRITE: section:
Change it to:Code: Select all
String log = F("NEXTION075 : WRITE, "); log += F("Command is "); log += (tmpString.c_str()); addLog(LOG_LEVEL_INFO, log); success = true; // Set true only if plugin found a command to execute.
Your browser should now reply with a copy of the sent write action.Code: Select all
String log = F("NEXTION075 : WRITE, "); log += F("Command is "); log += (tmpString.c_str()); addLog(LOG_LEVEL_INFO, log); SendStatus(event->Source, log); // Send status to http or controller. success = true; // Set true only if plugin found a command to execute.
- Thomas
Hi Quorle,
I suggest that you wait for the updated plugin to appear in the nightly builds. I don't know when this will happen, so check often.I could not install your latest update. Arduino Ide gives a lot of mistakes.
I don't have any experience with domoticz. But BertB is using it, so maybe he will drop by and provide advice.I have domoticz with button (swith type on/off- IDX3) and temperature sensor bme280-idx1.
i have nextion touch display
Code: Select all
on STH#Sw-Lamp do
if [STH#Sw-Lamp]=0
Nextion,page0.bt0.val=0
endif
if [STH#Sw-Lamp]=1
Nextion,page0.bt0.val=1
endif
endon
Code: Select all
on STH#Sw-Lamp do
if [STH#Sw-Lamp] = 0
Nextion,page0.bt0.val=0
else
Nextion,page0.bt0.val=1
endif
endon
Code: Select all
-- we need this function to send the quotes around the values
function url_encode(str)
if (str) then
str = string.gsub (str, "\n", "\r\n")
str = string.gsub (str, "([^%w %-%_%.%~])",
function (c) return string.format ("%%%02X", string.byte(c)) end)
str = string.gsub (str, " ", "+")
end
return str
end
countervalueintext = otherdevices_svalues['Counter'] --this values can be for example 88.5 or 1433.2, just like temperature can be 2.3 or -4.4)
countervalueinquotes = '"' ..countervalueintext.. '"' --First part of the magic
commandArray = {}
print('Counter = '..countervalueintext) --This shows up in Domoticz log
counter =tonumber(countervalueintext) -- If you want to compare numeric values, see example later on
if (devicechanged['Counter'])then --If value changes of device SolarEnergyLive
os.execute('curl -s "http://192.168.x.x/control?cmd=NEXTION,page2.t7.txt=' .. url_encode(countervaluesinquotes) .. '"') --sending value to textbox in quotes
print('Sending data to Nextion') --This shows up in Domoticz log
return commandarray --execute the commands
end --To close the If
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
1. When you issue your http command from a web browser, does the browser show a response that looks like this?In Nextion, I have a textfield named "WZt", when I am tying to send esp_ip/control?cmd=NEXTION,page0.WZt.txt="hallo" nothing happens.
Code: Select all
NEXTION075 : WRITE = page0.WZt.txt="hallo"
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
That confirms the Nextion plugin is active.Yes, the browser shows me exactly the response that you've posted.
Code: Select all
And no, the "24.5" doesn't appear on the Nextion.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Glad to hear you got it working.Works absolutely perfect now.
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Up to 115200 is supported as far as I know but if the plugin is programmed for 9600 I guess setting it to something else will make the communication miss.Wiki wrote: ↑29 Oct 2018, 17:40 Hi,
Thanks a lot for the efforts you have had with the plugin. The WAF (women's acceptance factor) raised up to 100%.
Short question: using the original RX/TX hard serial on the Wemos D1 mini (GPIO3/1) works 100% reliable (opposite to the soft serial) - you described this some pages earlier. But if I'm configuring the speed higher than 9600 I get no connection to the Nextion. Normal behaviour?
Users browsing this forum: Ahrefs [Bot] and 44 guests