# Automatic charge current creation

**URL:** <https://discourse.nodered.org/t/automatic-charge-current-creation/60662>\
**Category:** General\
**Tags:** function-node\
**Created:** [1 April 2022 20:26 UTC](https://discourse.nodered.org/t/automatic-charge-current-creation/60662 "2022-04-01T20:26:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![slapperia](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@slapperia](https://discourse.nodered.org/u/slapperia)\
**Post date:** [1 April 2022 20:26 UTC](https://discourse.nodered.org/t/automatic-charge-current-creation/60662/1 "2022-04-01T20:26:47Z")

</div>

Hello guys,  
I am new to Node RED and have made some simle function and dashboard to use on my boat.  
I am now trying to make the code in the picture. It is not working and I made it just for illustration only.

 ![B16DB8D8-439E-4615-8676-F9BF36E22024](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/57903ac47ec29dcebdd79d4c70051a76cb6edd2d.jpeg)

What I am trying to make is this:  
I read in the battery state of charge, if the Automatic charge current switch in the dashboard is set to TRUE, a value of X (120 in my example) is sent further.  
Then I want to reduce this value based on a temperature input.  
After the temperature reduction the value is sent to Charge current limit.  
If the value is over 20% I want no value to be sendt to the Charge current limit node.  
Instead I want to use the next line to adjust the 20-30%, 30-40% and so on.

Can someone please be so kind to show me how?  
Remember I am all green here. Please feed me with a teaspoon 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [31 May 2022 20:27 UTC](https://discourse.nodered.org/t/automatic-charge-current-creation/60662/2 "2022-05-31T20:27:07Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
