HASwitchPlate / openHASP-custom-component

Home Assistant custom component for openHASP
https://www.openhasp.com
MIT License
51 stars 12 forks source link

push_image service not working #73

Closed megawubs closed 2 years ago

megawubs commented 2 years ago

Version of the custom_component 0.6.3

Configuration


service: openhasp.push_image
target:
  entity_id: openhasp.plate
data:
  image: https://megawubs.duckdns.org/local/images/image.png
  obj: p2b17
{"page":1,"id":17,"obj":"img","x":230, "y":30, "w":70,"h":70, "border_color":"white", "border_opa":0, "src":"/littlefs/genietmomentjes.png", "auto_size":0}

Describe the bug

I'm unable to push an image to an image obj on my m5stack core 2. It doesn't matter if I add a url or path from /littlefs/*.png. The initial image is shown, but i'm unable to update it.

Debug log


[139951158890064] Error handling message: invalid url for dictionary value @ data['image']. Got None
fvanroie commented 2 years ago

What firmware version are you running on the M5stack?

nagyrobi commented 2 years ago

Try an url without https. Just plain http://

megawubs commented 2 years ago

What firmware version are you running on the M5stack?

I'm running version 0.6.1 on the M5Stack.

I'll try an non https url later today.

fvanroie commented 2 years ago

That service needs 0.6.2-development and preferably an ESP with PSram to work. You can grab the latest build from the Actions tab on Github.

nickrout commented 2 years ago

I am just developing a media player interface and this works to get the cover image from my media_player. Yoohoo.

nickrout commented 2 years ago

I have a question though, is the url templatable?

EDIT Well I can answer that myself, yes it is. http://hass.lan:8123{{state_attr('media_player.kitchen', 'entity_picture')}}

megawubs commented 2 years ago

I am just developing a media player interface and this works to get the cover image from my media_player. Yoohoo.

I'm also building a media player interface! Nice to know that this will work. Haven't had the time to look into this yet.

I would like to see your take on a media player interface, do you want to share it? I don't think this issue is the right place for it. Are you on the Home Assistant Discord channel?

nagyrobi commented 2 years ago

Try OpenHASP discord channel instead: https://discord.gg/BNG7mpNW

megawubs commented 2 years ago

After pushing a few images successfully, new images that are being pushed become distorted. Is this something with openHASP or is this part of this custom component?

The screenshot below explains it all. image

fvanroie commented 2 years ago

What do you see in the log file?

You should see something like:

[21:18:34.690][88624/91052  2][38336/38836  2] MQTT RCV: hasp/plate01/command/p1b15.src = http://home-assistant.local:8123/api/openhasp/serve/419764c4d81ca01c73307e1dd16274bb
[21:18:34.753][79024/82012  3][38336/38836  2] ATTR: HTTP OK: buffer created of 8196 bytes
[21:18:34.771][79024/83308  5][38336/38836  2] ATTR:     * HEADER READ: 4 bytes  w=64  h=64
[21:18:34.807][79024/86856  9][38336/38836  2] ATTR:     * HTTP READ: 7176 bytes
[21:18:34.823][79024/88612 10][38336/38836  2] ATTR:     * HTTP READ: 1016 bytes
[21:18:34.837][79024/88612 10][38336/38836  2] ATTR:     * HTTP TOTAL READ: 8196 bytes, 8196 expected

Can you download the src file and share it?

megawubs commented 2 years ago

It only happened a few times. Since posting the issue it didn't happen again

nickrout commented 2 years ago

I am just developing a media player interface and this works to get the cover image from my media_player. Yoohoo.

I'm also building a media player interface! Nice to know that this will work. Haven't had the time to look into this yet.

I would like to see your take on a media player interface, do you want to share it? I don't think this issue is the right place for it. Are you on the Home Assistant Discord channel?

No, don't really do discord!

Well I have not developed much yet, and it probably won't be very good! I have a particular need, fat fingers and a controller for next to the spa pool. I intend to only have play, pause and volume functionality, as well as the image of the album cover. The rest I will probably set up from a tablet or PC before going to the spa in the evening.