ioBroker.simple-api icon indicating copy to clipboard operation
ioBroker.simple-api copied to clipboard

Add get/setBinaryState

Open klein0r opened this issue 3 years ago • 3 comments

Describe the bug

I'm not able to get binary information of states

To Reproduce

  1. Create a state with type file
  2. Use setBinaryState to store binary information (like an image)
  3. Call http://ip:8087/getPlainValue/your.state.id
  4. See error error: datapoint "[object Object]" not found

Expected behavior

Return the binary information of state

Versions:

  • Adapter version: 2.6.2
  • JS-Controller version: 3.3.22
  • Node version: v14.18.1
  • Operating system: Linux Debian Bullseye

klein0r avatar Jan 15 '22 16:01 klein0r

Additional issue:

https://github.com/ioBroker/ioBroker.simple-api/blob/e74ee7040565e8d0597d2f5bce014f2322c5d7ac/lib/simpleapi.js#L831

originId contains my translated name object:

{"en":"Thumbnail","de":"Miniaturansicht","ru":"Миниатюра","pt":"Miniatura","nl":"Miniatuur","fr":"La vignette","it":"Miniatura","es":"Miniatura","pl":"Miniaturka","zh-cn":"缩略图"}

So... error: datapoint "[object Object]" not found is not true. It was found.

klein0r avatar Jan 15 '22 16:01 klein0r

my idea would to to introduce a "getBinaryValue" endoint ...

Apollon77 avatar Jan 15 '22 23:01 Apollon77

The "name" topic will be fixed. binary state support is an enhancement for later

Apollon77 avatar Feb 17 '22 21:02 Apollon77