sbormann / ioBroker.alias-manager

Manages iobroker aliases
MIT License
12 stars 2 forks source link

invalid: obj.common.min has an invalid type! Expected "number", received "string" #36

Open RP70DP opened 2 years ago

RP70DP commented 2 years ago

Version 1.2.6 of Alias-Manager

2022-03-14 12:05:49.093  - warn: admin.0 (24767) Object alias.0.Haus.Obergeschoss.Wohnzimmer.Hue.Play.Links.reachable is invalid: obj.common.min has an invalid type! Expected "number", received "string"
2022-03-14 12:05:49.101  - warn: admin.0 (24767) This object will not be created in future versions. Please report this to the developer.
2022-03-14 12:05:49.135  - warn: admin.0 (24767) Object alias.0.Haus.Obergeschoss.Wohnzimmer.Hue.Play.Links.switch_on is invalid: obj.common.min has an invalid type! Expected "number", received "string"
2022-03-14 12:05:49.136  - warn: admin.0 (24767) This object will not be created in future versions. Please report this to the developer.
2022-03-14 12:08:12.150  - warn: admin.0 (24767) Object alias.0.Haus.Obergeschoss.Wohnzimmer.Hue.Play.Rechts.reachable is invalid: obj.common.min has an invalid type! Expected "number", received "string"
2022-03-14 12:08:12.151  - warn: admin.0 (24767) This object will not be created in future versions. Please report this to the developer.
2022-03-14 12:08:12.168  - warn: admin.0 (24767) Object alias.0.Haus.Obergeschoss.Wohnzimmer.Hue.Play.Rechts.switch_on is invalid: obj.common.min has an invalid type! Expected "number", received "string"
2022-03-14 12:08:12.169  - warn: admin.0 (24767) This object will not be created in future versions. Please report this to the developer.

Alias:


{
  "common": {
    "alias": {
      "id": "hue.0.Philips_hue.Hue_play_2.on",
      "read": "",
      "write": ""
    },
    "name": "switch_on",
    "role": "switch.light",
    "type": "boolean",
    "unit": "",
    "min": "",
    "max": "",
    "read": true,
    "write": true
  },
  "native": {},
  "type": "state",
  "from": "system.adapter.admin.0",
  "user": "system.user.admin",
  "ts": 1647256092168,
  "_id": "alias.0.Haus.Obergeschoss.Wohnzimmer.Hue.Play.Rechts.switch_on",
  "acl": {
    "object": 1636,
    "state": 1636,
    "owner": "system.user.admin",
    "ownerGroup": "system.group.administrator"
  }
}

Data:


{
  "_id": "hue.0.Philips_hue.Hue_play_2.on",
  "type": "state",
  "common": {
    "name": "Philips hue.Hue play 2.on",
    "read": true,
    "write": true,
    "type": "boolean",
    "role": "switch.light",
    "def": false
  },
  "native": {
    "id": "20"
  },
  "from": "system.adapter.hue.0",
  "user": "system.user.admin",
  "ts": 1647248884902,
  "acl": {
    "object": 1636,
    "state": 1636,
    "owner": "system.user.admin",
    "ownerGroup": "system.group.administrator"
  }
}
do1osc commented 1 year ago

Hello,

Is a solution available for this problem ?

chris299 commented 1 year ago

@sbormann I also see this issue. looks like it is related to undefined behaviour, if the original DataPoint does not provide common.min etc., so the alias manager chooses the wrong defaults here for numbers on creating the alias. "" instead of 0

asmitconsulting commented 11 months ago

I also seem to have the same problem - here on an alias for an HM-IP device - the warnings are generated for too many data points:

`2023-10-29 11:10:37.465 - warn: admin.0 (2600737) Object alias.0.AZ_Wandtaster_Schrank1.DUTY_CYCLE is invalid: obj.common.min has an invalid type! Expected "number", received "string"

2023-10-29 11:10:37.465 - warn: admin.0 (2600737) This object will not be created in future versions. Please report this to the developer. `

From HM-IP-Device

{ "type": "state", "common": { "name": "AZ_Wandtaster_Schrank1:0.DUTY_CYCLE", "role": "value", "def": false, "type": "boolean", "read": true, "write": false }, "native": { "MIN": false, "OPERATIONS": 5, "MAX": true, "FLAGS": 1, "ID": "DUTY_CYCLE", "TYPE": "BOOL", "DEFAULT": false }, "from": "system.adapter.hm-rega.1", "user": "system.user.admin", "ts": 1697651943757, "_id": "hm-rpc.5.000193C99D51C1.0.DUTY_CYCLE", "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }

Alias-Device:

{ "common": { "alias": { "id": "hm-rpc.5.000193C99D51C1.0.DUTY_CYCLE", "read": "", "write": "" }, "name": "DUTY_CYCLE", "role": "value", "type": "boolean", "unit": "", "min": "", "max": "", "read": true, "write": false }, "native": {}, "type": "state", "from": "system.adapter.admin.0", "user": "system.user.admin", "ts": 1698574237465, "_id": "alias.0.AZ_Wandtaster_Schrank1.DUTY_CYCLE", "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }