Page 1 of 1

How to reset the RDIF Wiegand code

Posted: 23 Dec 2017, 17:41
by foxejoe
Hi,
I have just connected an RDIF Wiegand device using the EspEasy plugin and everything is ok.
I have noticed that the code of the card is memorized on the espeasy Device page and if someone has access to the wifi he can read the code.
Is there any way to set the code at 0 after certain time so that no-one can read it?

Thanks
Lorenzo

Re: How to reset the RDIF Wiegand code

Posted: 23 Dec 2017, 19:14
by grovkillen
Use rules and taskvalueset to set it to zero after successful read.

Re: How to reset the RDIF Wiegand code

Posted: 23 Dec 2017, 19:28
by enesbcs
foxejoe wrote: 23 Dec 2017, 17:41 Hi,
I have just connected an RDIF Wiegand device using the EspEasy plugin and everything is ok.
I have noticed that the code of the card is memorized on the espeasy Device page and if someone has access to the wifi he can read the code.
Is there any way to set the code at 0 after certain time so that no-one can read it?
Thanks
Lorenzo
I think you can use rules:
https://www.letscontrolit.com/wiki/inde ... rial_Rules
For example: if the wiegand device named W and it is the 2nd task in device list, with rfid in the first param, named Value:

Code: Select all

On W#Value do
 if [W#Value]>0
  timerSet,1,10
 endif
endon

On Rules#Timer=1 do
  TaskValueSet 2,1,0
endon
This way after 10 seconds from the Value has a new value, it is setted to zero. I think, but not tried. :)

Re: How to reset the RDIF Wiegand code

Posted: 23 Dec 2017, 20:37
by foxejoe
Thanks !!
It works even if the value is not set to 0 ;-) (by the way It is set to a different value than the code)

I didn't know the TaskValueSet can be used also on all variables ... I suppose it was just for the Dummy

Regards
Lorenzo

Re: How to reset the RDIF Wiegand code

Posted: 10 Feb 2020, 22:43
by alexander90
can it be that this is no longer possible with the current mega version? I cannot change the RFID value via taskvalueset. All that's left is to change a dummy.

Re: How to reset the RDIF Wiegand code

Posted: 11 Feb 2020, 19:11
by Shardan
Try to add a "taskrun <task/devicenr>" after taskvalueset

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 05:16
by xyh569923911
Homekit relay

1.Hardware interface description
1.1 Pin definition
There are eight external control pins (as shown in the figure below), which are 1. Download pin (mode), 2. Download pin (mode), 3. Rx, 4. TX, 5. 5V, 6. GND, 7. Button, 8. Button.
1.2 Introduction to relay interface
The relay controls the two external interface interfaces 1 and 2, when the relay is on conductance Interface 1 and interface 2 are in the closed state. When the relay is powered off, the two interfaces are disconnected.


1.3.How to use:
When it is necessary to use the external button to control the operation of the relay, it is only necessary to connect the 5,6 pin external 5V power supply and GND, and the button control function can be realized by shorting the 7,8 button pin.

2.Update Firmware
See:
https://github.com/SmartArduino/DoHome/ ... Smart_Plug

3. Instructions
See:
https://github.com/SmartArduino/DoHome/ ... 20To%20Use

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 08:34
by alexander90
Shardan wrote: 11 Feb 2020, 19:11 Try to add a "taskrun <task/devicenr>" after taskvalueset

Code: Select all

On W#Value do
 if [W#Value]>0
  timerSet,1,10
 endif
endon

On Rules#Timer=1 do
  TaskValueSet 2,1,0
  taskrun,2
endon
This is not working

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 11:09
by grovkillen
How often is the timer set? More than once per 10 seconds? If so the timer will never reach 0. Please look in the log.

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 12:22
by alexander90
Something is completely weird here. If I enter the command: "TaskValueSet 1,1,0" via "Tools - Command" it doesn't change anything under my Task 1 RFID.
(In my Setup the RFID Task is 1 and not 2)

espeasy taskvalueset.jpg
espeasy taskvalueset.jpg (147.51 KiB) Viewed 12751 times

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 12:34
by TD-er
Not sure if taskvalueset can be used on more than the dummy device.
Also you must call taskrun, or the combined command for set and run.


Also some plugins are written slightly different from how the call to "PLUGIN_READ" was intended.
The general idea is that PLUGIN_READ can be called when the "interval" timer has passed or when you call "taskrun" from the rules.
The values shown in the devices page can be updated by PLUGIN_READ, but also by other calls like the 10/sec or others. But only PLUGIN_READ will send out an event when the data was updated.
Such an event can be used in the rules and is also preceded by the call to sending out data to the connected controllers.

Some plugins do update the values more often, without calling PLUGIN_READ, so if you have set the values using taskvalueset, it may be those changes are overwritten immediately. (that is, if the taskvalueset even can be used on this plugin)

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 12:54
by alexander90
Okay, but it's funny that the original threat gets a working rule.

If I create a dummy, I can also change it using the taskvalueset.

As soon as I do this in a rule it doesn't work. I don't know where to start. Can you take a look at it via anydesk?

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 13:11
by Shardan
Original thread is 2017..... many things changed since then.

And i'm not sure if a "taskrun,2" works at all...
Can't test or check atm, but the command reference says "taskrun,task-nr,device-nr" if i remember right.

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 13:33
by TD-er
taskrun should work on any plugin (or more exact a task)

It only expects 1 parameter, which is the task number.

Just to get the used words right:
Implementation of support for a device (e.g. a sensor or display) is called a plugin.
You may have several instances of a plugin active on the node, so a selected plugin we call a task.

The items you see in the table on the "Devices" tab in the browser is a list of tasks.

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 20:37
by alexander90
I found a solution to this problem, although it is not my favorite ...

At first I didn't know that in the new engine the rule name had to be the same as the event. So to stay with this example "W # Value". Only then is the rule actually carried out ...
This does not change the problem that the Wiegand values ​​cannot be overwritten via TaskValueSet.

Accordingly, I created a dummy that receives the same value after changing the Wiegand Reader and changes the value of the dummy to 0 after 2 seconds using TaskValueSet.

It is just a bit stupid that the Mqtt message is carried out with the dummy by an interval and not by change (as with the other plugins).
No matter an interval of 1 second is acceptable to me.

I hope I could shed some light on this if someone stumbles across this threat ...

Re: How to reset the RDIF Wiegand code

Posted: 12 Feb 2020, 23:59
by TD-er
Just be aware that when you store long integer numbers in a float, you will loose precision.
So there will not be an exact match on RFID strings any more after storing it in a float of a dummy task value.

It doesn't seem like you do it now, but you may end up there on future experiments.