Hi all
Sorry for a newbie question.
I have most of my scripts in Blockly but sometimes they stop working (I have no idea about why!) and I have to re-write the exact same code again and save to make it work again.
Now I am trying to replace the Blockly code with Dzvents but since I don't know much about programming I am kind of stuck.
I have managed to write some scripts with timer functions that trigger devices at certain times.
Now i am trying to get my RFID reader to trigger a virtual device but I can't understand how to write it.
It is a Zipato Mini RFiD Keypad.
The Blockly code run something like this:
If RFID=On then turn virtual device On
Another script would be:
If RFID=Off then turn virtual device Off
Any takers?
Best regards
Peter
RFID [Solved]
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: RFID [Solved]
This should do it. Please also take some time to have a look at the dzVents wiki
Code: Select all
return
{
on = { devices = { 'Exact name of RFID device' }}, -- change
execute = function(dz, item)
dz.log('State of Device ' .. item.name .. ' is now ' .. item.state, dz.LOG_INFO)
local follower = dz.devices('Exact name of your virtual device') -- change
if item.state == 'On' then
follower.switchOn()
else
follower.switchOff()
end
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest