7ddt rules seperate temps

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
rolfie
New user
Posts: 4
Joined: 04 Jun 2023, 22:46

7ddt rules seperate temps

#1 Post by rolfie » 29 Jul 2023, 22:49

Hello,

I use the following code for de 8 segment display to show 2 temperatures.
on MQTT#Buiten do
7ddt,[MQTT#Buiten],[MQTT#Zwembad]
timerSet,1,300
endones
But is it possible that it's seprate? So if Buiten gets MQTT it only updates the Buiten at the 7ddt and the same for Zwembad?
Als is it possible to show the Buiten temp, but at the following 4 digits the time for example? Zwembad is only in the summer usefull, after that the temp doesn't matter.

Hope to learn something again!

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

Re: 7ddt rules seperate temps

#2 Post by TD-er » 29 Jul 2023, 23:00

Not sure if it is an autocorrect error.
But you need to end this rules block with "endon", not "endones"

So:

Code: Select all

on MQTT#Buiten do
  7ddt,[MQTT#Buiten],[MQTT#Zwembad]
  timerSet,1,300
endon
About your question...
You could store the MQTT import values in a variable.

Code: Select all

on MQTT#Buiten do
  let,1,%eventvalue% // Store "Buiten" in [var#1]
  7ddt,[var#1],[var#2]
  timerSet,1,300
endon

on MQTT#Zwembad do
  let,2,%eventvalue% // Store "Zwembad" in [var#2]
  7ddt,[var#1],[var#2]
  timerSet,1,300
endon

In another rules block, you could maybe set the time as variable #2
If it doesn't get updated, you then set the time in that variable.
Or in the handling of the MQTT#Zwembad event, you check the month and if it isn't likely that value is useful, you can then choose not to set the value as var#2 but set the time instead.

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

Re: 7ddt rules seperate temps

#3 Post by Ath » 30 Jul 2023, 15:10

The 7ddt command only supports temperature/numeric values, nothing else, but there is also the versatile 7dtext command, so you could do something like this:

Code: Select all

on MQTT#Buiten do
  let,1,%eventvalue% // Store "Buiten" in [var#1]
  event,display // also sets timer
endon

on MQTT#Zwembad do
  let,2,%eventvalue% // Store "Zwembad" in [var#2]
  event,display // also sets timer
endon

on display do
  If %sysmonth%>3 And %sysmonth% <10 // During swimming-pool season
    7ddt,[var#1],[var#2]
    TimerSet,1,300
  Else
    Let,3,%syshour% // %sysvars% don't support formatting but [...] vars do
    7dtext,"[var#1#d2.1]{D}[var#3#d2].%sysmin_0%" // Needs 'Text show periods as dot:' checkbox enabled!
    TimerSet,1,60 // Update every minute...? could maybe use "On System#Clock=All,**:** do" event instead
  Endif
endon
As said in the comment, the 'Text show periods as dot:' setting needs to be checked, so all 4 time-digits and the hour/minute separator can be shown. The display only has a period available, no colon, but that's better than no separator ;)
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 43 guests