7 segment display: toggle modes?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

7 segment display: toggle modes?

#1 Post by oisisi » 05 Oct 2021, 21:31

I looked through the code of the respective plugin (_P073_7DGT.ino) but I may have missed it: is there a command to toggle between one of the clock modes and 'manual' modes?

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

Re: 7 segment display: toggle modes?

#2 Post by TD-er » 05 Oct 2021, 21:43

Have you tried the commands listed in the documentation? https://espeasy.readthedocs.io/en/lates ... -available

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#3 Post by oisisi » 05 Oct 2021, 21:50

TD-er wrote: 05 Oct 2021, 21:43 Have you tried the commands listed in the documentation? https://espeasy.readthedocs.io/en/lates ... -available
Yes, of course but there is no command mentioned to switch modes. I tried the one to set the time but that does not really activate the clock mode.

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#4 Post by Ath » 05 Oct 2021, 21:59

Ah, you need a '7output,<output>' command. I'll see what I can do about that :idea:

Edit: Changed 7mode to 7output.
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#5 Post by oisisi » 05 Oct 2021, 22:25

Ath wrote: 05 Oct 2021, 21:59 Ah, you need a '7output,<output>' command. I'll see what I can do about that :idea:

Edit: Changed 7mode to 7output.
Thanks for looking into this. Take your time. A workaround for me is that I generate and send the text via MQTT from Node RED every 30 seconds, alternating between time and temperature.

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#6 Post by Ath » 05 Oct 2021, 22:33

Well, that can also be achieved by some rules "magic" (well, not really magic, just rules :lol:)

Code: Select all

on system#boot do
  LooptimerSet,1,30
endon

on Rules#Timer=1 do
  if %v1%=0
    7dst,%syshour%,%sysmin%
  else
    7dt,[BME280#Temperature]
  endif
  let,1,!%v1% // Invert
endon
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#7 Post by Ath » 05 Oct 2021, 22:49

Created pull request #3797 to add the 7output command.
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#8 Post by oisisi » 06 Oct 2021, 09:09

Ath wrote: 05 Oct 2021, 22:33 Well, that can also be achieved by some rules "magic" (well, not really magic, just rules :lol:)
Thanks. My sensor#value would be bmx280#temperature but it seems the command isn't working. I publish '7dt,[bmx280#temperature]' to the board's cmd topic and nothing is happening. The firmware is quite old (mega-20190817), I guess I'll freshen it once your pull request is implemented.

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#9 Post by oisisi » 06 Oct 2021, 09:21

Ath wrote: 05 Oct 2021, 22:49 Created pull request #3797 to add the 7output command.
Awesome! I'll report back once it appears in the next built.

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#10 Post by Ath » 06 Oct 2021, 09:29

I can supply a .bin here if you state what type of ESP (CPU and Flash size, just type the name of the currently used .bin file) you are using.
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#11 Post by oisisi » 06 Oct 2021, 09:37

Ath wrote: 06 Oct 2021, 09:29 I can supply a .bin here if you state what type of ESP (CPU and Flash size, just type the name of the currently used .bin file) you are using.
My module is a Wemos D1 mini with a 4M bin. If I remember correctly, I built the image myself since the IR receiver plugin wasn't part of the normal binary. It looks like it is now.

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#12 Post by Ath » 06 Oct 2021, 11:32

The P073 (7DGT) plugin is not included in the custom_IR or minimal_IR builds, so I either have to create a special custom_IR build for you, or you get that PR local and build it yourself.
Or you could test on a normal build, but that'll be missing the IR plugins.

Normal build (NO IR INCLUDED!)
ESPEasy_normal_ESP8266_4M1M.zip
(2.3 MiB) Downloaded 167 times
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#13 Post by oisisi » 06 Oct 2021, 12:00

Thanks. I think I don't have my build environment anymore so I might test the binary on a different module. I thought that TSOP4838 IR receiver support is part of the normal build now.

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#14 Post by Ath » 06 Oct 2021, 12:10

Hmm, no it isn't, actually, the documentation is wrong there (should state 'IR' instead of 'NORMAL'). I'll try to fix that soon.

I'll create a custom_IR build including P073 in the evening (CET).
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#15 Post by oisisi » 06 Oct 2021, 12:36

I tested mode switching successfully. I can switch from clock mode to manual to temperature mode and back to clock mode via command without issues. Thanks for your efforts.

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#16 Post by Ath » 06 Oct 2021, 12:42

Great! Thanks for reporting back.
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#17 Post by Ath » 06 Oct 2021, 21:19

I've done some small changes, so when 7output or 7db commands are used, the new setting is reflected in the configuration (7font already did that), and a save command would then save the new settings.

Here's a minimal_IRext build with the 7digit plugin included:
ESP_Easy_mega_20211006_minimal_IRext_ESP8266_4M1M.zip
(569.71 KiB) Downloaded 167 times
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#18 Post by oisisi » 07 Oct 2021, 07:11

Thank you again. Since minimal does not include all my sensors I will dig out my old cloned repository, sift through the configs and try to refresh it.

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#19 Post by Ath » 07 Oct 2021, 15:05

You can provide a list of plugins you require, and I can create a build with those (adding them to the minimal_IR build for now, that's quite easy (for me) to do).
Not sure if that will be a regular configuration though, as the IR plugins have been moved out of the 'normal' and 'test' builds because of the size of the plugins and the required libraries (the .bin file became too big).
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#20 Post by oisisi » 07 Oct 2021, 15:21

Thank you for the kind offer. I use these sensors/plugins:

Environment - BMx280,
Light/Lux - TSL2561,
Output - NeoPixel (Basic),
Switch input - Switch,
Communication - TSOP4838,
and, of course,
Display - 7-segment display.

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#21 Post by Ath » 07 Oct 2021, 20:31

I've based this on the 'custom_IR' configuration, and included the plugins mentioned:
ESP_Easy_mega_20211007_custom_IR_ESP8266_4M1M.zip
(635.09 KiB) Downloaded 169 times
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#22 Post by oisisi » 07 Oct 2021, 21:33

It works perfectly, thank you @Ath. I can now switch between modes via command, this is perfect.
Interestingly, the web gui also seems much more responsive in comparison to my version from two years ago.

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#23 Post by Ath » 07 Oct 2021, 21:42

Great.
Please keep in mind that this a quite specialist, lets call it customized-custom, build. And strangely enough, the 'custom_IR' build didn't include the IR receiver and sender plugins :shock:

There have been many improvements to ESPEasy since 2019, and one of them, mostly done in 2021, is the quite improved UI responsiveness, achieved mostly by many WiFi improvements. TD-er has been quite busy :)
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#24 Post by oisisi » 08 Oct 2021, 15:56

Ath wrote: 07 Oct 2021, 21:42 Please keep in mind that this a quite specialist, lets call it customized-custom, build.
I feel special. :oops:

Minor observations: either I can't find the log view or it is missing in the special build. Where would it be? Additionally, it seems that the IP address is no longer logged to the serial console or I need to raise the log level. Both are no issues for me since I can forward the output to a syslog host and can find the IP from my DHCP server.

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#25 Post by oisisi » 08 Oct 2021, 16:47

Ath wrote: 05 Oct 2021, 22:33 Well, that can also be achieved by some rules "magic" (well, not really magic, just rules :lol:)

Code: Select all

on system#boot do
  LooptimerSet,1,30
endon

on Rules#Timer=1 do
  if %v1%=0
    7dst,%syshour%,%sysmin%
  else
    7dt,[BME280#Temperature]
  endif
  let,1,!%v1% // Invert
endon
I think you forgot to re-set the timer. For posterity, here's what is working for me:

Code: Select all

on system#boot do
  timerSet,2,1
  7output,0
endon

on Rules#timer=2 do
  if %v1%=0
    7dst,%syshour%,%sysmin%
  timerSet,2,10
  else
    7dt,[bmx280#temperature]
  timerSet,2,5
  endif
  let,1,!%v1% // Invert
endon

User avatar
Ath
Normal user
Posts: 3417
Joined: 10 Jun 2018, 12:06
Location: NL

Re: 7 segment display: toggle modes?

#26 Post by Ath » 08 Oct 2021, 22:09

No, I used the LoopTimerSet command, that is re-fired at the configured interval, but has been added in a 2020-somewhere release :D https://espeasy.readthedocs.io/en/lates ... optimerset
/Ton (PayPal.me)

oisisi
Normal user
Posts: 86
Joined: 06 Jul 2016, 13:47

Re: 7 segment display: toggle modes?

#27 Post by oisisi » 08 Oct 2021, 22:59

I stand corrected and I apologize. I've been literally out of the loop about all the improvements. It seems that now I can flash my RGB LEDs in shorter intervals than just in seconds, cool.

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

Re: 7 segment display: toggle modes?

#28 Post by TD-er » 08 Oct 2021, 23:15

oisisi wrote: 08 Oct 2021, 22:59 I stand corrected and I apologize. I've been literally out of the loop about all the improvements. It seems that now I can flash my RGB LEDs in shorter intervals than just in seconds, cool.
And lots and lots of other new features :)

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests