Me and copilot.

21 views
Skip to first unread message

Samir Arishy

unread,
Jun 12, 2024, 10:07:38 PMJun 12
to TasmotaUsers
I asked copilot to do the following rule:
at power off display the time of the off then publish it.
here is the response:
Rule1
ON Power1#State=0 DO
  Var1 %time%
  Log "Device turned off at %Var1%"
  publish cmnd/tasmota/Var1 %Var1%
ENDON

The pubshing never happened. My guess is Tasmota does not do that and it is my misunderstanding that causing the problem.

I would like to aplogize for using AI, but I thought it is patient enough to deal with beginners.

Justin Adie

unread,
Jun 13, 2024, 1:37:01 AMJun 13
to Samir Arishy, TasmotaUsers
You have the grammar incorrect.  

Rule1 On
 power1#state=0 do backlog var1 %time%; publish yourtopic {"power_off_event":%time%} endon


However this is unnecessary because the power off event will be published to mqtt anyway.  So it would surely be better to set up an MQTT listener somewhere and log the power off events traditionally.  

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/9678ca5e-3aa3-413b-895c-8edc576daeb5n%40googlegroups.com.

Philip Knowles

unread,
Jun 13, 2024, 1:40:08 AMJun 13
to Samir Arishy, TasmotaUsers
Artificial Intelligence isn't 'intelligent' it needs to copy tots of people's work and rehash it. There will unlikely ever to be enough good examples in the public domain for it to make sensible suggestions. If you spend 5 minutes reading the Rules page (and understanding how Tasmota works) you would know why that rule would NEVER work.
%time% gives you minutes past midnight
Assigning a value to a var automatically publishes to stat/<topic>/ Artificial Intelligence isn't 'intelligent' it needs to copy tots of people's work and rehash it. There will unlikely ever to be enough good examples in the public domain for it to make sensible suggestions. If you spend 5 minutes reading the Rules page (and understanding how Tasmota works) you would know why that rule would NEVER work.
%time% gives you minutes past midnight
Assigning a value to a var automatically publishes to stat/<topic>/ RESULT
cmnd is used for commands tele or stat should be used for data
Log isn't a Tasmota command
Backlog needs to be used after do if there is more than one command
; needs to be used to separate the commands
Rule1 on power1#state=0 do var1 %timestamp% endon
Rule1 1
Might do what you want





From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Samir Arishy <ari...@gmail.com>
Sent: 13 June 2024 03:07
To: TasmotaUsers <sonof...@googlegroups.com>
Subject: Me and copilot.
Reply all
Reply to author
Forward
0 new messages