# setCapabilityValue when triggering a Action card

**URL:** <https://community.homey.app/t/setcapabilityvalue-when-triggering-a-action-card/89207>\
**Category:** Apps\
**Created:** [September 11, 2023, 4:49pm UTC](https://community.homey.app/t/setcapabilityvalue-when-triggering-a-action-card/89207 "2023-09-11T16:49:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel-567219](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daniel-567219/32/79186_2.png) [@Daniel-567219](https://community.homey.app/u/Daniel-567219)\
**Post date:** [September 11, 2023, 4:49pm UTC](https://community.homey.app/t/setcapabilityvalue-when-triggering-a-action-card/89207/1 "2023-09-11T16:49:43Z")

</div>

Hei,  
I’m trying to make my first app and want to sett the battery value when an action card is triggered. Have tried many different approaches and got one to work but then it stopped working. Can’t figure out what I did to get it to work or what I did to break it. I know that I can set it on a “schedule” so its always is up to date, but I am concerned that it is going to use up the battery when I don’t often need to see how much is left.

I am new to making apps and new to javascript so grateful for all help.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 11, 2023, 4:53pm UTC](https://community.homey.app/t/setcapabilityvalue-when-triggering-a-action-card/89207/2 "2023-09-11T16:53:50Z")

</div>

Let us consult our crystal balls 🔮 We’ll get back to you when we have received an answer from the afterlife.

Or, in case our crystal balls aren’t functioning properly, perhaps you can share your app’s code on Github or something similar so others can take a look at it.

---

<div class="post-metadata">

**Author:** ![Daniel-567219](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daniel-567219/32/79186_2.png) [@Daniel-567219](https://community.homey.app/u/Daniel-567219)\
**Post date:** [September 11, 2023, 5:13pm UTC](https://community.homey.app/t/setcapabilityvalue-when-triggering-a-action-card/89207/3 "2023-09-11T17:13:00Z")

</div>

> **[GitHub - dvia022/setCapabilityValue](https://github.com/dvia022/setCapabilityValue)**
>
> Contribute to dvia022/setCapabilityValue development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 11, 2023, 5:16pm UTC](https://community.homey.app/t/setcapabilityvalue-when-triggering-a-action-card/89207/4 "2023-09-11T17:16:07Z")

</div>

I don’t really understand what the problem is though.

From looking at the packages you’re including, it looks like you’re trying to implement a device driver for Nissan Leaf cars, and you want to be able to track the battery level of those cars. If that’s the case, what does that have to do with flows? The way it would normally work is that you receive (or ask for) the car’s battery level, and update the capability accordingly. That’s unrelated to flows.

---

<div class="post-metadata">

**Author:** ![Daniel-567219](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daniel-567219/32/79186_2.png) [@Daniel-567219](https://community.homey.app/u/Daniel-567219)\
**Post date:** [September 11, 2023, 5:42pm UTC](https://community.homey.app/t/setcapabilityvalue-when-triggering-a-action-card/89207/5 "2023-09-11T17:42:36Z")

</div>

When the charger starts i want to request the status from the car. If it’s that car that is charging I want to get the homey to notify me of how long it going to take.  
I don’t check battery status on my phone so I don’t want to use battery on homey constantly requesting battery status.
