-
Notifications
You must be signed in to change notification settings - Fork 13
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
Non-existing attribute is returned and causes float conversion error #203
Comments
It seems to me that If that is the case, I will suggest to use {
"protocol": "IoTA-JSON",
"transport": "MQTT",
"explicitAttrs": false,
"device_id": ???,
"entity_name": "conCenFan_oveAct_u",
"entity_type": "Actuator",
"commands": [
{
"name": "conCenFan_oveAct_u",
"type": "command"
}
],
"attributes": [
...
],
"ngsiVersion": "v2"
} |
That is correct. But the type of the command is a Number, not "command". And we never changed this implementation, it was working some months ago. |
It works specifying the |
As far as I know, IoTagent will always create such an attribute in Orion. So I think the creation of And still, I recommend using Apart from that, are you expecting filip to ignore such a data type error? {
"conCenFan_oveAct_u": {
"type": "Number",
"value": ""
}
} |
ok, thanks! Yes, filip should avoid this error. The attr is not even listed in mongo-express. As the error only occurs due to the conversion from "" to float, this should be catched using some sort of |
I agree. I will have a look |
@FWuellhorst @djs0109 I just faced the exact same issue. I looked into it and the trouble occurs in the ContextAttribute creation and validation. Let's start at the beginning:
I'm happy to help out here :) It is true that this is annoying. However, I will not be free until November. Maybe @FWuellhorst @djs0109 you can already try to realize the second option. |
Oh, btw @FWuellhorst. If you use |
@tstorek Thanks for your suggestions! I saw that if the data type is For adding the Metadata in command will cause syntax error "commands": [
{
"name": "com1",
"type": "command",
"metadata": {
"unitCode": { "type": "Text", "value": "CAL" }
}
}
] But metadata in attributes can work "attributes": [
{
"name": "attr1",
"type": "Integer",
"metadata": {
"unitCode": { "type": "Text", "value": "CAL" }
}
}
], |
@djs0109 @FWuellhorst According to the previous test, we should do the two things:
What Do you think? Shall we allow any types favoring the missing metadata object? Mostly likely it would be useful also for the other conversions, right? |
Okay, thanks for checking! I would suggest to fix the |
I think I would add an |
Describe the bug
For this entity:
I get the following attributes when calling
get_attributes
in ngsi_v2:The attribute
conCenFan_oveAct_u
does not exist, and as the value is an empty string but the type a Number, I get a float conversion error.The text was updated successfully, but these errors were encountered: