![]() |
|
Script with Tag condition - Printable Version +- LogicMachine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Script with Tag condition (/showthread.php?tid=6416) |
Script with Tag condition - Domoticatorino - 05.05.2026 Code: -- 1. MAPPATURA: "Tag del Sensore" -> "Tag dell'Abilitazione"Hi everybody, with this script I would like to send a notification (by mail) if an alarm sensor (tag alarm) goes to true but only if this sensor own to a sector (tag "area_x_sector_x) is armed. The sensor has a second tag "sensore_area_x_settore_x) in order to verify if it owns to the sector armed. It does not work because the tag value is empty. How can be possible? Is it possible to use 2 tags for a grp address? Thanks. RE: Script with Tag condition - admin - 05.05.2026 Yes, you can assign multiple tags to a group address. Your script does not work because grp.find() does not return assigned tags as a table. Use grp.gettags(alias) instead. You should add some extra checks so that an email is only sent once, not on every detection. RE: Script with Tag condition - Domoticatorino - 05.05.2026 (6 hours ago)admin Wrote: Yes, you can assign multiple tags to a group address. Thank you Admin! Do you mean to use the following command instead: local oggetto_allarme = grp.gettags(addr_sorgente) But grp.gettags it should be blue. But it is not. It is correct? Thanks. RE: Script with Tag condition - admin - 05.05.2026 grp.gettags is missing from the highlighted function list but it does not affect the actual script. |