Auto download a file on wifi#connected #21325
Replies: 5 comments 3 replies
-
Where ate you going to fetch the remote file?
Could be there a mqtt app suscribed to device online notification, and send
the mqtt timer cmds?
El El vie, 3 may. 2024 a la(s) 04:19, paolomeraviglia <
***@***.***> escribió:
… Hi there,
I have a sonoff th10 in a remote place without stable wifi connection and
would like to automate some on/off functions using timers.
The state depends by electricity cost, 'cause the relay will control a
control line (not the load) for my EV charging box that will let the
charger to run or to shut.
The requirements are these:
1. the provider publish every midday the timers for the next day that
would define high rate times and low rate. I should enable timers
accordingly and update them in an automated way, pushing timers for the
running day and the next one.
2. the device will not be connected to internet exept when I will
arrive with my car at the garage, so my android phone will turn up
automatically an hotspot providing connection as soon as my android auto
will disconnect.
The process I thought about is this:
- the sonoff will find the wifi connection, and using a rule triggered
by Wifi#connected will download a file that will contain some commands
(example provided below)
- the commands will be interpreted accordingly (like with function
UfsRun) and the file will be generated on runtime (so, the time will be out
of sync just by seconds... fair enough)
Actual limits:
- UrlFetch seems to work just on ESP32, so cannot be used
- TH10 has a 1M Flash, so no UFS is enabled by default
What is working:
- I already have the server part that will produce the file containing
all the commands
Is there a way to achieve this with a sonoff TH10? Ideas?
here the file example:
Timers 1 Timer1
{"Enable":1,"Mode":0,"Time":"00:00","Window":0,"Days":"-----1-","Repeat":0,"Output":1,"Action":1}
Timer2
{"Enable":1,"Mode":0,"Time":"05:00","Window":0,"Days":"-----1-","Repeat":0,"Output":1,"Action":0}
Timer3
{"Enable":1,"Mode":0,"Time":"22:00","Window":0,"Days":"-----1-","Repeat":0,"Output":1,"Action":1}
Timer4
{"Enable":1,"Mode":0,"Time":"03:00","Window":0,"Days":"------1","Repeat":0,"Output":1,"Action":0}
Timer5
{"Enable":1,"Mode":0,"Time":"18:00","Window":0,"Days":"------1","Repeat":0,"Output":1,"Action":1}
Timer6 {"Enable":0 } Timer7 {"Enable":0 } Timer8 {"Enable":0 } Timer9
{"Enable":0 } Timer10 {"Enable":0 } Timer11 {"Enable":0 } Timer12
{"Enable":0 } Timer13 {"Enable":0 } Timer14 {"Enable":0 } Timer15
{"Enable":0 } Timer16 {"Enable":0 } Power1 0 Time <epoch> Backlog Latitude
47.4133024; Longitude 8.656394; TimeDST 0,0,3,1,1,120; TimeSTD
0,0,10,1,1,60; TimeZone 99
—
Reply to this email directly, view it on GitHub
<#21325>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXBW4O3PE77TUNEQJ6C73DZAM27PAVCNFSM6AAAAABHFAU7BSVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGU4TSNBRGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You can also push mqtt retained messages, that will be quipped at 5he
server until the device logs in.
El El sáb, 4 may. 2024 a la(s) 05:11, paolomeraviglia <
***@***.***> escribió:
… Thanks for the answer,
an mqtt instance could be a possible solution, but would increase the
complexity and maintenance over time.
For now, I could self host a static http server for this, but I was also
thinking about pushing that file and update that file on a dedicated GitHub
repo.
in the GitHub repo case, ignore the lines "Time " and "Power1 0", that
would not work as intended.
—
Reply to this email directly, view it on GitHub
<#21325 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACXBW4KJGEFSUTKZPT64LDTZASJ4JAVCNFSM6AAAAABHFAU7BSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TGMJSGI3TA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
There's no easy solution for that on ESP8266 for now |
Beta Was this translation helpful? Give feedback.
-
Doing via mqtt is probably not a pain to maintain. Grab the file with a system "translate" and publish the info to the mqtt broker. The Tasmota device fetches the info and adjust the timers accordingly. |
Beta Was this translation helpful? Give feedback.
-
@paolomeraviglia It still need to be approved Note that it will not be included in any default build and you will have to custom-build to get the feature |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I have a sonoff th10 in a remote place without stable wifi connection and would like to automate some on/off functions using timers.
The state depends by electricity cost, 'cause the relay will control a control line (not the load) for my EV charging box that will let the charger to run or to shut.
The requirements are these:
The process I thought about is this:
Actual limits:
What is working:
Is there a way to achieve this with a sonoff TH10? Ideas?
The file will be 1-2KB.
I though also about using
webgetconfig
, but seems a little more complicated also with the automatic reboot after the config download.here the file example:
Beta Was this translation helpful? Give feedback.
All reactions