# Send tag value every 2 hours

**URL:** <https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [September 14, 2022, 4:18pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065 "2022-09-14T16:18:51Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [September 14, 2022, 4:18pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/1 "2022-09-14T16:18:51Z")

</div>

I need to set up an alarm that sends a tag value every 2 hours, I am thinking of using any change mode in the alarm

Do you have any ideas? the value of the tag is important and we need to know by mail or text what is value every 2 hours

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 14, 2022, 4:20pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/2 "2022-09-14T16:20:34Z")

</div>

No need for an alarm. Just use a gateway timer event script to read the value and send the email.

---

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [September 14, 2022, 4:21pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/3 "2022-09-14T16:21:46Z")

</div>

Thanks for the reply, you always help me, and I never forget

How about text?

---

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [September 14, 2022, 4:25pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/4 "2022-09-14T16:25:12Z")

</div>

I already set up text messages and the managers like it, they asking me to set up text message for the tags value too

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 14, 2022, 4:25pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/5 "2022-09-14T16:25:52Z")

</div>

Haven’t done this with text, sorry. Will need an alarm after all, and a special pipeline to collect the tag value.

---

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [September 14, 2022, 4:27pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/6 "2022-09-14T16:27:44Z")

</div>

How I can use the alarm with any change mode, yes, will use pipeline

---

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [September 14, 2022, 4:30pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/7 "2022-09-14T16:30:39Z")

</div>

I know how I can get the tag value and I know how I can set up the pipeline, just need some help to send an alarm every 2 hours no matter the condition

no dropout is needed the massage should have to send

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 14, 2022, 4:34pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/8 "2022-09-14T16:34:57Z")

</div>

So the alarm wouldn’t be on the tag. It would be on an expression tag that yields the minutes value from `now()`. Set the alarm to trigger when the value is zero. Include the other tag in the alarm’s [associated data](https://docs.inductiveautomation.com/display/DOC79/Alarm+Associated+Data). That will let you use it in the notification’s block’s message (I think).

---

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [September 14, 2022, 4:38pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/9 "2022-09-14T16:38:09Z")

</div>

Yes, Sir, I think that should work  
You Rock

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 14, 2022, 4:48pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/10 "2022-09-14T16:48:00Z")

</div>

I’ve never sent a text, but wouldn’t this work,  
[https://docs.inductiveautomation.com/display/DOC81/system.twilio.sendSms](https://docs.inductiveautomation.com/display/DOC81/system.twilio.sendSms)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 14, 2022, 4:55pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/11 "2022-09-14T16:55:38Z")

</div>

Some coworkers of mine recently “emailed” phone numbers at @vtext.com. So emailing something like  
[1234567890@vtext.com](mailto:1234567890@vtext.com) - the phone received this as a text message. Worked for Verizon phones.

---

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [September 14, 2022, 4:57pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/12 "2022-09-14T16:57:21Z")

</div>

Thanks for all reply, but sending a text is the easy part

I just need to know a way to send the value regularly with no condition

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 14, 2022, 4:58pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/13 "2022-09-14T16:58:57Z")

</div>

The gateway script @pturmel mentioned to me is the easiest.

---

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [September 14, 2022, 4:59pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/14 "2022-09-14T16:59:12Z")

</div>

Can you help me with an example

---

<div class="post-metadata">

**Author:** ![jamshidzade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jamshidzade/32/24927_2.png) [@jamshidzade](https://forum.inductiveautomation.com/u/jamshidzade)\
**Post date:** [September 14, 2022, 5:04pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/15 "2022-09-14T17:04:55Z")

</div>

I know I can use getMinute(now()) to get the minute, but I don’t know how I can reset it after reaching 120 minute

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 14, 2022, 5:10pm UTC](https://forum.inductiveautomation.com/t/send-tag-value-every-2-hours/64065/16 "2022-09-14T17:10:07Z")

</div>

Use `60 * (getHour(now()) % 2) + getMinute(now())`.
