named variables wont work

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Rampler
Normal user
Posts: 108
Joined: 31 Dec 2016, 07:13

named variables wont work

#1 Post by Rampler » 18 Apr 2025, 15:15

I use this release:
ESP_Easy_mega_20250402_normal_ESP8266_4M1M

This sample wont work:

Code: Select all

on Clock#Time=All,**:** do
  Let,kv,3
  LogEntry,'kv=%kv% o. kv=[var#kv]'
  If [var#kv] = 3
    LogEntry,'HIT'
  endif
endon

EVENT: Clock#Time=Fri,15:15
2810109: ACT : Let,kv,3
2810114: ACT : LogEntry,'kv=%kv% o. kv='
2810116: kv=%kv% o. kv=


Whats wrong ?

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

Re: named variables wont work

#2 Post by TD-er » 18 Apr 2025, 15:42

When using the %v...% notation, you need to format it like this:
%v_name% with "name" being the name of your variable.

See the description Ton added here: https://github.com/letscontrolit/ESPEasy/pull/5284

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

Re: named variables wont work

#3 Post by TD-er » 18 Apr 2025, 15:47

So your rules should be something like this (not tested)

Code: Select all

on Clock#Time=All,**:** do
  Let,kv,3
  LogEntry,'kv=%v_kv% o. kv=[var#kv]'
  If [var#kv] = 3
    LogEntry,'HIT'
  endif
endon

Also some minor detail...
This was merged on April 10th.

I will trigger a new build so people can start testing.
I have disabled automatic GH-Actions builds, as I got a notification about our excessive use.
When we would continue using it as we did, it might cost about 600 euro a month, which I'm obviously not going to pay.
So we have to look into running our own GH Actions build server/service.

Rampler
Normal user
Posts: 108
Joined: 31 Dec 2016, 07:13

Re: named variables wont work

#4 Post by Rampler » 18 Apr 2025, 15:55

Thank you, for this minor detail. ;)

I wll test it again, when the build is ready ..

Rampler
Normal user
Posts: 108
Joined: 31 Dec 2016, 07:13

Re: named variables wont work

#5 Post by Rampler » 18 Apr 2025, 16:04

You saved my day !!
Now it is working as execpted - THNAK YOU !!

Rampler
Normal user
Posts: 108
Joined: 31 Dec 2016, 07:13

Re: named variables wont work

#6 Post by Rampler » 18 Apr 2025, 16:15

I was in hope, that we get today the "EASTER release" ....
:roll: :shock: :lol:

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

Re: named variables wont work

#7 Post by TD-er » 18 Apr 2025, 18:13

I will discuss with Ton.
We didn't have the usual 'please test' run and there was at least one serious issue reported regarding not starting AP-mode and/or switching from Ethernet to WiFi which needs to be looked into.

User avatar
chromo23
Normal user
Posts: 1001
Joined: 10 Sep 2020, 16:02
Location: germany

Re: named variables wont work

#8 Post by chromo23 » 18 Apr 2025, 22:38

TD-er wrote: 18 Apr 2025, 15:47 I have disabled automatic GH-Actions builds, as I got a notification about our excessive use.
When we would continue using it as we did, it might cost about 600 euro a month, which I'm obviously not going to pay.
So we have to look into running our own GH Actions build server/service.
What is the limit for the "free plan"? And how can an innocent bystander like me help :)

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

Re: named variables wont work

#9 Post by TD-er » 18 Apr 2025, 23:26

Well since we are an OpenSource repository, there should not be a hard limit.
However a while ago, we suddenly were no longer able to make GH Actions builds anymore until we "updated our payment details".
Well that's a bit scary, so I looked into it and apparently we used about 70'000 minutes in that month and that was about halfway the month.
The limit for a 'free tier' is 2000 build minutes.

And to give some idea, a single GH Actions build takes about 800 - 1000 build minutes as there are 20 workers running.

There are some optimizations possible to reduce the number of build minutes, but that also takes some tuning and testing.
For example, I could dedicate some runners to only build specific build envs so we can optimize cache usage.
And I still need to look into how we can integrate the compile-time-defines to further optimize cache usage.
But that's nothing more than a simple kludge to patch stuff, without dealing with the real problem which is that cloud-hosted compute power is expensive, even when it is free.

So we really need to look into hosting our own GH-actions worker.
I do have a build-PC ready for this (bought from the money sent by users) and a fast and stable internet connection.
Also during the day, I do have way more energy available than would be needed to build... well at least when my current contract ends as by then I won't get anything for my PV-generated kWh's anymore.

Only thing I need is some time to setup those GH Actions workers in such a way that it is also safe to run in my own network.

Rampler
Normal user
Posts: 108
Joined: 31 Dec 2016, 07:13

Re: named variables wont work

#10 Post by Rampler » 19 Apr 2025, 07:47

TD-er wrote: 18 Apr 2025, 23:26 Only thing I need is some time to setup those GH Actions workers in such a way that it is also safe to run in my own network.
That would give me the biggest headache ..

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

Re: named variables wont work

#11 Post by TD-er » 19 Apr 2025, 11:38

Yep, that's why I am now changing my network here.
I did have 'smart' switches from TP-link.
Since the last update of my Fritzbox, I have the option to monitor traffic of devices in my network.
So just for fun I also added my TP-link switches to be monitored.
To my surprise, at least one of those had way more traffic to the internet than expected. Typically a few 100 bytes a day for NTP-like traffic would be expected.
But not 10's of MBs per day.
I have no idea what kind of traffic it is. It could simply be some firmware-bug or wrong configuration.
But since there are enough rumours of TP-link devices with "extras", I don't want to take a chance here.

So I decided to replace all of them after blocking traffic from those of course.

So my new network setup will consist of mainly MikroTik switches, some of which also have routing and filtering capabilities.
Also the Fritzbox does have a separate guest network, which is quite well isolated from the rest of the network.
The VMs running as GH-Actions workers will be only accessible via that separate VLAN and maybe I will also route it through one of those switches capable of routing to make sure I add some extra firewall rules.

And due to upcoming changes in energy tariffs here in the Netherlands, where I will not get anything anymore from the PV-energy I will export into the net, the workers will be synchronized with the weather and my own power consumption.

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

Re: named variables wont work

#12 Post by Ath » 20 Apr 2025, 17:17

Rampler wrote: 18 Apr 2025, 15:15 I use this release:
ESP_Easy_mega_20250402_normal_ESP8266_4M1M
I've fixed a bug, found in the pre-release build from yesterday, and created a test-build for you for validation.
Can you please test your rules (and possibly somewhat more complex calculations) using this build?
ESP_Easy_mega_20250420_normal_ESP8266_4M1M.zip
(1.3 MiB) Downloaded 13 times
/Ton (PayPal.me)

Rampler
Normal user
Posts: 108
Joined: 31 Dec 2016, 07:13

Re: named variables wont work

#13 Post by Rampler » 22 Apr 2025, 19:47

Sorry for my late answer ..
I can't detect any issues with the release. Tested on three ESP8266s

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 13 guests