Displaying an internal value from the display (pwm,state)

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
judie07
New user
Posts: 5
Joined: 26 Dec 2022, 12:58

Displaying an internal value from the display (pwm,state)

#1 Post by judie07 » 26 Dec 2022, 13:14

• ESP8266 NodeMCU with OLED (64x48) SSD1306.
• Flashed with: ESP_Easy_mega_20221105_display_ESP8266_4M1M.bin
Can an internal value e.g. „PWM, state“ be set see "Status,G,14"?{
"log": "",
"plugin": 1,
"pin": 14,
"mode": "PWM",
"state": 20
}
output via the display? OK this is NOT how it works! ==>"Demo.:[status,G,14#state]"
Image


judie07
New user
Posts: 5
Joined: 26 Dec 2022, 12:58

Re: Displaying an internal value from the display (pwm,state)

#3 Post by judie07 » 26 Dec 2022, 16:50

THANKS, Almost perfect, for static values 1/0 ok but how can I read the value PWM,state, because with me is displayed only alternately 0 or 1!

{
"log": "GPIO: 14 duty: 300",
"plugin": 1,
"pin": 14,
"mode": "PWM",
"state": 300
}

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Displaying an internal value from the display (pwm,state)

#4 Post by TD-er » 27 Dec 2022, 00:23

The PWM state isn't made available yet via this.

judie07
New user
Posts: 5
Joined: 26 Dec 2022, 12:58

Re: Displaying an internal value from the display (pwm,state)

#5 Post by judie07 » 29 Dec 2022, 17:03

OKAY THANKS,
the consideration with the query was not quite correct, because the 8266 does not calculate this value itself!
I pass the required value to an "Internal variables" and let this be shown on the display -
This works so (PWM [var#1]) but what does not work, is the setting of the value in a "Rules"
not so

Code: Select all

on %v1% do
   pwm,14,[var#1]
endon
and also not so

Code: Select all

on [var#1] do
   pwm,14,[var#1]
endon

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Displaying an internal value from the display (pwm,state)

#6 Post by TD-er » 29 Dec 2022, 17:15

Both will not work, as you cannot have variables like that in the on...do line.
You need to act on an event and there is no event with only numeric values in the event name.

also there should be no [] in the on..do line
For example if you want to act on a new task value (e.g. bme#temp), then you should use

Code: Select all

on bme#temp do
And not

Code: Select all

on [bme#temp] do
When parsing rules lines, all occurences with %....% or [...] will be replaced by their respective numerical values first.

judie07
New user
Posts: 5
Joined: 26 Dec 2022, 12:58

Re: Displaying an internal value from the display (pwm,state)

#7 Post by judie07 » 29 Dec 2022, 18:46

Thanks again for the info
(You need to act on an event and there is no event with only numeric values in the event name.)
This is how it works now: =>
http://192.168.178.xxx/control?cmd=even ... trolset=97

Code: Select all

On pwmcontrolset do
   pwm,14,%eventvalue%  // for the GPIO PIN
   let,1,%eventvalue%     // for the Display
endon
For all =>
https://espeasy.readthedocs.io/en/lates ... eventvalue

Post Reply

Who is online

Users browsing this forum: No registered users and 145 guests