# Counting the number of door openings. (Logic calculate does not work) \[solved\]

**URL:** <https://community.homey.app/t/counting-the-number-of-door-openings-logic-calculate-does-not-work-solved/162668>\
**Category:** Questions & Help\
**Tags:** logic\
**Created:** [November 25, 2026, 12:19pm UTC](https://community.homey.app/t/counting-the-number-of-door-openings-logic-calculate-does-not-work-solved/162668 "2026-11-25T12:19:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simvin](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/simvin/32/79673_2.png) [@Simvin](https://community.homey.app/u/Simvin)\
**Post date:** [November 25, 2026, 12:19pm UTC](https://community.homey.app/t/counting-the-number-of-door-openings-logic-calculate-does-not-work-solved/162668/1 "2026-11-25T12:19:19Z")

</div>

I want to count how many times a door is opened.

I have two Homey pro at different locations.

At one location the flow increases the variable.

At the other location the variable does not increase. Where it does not work I added an action where it sent a message to my phone. That worked so I know the magnetic contact and the flow works as intended.

What do I do wrong?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/0/80b87e129907c5dbfb4e6b1ae86a93ee5ef05c52.png)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/d/0dbe561aa370be7953a8c1ba4345c5c9dbfe03b0.png)

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [November 25, 2026, 2:19pm UTC](https://community.homey.app/t/counting-the-number-of-door-openings-logic-calculate-does-not-work-solved/162668/2 "2026-11-25T14:19:26Z")

</div>

A big maybe: the variable has to have a value before you can add 1. Maybe it’s empty?

---

<div class="post-metadata">

**Author:** ![DaneedeKruyff](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daneedekruyff/32/964_2.png) [@DaneedeKruyff](https://community.homey.app/u/DaneedeKruyff)\
**Post date:** [November 25, 2026, 3:01pm UTC](https://community.homey.app/t/counting-the-number-of-door-openings-logic-calculate-does-not-work-solved/162668/3 "2026-11-25T15:01:21Z")

</div>

No idea if this can be the cause, but your first flow seems to have a space in front of the plus sign, your second flow doesn’t.

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [November 25, 2026, 5:56pm UTC](https://community.homey.app/t/counting-the-number-of-door-openings-logic-calculate-does-not-work-solved/162668/4 "2026-11-25T17:56:43Z")

</div>

Press the flow’s test button and it should show an error msg.

---

<div class="post-metadata">

**Author:** ![Simvin](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/simvin/32/79673_2.png) [@Simvin](https://community.homey.app/u/Simvin)\
**Post date:** [November 25, 2026, 11:56pm UTC](https://community.homey.app/t/counting-the-number-of-door-openings-logic-calculate-does-not-work-solved/162668/5 "2026-11-25T23:56:21Z")

</div>

I changed the language from Swedish to English to make the screenshots. Then I changed the language back.

Now it works.
