Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting lots of erroneous data from the modem #6

Open
dlarue opened this issue Feb 11, 2021 · 1 comment
Open

getting lots of erroneous data from the modem #6

dlarue opened this issue Feb 11, 2021 · 1 comment

Comments

@dlarue
Copy link

dlarue commented Feb 11, 2021

Output from the Persistence Server Stats flow, influx node, seems to be getting almost every other message as invalid:

Error: A 400 Bad Request error occurred: {"error":"unable to parse 'efficiency,modem=ff070618,inverter=4108 value=Infinity': invalid boolean"}

@dlarue
Copy link
Author

dlarue commented Feb 11, 2021

As a patch, I added a test for msg.payload[0] and drop the msg if invalid...

const parts = msg.topic.split("/")
p = msg.payload[0]
if( !isNaN(p) ){
const value = parseFloat(msg.payload)
if(!isNaN(value) && parts.length==5){
msg.measurement = parts[4]
const data = [
{
value: value
},
{
modem: parts[1],
inverter: parts[3]
}
];
msg.payload = data
return msg;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant