# Virtual device problem - value from solar battery not updating

**URL:** <https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799>\
**Category:** Questions & Help\
**Created:** [September 27, 2024, 12:32pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799 "2024-09-27T12:32:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joske522](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joske522/32/12780_2.png) [@Joske522](https://community.homey.app/u/Joske522)\
**Post date:** [September 27, 2024, 12:32pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/1 "2024-09-27T12:32:49Z")

</div>

Hi guys,

I have created a virtual device that should show me the % charge state of my solar battery (info comes from Sofar inverter - sofar app on Homey).

I think I’m doing something wrong because it’s not working 🙂

Here is my simple flow:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/e/7e55ebf2f869bf8f1a099850acf82a7c1ef6f212.png)

I think there is something I’m not filling in correctly on the then card. The first empty bubble says “sensor” and the second one is “value”

I would like to get the battery % state on the Virtual Device card in the device overview.

Thanks!

---

<div class="post-metadata">

**Author:** ![Mike1233](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mike1233/32/20991_2.png) [@Mike1233](https://community.homey.app/u/Mike1233)\
**Post date:** [September 27, 2024, 12:50pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/2 "2024-09-27T12:50:32Z")

</div>

I think the problem is that you are using 2 tags.

At this page is showed how to use virtual devices.  
[https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883](https://community.homey.app/t/howto-set-a-value-to-a-virtual-device/45883)  
There they use examples for temperature.  
I tink that you must use neasure\_battery as tekst.  
But it depends on the capabilitys of your device.

If I am wrong there are more people reading here so the right answer will eventually show up…

---

<div class="post-metadata">

**Author:** ![Joske522](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joske522/32/12780_2.png) [@Joske522](https://community.homey.app/u/Joske522)\
**Post date:** [September 27, 2024, 1:19pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/3 "2024-09-27T13:19:38Z")

</div>

This works! Thanks 🙂

However: the virtual device shows a battery logo:

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/a/7a33cfc5b9dc4655c13cd954618124d4fb272f7b.png)

But I would like it to display in a numeric value in %, do you know how to get this done?

Thanks for the assistance!

---

<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:** [September 27, 2024, 1:47pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/4 "2024-09-27T13:47:52Z")

</div>

In that case you’ll need to use an [advanced virtual device](https://community.homey.app/t/app-pro-advanced-virtual-device-device-capabilities-app-with-unique-text-status-indicator/68198). Often you even don’t need flows to update the device values.

---

<div class="post-metadata">

**Author:** ![Joske522](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joske522/32/12780_2.png) [@Joske522](https://community.homey.app/u/Joske522)\
**Post date:** [September 27, 2024, 2:20pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/5 "2024-09-27T14:20:53Z")

</div>

Ok trying to get this to work 🙂  
I have this for the moment, but I need to fill in a BLLExpression (but the field is greyed out?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/8/8873795aac3c426254fa7bc5c0b2c5f51954b128.png)  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/7/7795828bf19b3544a8e873b69763e6993dbbd9cf.png)

Am I on the right path? 🙂

Thank you!

---

<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:** [September 27, 2024, 2:22pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/6 "2024-09-27T14:22:58Z")

</div>

Nice!  
Try using a Number field. The percentage is a numeric value (as shown).  
“React” can be left empty (you can’t command a battery level).

---

<div class="post-metadata">

**Author:** ![Joske522](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joske522/32/12780_2.png) [@Joske522](https://community.homey.app/u/Joske522)\
**Post date:** [September 27, 2024, 4:28pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/7 "2024-09-27T16:28:54Z")

</div>

Nice! Almost there! 🙂

Now the only issue is that the value in the tile shows 2400% instead of 24% that is represented when you click the tile…

Thanks for your support!

---

<div class="post-metadata">

**Author:** ![Joske522](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joske522/32/12780_2.png) [@Joske522](https://community.homey.app/u/Joske522)\
**Post date:** [September 27, 2024, 6:17pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/8 "2024-09-27T18:17:39Z")

</div>

Looks like the app is showing a 100x value, the web interface shows the correct value…

---

<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:** [September 27, 2024, 9:21pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/9 "2024-09-27T21:21:35Z")

</div>

The issue is: homey works with 0 to 1 values internally, and in flow cards. Somehow when you use % as unit, it multiplies the value with 100 to convert it into a % value.  
The battery reports 0 to 100 probably, so you’ll have to add a / 100 (divide by 100) calculation.  
On top of my head you’d enter `$value/100` into the BLL field to solve it

> [@\[APP\]\[Pro\] Advanced Virtual Device (Device Capabilities App) with Unique Text Status Indicator](https://community.homey.app/t/app-pro-advanced-virtual-device-device-capabilities-app-with-unique-text-status-indicator/68198/617):
>
> I think it is a Athom bug/definition thing… See picture below. Selected 0.9% is displayed as 90%. See also [Lamellas - run down and then tilt - #27 by robertklep](https://community.homey.app/t/lamellas-run-down-and-then-tilt/115738/27) Athom has fallen into their own trap. It has to do that a parameter which defines a percentage is always between 0 and 1.

---

<div class="post-metadata">

**Author:** ![Joske522](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joske522/32/12780_2.png) [@Joske522](https://community.homey.app/u/Joske522)\
**Post date:** [September 28, 2024, 3:10pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/10 "2024-09-28T15:10:23Z")

</div>

> [@Peter\_Kawa](#):
>
> $value/100

You are the man 🙂 Thanks! This worked perfectly

---

<div class="post-metadata">

**Author:** ![Kai\_Engvik](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kai_engvik/32/48687_2.png) [@Kai\_Engvik](https://community.homey.app/u/Kai_Engvik)\
**Post date:** [September 29, 2024, 2:14pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/11 "2024-09-29T14:14:23Z")

</div>

How do you make the BLL field available for input?

---

<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:** [September 29, 2024, 9:13pm UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/12 "2024-09-29T21:13:55Z")

</div>

Don’t know, just enter something and see what happens  
What Joske522 described as ‘grayed out’, this one:

> ![1000035266](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/c/7c58bfa26ca665178d99ae938196dfb3cb6fddfd.jpeg)  
> isn’t grayed out, the red line even points to it being a mandatory field.

Kay, is your Q about number fields, or text fields?

Do these examples make sense?

> ![1000035262](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/8/38ae4fde11b4f2927db214e363693477589d5fc7.jpeg)

> ![1000035264](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/a/fa27ce69a3ac219ec94912f25eaddbf18fab75f0.jpeg)

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [September 30, 2024, 3:54am UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/13 "2024-09-30T03:54:49Z")

</div>

I never understood: What is the difference between “Calculation BLL expression” and “BLL Expression” in the second picture?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [September 30, 2024, 5:21am UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/14 "2024-09-30T05:21:45Z")

</div>

@Rmb  
Not much actually.  
But the caculation field is required with multiple reflect devices to require a group calculation.  
The first version with it, just used the BLL expression field and made it mandatory. But users than didnt notice why they couldn’t save it, if the left the field empty.

Also it gives you a change of writing a calculation to get one value of all devices, and then use that value to calculate with all grouped values.  
So in some cases, it gives better readability.

---

<div class="post-metadata">

**Author:** ![Kai\_Engvik](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kai_engvik/32/48687_2.png) [@Kai\_Engvik](https://community.homey.app/u/Kai_Engvik)\
**Post date:** [September 30, 2024, 5:33am UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/15 "2024-09-30T05:33:07Z")

</div>

> [@Peter\_Kawa](#):
>
> Kay, is your Q about number fields, or text fields?
> 
> Do these examples make sense?

Hi, thanks for your response. It is a number field, and BLL is not shown 🙂

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

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [September 30, 2024, 6:53am UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/16 "2024-09-30T06:53:55Z")

</div>

> [@Arie\_J\_Godschalk](#):
>
> that value to calculate with all grouped values.

I thought so, but how do I address this calculated value?

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [September 30, 2024, 7:12am UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/17 "2024-09-30T07:12:00Z")

</div>

> [@Rmb](#):
>
> how do I address this calculated value?

The result from the Calculation field is available as $value in the Expression field.  
$values is available in both fields.

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [September 30, 2024, 7:30am UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/18 "2024-09-30T07:30:50Z")

</div>

That is a well-kept secret😀

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [September 30, 2024, 7:41am UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/19 "2024-09-30T07:41:52Z")

</div>

> [@Rmb](#):
>
> secret

Well, its shown in the tooltip next to the fields.

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [September 30, 2024, 7:54am UTC](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799/20 "2024-09-30T07:54:44Z")

</div>

Yes, I see it right now 😁  
To be honest: it took me a while before I understood why sometimes there was one “BLL” field and sometimes two. The latter in the case one is reflecting more than 1 device/field. It is quite a sophisticated user interface.

[Next page](https://community.homey.app/t/virtual-device-problem-value-from-solar-battery-not-updating/116799.md?page=2)
