#trying to do something really stupid but

1 messages · Page 1 of 1 (latest)

keen hill
#

explain what you're trying to do and post your flow

potent spear
#

it's a flow to work how much money is being made by my solar system and also how much money is being saved by not having to draw power from the grid

#

to get around it losing the data on a restart or redeploy I was using the persist nodes to feed the last value back into the sum node on restart

keen hill
#

what sensor are working as expected and which aren't

potent spear
#

soalr total gained and monthly gained both work fine

#

cost test and cost test monthly are the ones that lose their place

#

and now don't work at all

#

it's possible the other 2 are also broken but it won't tell me that until data is fed to them once the sun comes up

keen hill
#

you still don't have those two checked to resend on connect

potent spear
#

oh yeah I unchecked them because it didn't do anything

keen hill
#

it will fix your issue

potent spear
#

it didn't seem to in testing

keen hill
#

once they send a value it will resend the last sent value on a reconnect

potent spear
#

yeah but then because the sum node starts again it just overwrites it with the lower value

keen hill
#

you also have the home_Assistant_client event do stuff

#

is that sending a wrong value

potent spear
#

I've just added that from a forum post I found you in as a way to trigger the persistent node to feed the last value back into the sum node

#

but adding that has seemed to have broken everything

keen hill
#

you can also check the "show debug information" in the sensor entity config node to see everytime it updates HA

#

might help track down when the bad value is sent

potent spear
#

that's what the 2 cost test nodes spit out, but how would adding that event node have broken the entire thing?

keen hill
#

neither of those are updating the sensor

#

those are the data sent to create the sensor

potent spear
#

it can't be updated anymore, the integration keeps complaining about both missing credentials and the fact it isn't loaded

#

ever since I imported that event example

potent spear
#

``Version: 0.65.0

Home Assistant instances: 3
Server: 23bc7ade.f3e506
Home Assistant version: 2024.6.4
Companion version: 4.0.0
Server: 1e5734de.b5addb
Home Assistant version: 2024.6.4
Companion version: 4.0.0
Server: 2e31528c.f3973e
Home Assistant version: 2024.6.4
Companion version: 4.0.0

Node-RED version: 4.0.0
Docker: yes
Add-on: no

Node.js version: v18.20.3 x64 linux
OS: Linux 6.6.33-haos x64
``

keen hill
#

what's the difference between "cost test" and "cost test monthly"? one get reset montly?

potent spear
#

yeah

#

that's why the reset trigger is hooked into the monthly generation figure

#

if that turns to 0 it triggers a reset

keen hill
#

what are the entity ids for the two sensors

potent spear
#

de422d9810618e60

keen hill
#

in HA it's sensor.de422d9810618e60?

potent spear
#

and b7ab657ca133817e

#

doesn't it use the friendly name in ha?

keen hill
#

the entity_id not the friendly name

potent spear
#

in ha they show as this

keen hill
#

so which one is teh "cost test" node

#

and the "cost test monthly node"

potent spear
#

tbh I don't know why there's 3 of the same thing

#

but cost test daily is the de422 one

#

and cost test monthly is the b7ab one

keen hill
#

the reason you have multiple is because you probably have multi entity config nodes

potent spear
#

well I got rid of the multiple listed ha servers, found out that happens when you import examples

potent spear
#

hasn't done anything to fix the sensor nodes freaking out about the addon not being there though

potent spear
keen hill
#

in the two sensor nodes the entity_id needs to be changed to the correct ones are I wasn't sure which ones were referenced in teh image

#

payload + $number($entities("sensor.cost_test_daily").state)

#

also in the sensor entity configs need to have "resend" checked

potent spear
#

hmm, I can't actually test organically anymore though as the battery is depleted

#

so it'll have to wait until the sun comes up

#

okay I forced it with an inject node, so you have the actual sensor nodes themselves just doing the summing now?

#

the monthly one is reporting a json error tho

keen hill
potent spear
#

"JSONataError: Unable to cast value to a number: "unavailable""

keen hill
#

then it's reference the wrong entity id

#

sensor.cost_test_monthly

potent spear
#

that's the friendly name of the sensor tho, it can't be anything else

keen hill
#

create an inject node that goes into with a payload

potent spear
#

there's so many duplicates though, am I able to just delete them all and start again making new sensors?

keen hill
#

and see what node updates

#

look into your entity configs and delete them

potent spear
#

got it

#

that's much cleaner

keen hill
#

you can round by wrapping it with $round(...)

potent spear
#

oh okay, I've never done json stuff before that's why I was doing everything with nodes

keen hill
#

you can do whatever works for you. atleast you can understand it

potent spear
#

obviously I can't really test it until the sun comes up so I'll keep an eye on it