# Help: Lost & confused

**URL:** https://discourse.nodered.org/t/help-lost-confused/91236
**Category:** General
**Tags:** home-assistant
**Created:** [24 September 2024 16:28 UTC](https://discourse.nodered.org/t/help-lost-confused/91236 "2024-09-24T16:28:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ragonz](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Ragonz](https://discourse.nodered.org/u/Ragonz)
#### Post date: [24 September 2024 16:28 UTC](https://discourse.nodered.org/t/help-lost-confused/91236/1 "2024-09-24T16:28:11Z")

</div>

I am trying to create a node red flow on Home assistant that will do the following

Check battery % of car  
Check current electricity cost

Based on the above 2 turn on the car charger

Then switch off the car charger if current cost or batter % goes out of a predefined range

Somthing like the following

If battery% \< 20 and current cost \< 0.15 turn on charger, if either of those become not turn switch off charger

If battery% \>=20 & 0\<=50 and current cost \<=0.05 turn on charger, if either of those become not turn switch off charger

If current cost \<0 turn on charger, if above 0 turn off charger

I think I can get the battery % out using poll state & use switch node to define what to do when the battery % is a certain amount but I'm not sure how to combine 2 different if statements for different entities.

I also can't work out how to switch a device on/off like in home assistant, can anyone shed some light?

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [24 September 2024 17:02 UTC](https://discourse.nodered.org/t/help-lost-confused/91236/2 "2024-09-24T17:02:38Z")

</div>

Welcome to the Forums @Ragonz

> [@Ragonz](#):
>
> I also can't work out how to switch a device on/off like in home assistant, can anyone shed some light?

We can help with the Node RED specific Nodes - but you will need to seek support from HA for rest

The first thing to do, is share your Flow where we can answer Node RED specifics.  
again - be VERY specific about the properties you want to query as no one here will understand HA, and is better suited being asked at the HA forums

---

<div class="post-metadata">

### Author: ![Ragonz](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Ragonz](https://discourse.nodered.org/u/Ragonz)
#### Post date: [25 September 2024 00:49 UTC](https://discourse.nodered.org/t/help-lost-confused/91236/3 "2024-09-25T00:49:28Z")

</div>

I was reccomended to use node red on the HA subreddit and for some reason though it was a sub module of HA.  
I think I'm going to leave node red for now.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [25 September 2024 07:17 UTC](https://discourse.nodered.org/t/help-lost-confused/91236/4 "2024-09-25T07:17:57Z")

</div>

Not a HA user

There is a sub category for node-red on the HA forum, where you will get more specific help about HA

Saying that have you attempted to use the state change node to monitor the battery?

---

<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: [24 December 2024 07:18 UTC](https://discourse.nodered.org/t/help-lost-confused/91236/5 "2024-12-24T07:18:38Z")

</div>

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